cast pointers correctly, ioctl cmds are u_longs, most int \!= long

type bogons.  two on-inspection fixes.
This commit is contained in:
cgd 1995-03-08 02:16:07 +00:00
parent e7c1a9e7f9
commit d4c091877f
7 changed files with 21 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: clnp_frag.c,v 1.5 1994/06/29 06:39:10 cgd Exp $ */
/* $NetBSD: clnp_frag.c,v 1.6 1995/03/08 02:16:07 cgd Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -584,7 +584,7 @@ struct clnp_segment *seg; /* segment part of fragment header */
u_int bytes;
/* determine if header is not word aligned */
pad = (int)clnp % 4;
pad = (long)clnp % 4;
if (pad < 0)
pad = -pad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cltp_usrreq.c,v 1.5 1994/06/29 06:39:25 cgd Exp $ */
/* $NetBSD: cltp_usrreq.c,v 1.6 1995/03/08 02:16:09 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@ -268,7 +268,7 @@ cltp_usrreq(so, req, m, nam, control)
int s, error = 0;
if (req == PRU_CONTROL)
return (iso_control(so, (int)m, (caddr_t)nam,
return (iso_control(so, (long)m, (caddr_t)nam,
(struct ifnet *)control));
if ((isop == NULL && req != PRU_ATTACH) ||
(control && control->m_len)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: iso.c,v 1.7 1994/06/29 06:39:39 cgd Exp $ */
/* $NetBSD: iso.c,v 1.8 1995/03/08 02:16:11 cgd Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -412,7 +412,7 @@ caddr_t buf; /* RESULT: network portion of address here */
/* ARGSUSED */
iso_control(so, cmd, data, ifp)
struct socket *so;
int cmd;
u_long cmd;
caddr_t data;
register struct ifnet *ifp;
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: iso_errno.h,v 1.5 1994/06/29 06:39:44 cgd Exp $ */
/* $NetBSD: iso_errno.h,v 1.6 1995/03/08 02:16:13 cgd Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -112,7 +112,9 @@ SOFTWARE.
/* */
/******************************************************************************/
#ifdef notdef /* This doesn't look like legal C to me or the compiler. */
#define E_CLNL_??? (CLNL_ERROR_MASK | 0x1) /* explanation */
#endif
/******************************************************************************/
/* */

View File

@ -1,4 +1,4 @@
/* $NetBSD: tp_input.c,v 1.5 1994/06/29 06:40:13 cgd Exp $ */
/* $NetBSD: tp_input.c,v 1.6 1995/03/08 02:16:14 cgd Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -150,14 +150,14 @@ tp_inputprep(m)
if((m = m_pullup(m, 1)) == MNULL)
return (MNULL);
}
if(((int)m->m_data) & 0x3) {
if(((long)m->m_data) & 0x3) {
/* If we are not 4-byte aligned, we have to be
* above the beginning of the mbuf, and it is ok just
* to slide it back.
*/
caddr_t ocp = m->m_data;
m->m_data = (caddr_t)(((int)m->m_data) & ~0x3);
m->m_data = (caddr_t)(((long)m->m_data) & ~0x3);
bcopy(ocp, m->m_data, (unsigned)m->m_len);
}
CHANGE_MTYPE(m, TPMT_DATA);

View File

@ -1,4 +1,4 @@
/* $NetBSD: tp_pcb.c,v 1.5 1994/06/29 06:40:26 cgd Exp $ */
/* $NetBSD: tp_pcb.c,v 1.6 1995/03/08 02:16:16 cgd Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -636,7 +636,7 @@ register struct tp_pcb *tpcb;
*/
tp_attach(so, protocol)
struct socket *so;
int protocol;
long protocol;
{
register struct tp_pcb *tpcb;
int error = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tp_usrreq.c,v 1.5 1994/06/29 06:40:49 cgd Exp $ */
/* $NetBSD: tp_usrreq.c,v 1.6 1995/03/08 02:16:18 cgd Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -393,7 +393,7 @@ tp_usrreq(so, req, m, nam, controlp)
tpcb?tpcb->tp_state:0);
ENDTRACE
if ((u_int)tpcb == 0 && req != PRU_ATTACH) {
if ((u_long)tpcb == 0 && req != PRU_ATTACH) {
IFTRACE(D_REQUEST)
tptraceTPCB(TPPTusrreq, "req failed NO TPCB[", 0, 0, 0, 0);
ENDTRACE
@ -406,7 +406,7 @@ tp_usrreq(so, req, m, nam, controlp)
case PRU_ATTACH:
if (tpcb) {
error = EISCONN;
} else if ((error = tp_attach(so, (int)nam)) == 0)
} else if ((error = tp_attach(so, (long)nam)) == 0)
tpcb = sototpcb(so);
break;
@ -415,7 +415,7 @@ tp_usrreq(so, req, m, nam, controlp)
* parent (accepting) socket
*/
if (tpcb->tp_state == TP_OPEN || tpcb->tp_state == TP_CONFIRMING) {
E.ATTR(T_DISC_req).e_reason = E_TP_NO_SESSION;
E.ATTR(T_DISC_req).e_reason = E_TP_NO_SESSION ^ TP_ERROR_MASK;
error = DoEvent(T_DISC_req); /* pretend it was a close() */
break;
} /* else DROP THROUGH */
@ -438,7 +438,7 @@ tp_usrreq(so, req, m, nam, controlp)
case PRU_SHUTDOWN:
/* recv end may have been released; local credit might be zero */
case PRU_DISCONNECT:
E.ATTR(T_DISC_req).e_reason = E_TP_NORMAL_DISC;
E.ATTR(T_DISC_req).e_reason = E_TP_NORMAL_DISC ^ TP_ERROR_MASK;
error = DoEvent(T_DISC_req);
break;
@ -561,7 +561,7 @@ tp_usrreq(so, req, m, nam, controlp)
so->so_rcv.sb_cc, sbspace(&so->so_rcv),
so->so_rcv.sb_hiwat);
ENDDEBUG
if (((int)nam) & MSG_OOB)
if (((long)nam) & MSG_OOB)
error = DoEvent(T_USR_Xrcvd);
else
error = DoEvent(T_USR_rcvd);
@ -577,7 +577,7 @@ tp_usrreq(so, req, m, nam, controlp)
break;
}
/* kludge - nam is really flags here */
error = tp_rcvoob(tpcb, so, m, outflags, (int)nam);
error = tp_rcvoob(tpcb, so, m, outflags, (long)nam);
break;
case PRU_SEND: