From cf04e8aca91e40a0d8096d01462439d650a63d6e Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 1 Sep 2006 19:10:01 +0000 Subject: *** empty log message *** --- cpukit/libcsupport/src/readdir.c | 3 ++- cpukit/libnetworking/net/if.h | 2 +- cpukit/libnetworking/net/pppcompress.c | 6 +++--- cpukit/libnetworking/net/raw_usrreq.c | 2 +- cpukit/libnetworking/netinet/in_cksum.c | 2 +- cpukit/libnetworking/netinet/ip.h | 2 +- cpukit/libnetworking/netinet/ip_divert.c | 2 +- cpukit/libnetworking/sys/mbuf.h | 2 +- cpukit/librpc/src/xdr/xdr_rec.c | 34 ++++++++++++++++---------------- cpukit/librpc/src/xdr/xdr_sizeof.c | 4 ++-- cpukit/score/include/rtems/score/tod.h | 2 +- 11 files changed, 31 insertions(+), 30 deletions(-) (limited to 'cpukit') diff --git a/cpukit/libcsupport/src/readdir.c b/cpukit/libcsupport/src/readdir.c index bcff3d951a..36f4ccf879 100644 --- a/cpukit/libcsupport/src/readdir.c +++ b/cpukit/libcsupport/src/readdir.c @@ -45,6 +45,7 @@ static char sccsid[] = "@(#)readdir.c 5.7 (Berkeley) 6/1/90"; #endif #include +#include int getdents( int dd_fd, @@ -77,7 +78,7 @@ register DIR *dirp; { continue; } dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); - if ((int)dp & 03) /* bogus pointer check */ + if ((intptr_t)dp & 03) /* bogus pointer check */ return NULL; if (dp->d_reclen <= 0 || dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc) diff --git a/cpukit/libnetworking/net/if.h b/cpukit/libnetworking/net/if.h index 45d9e0bd7f..7a5d048f35 100644 --- a/cpukit/libnetworking/net/if.h +++ b/cpukit/libnetworking/net/if.h @@ -212,7 +212,7 @@ struct ifreq { struct sockaddr ifru_broadaddr; short ifru_flags[2]; int32_t ifru_metric; - int ifru_mtu; + int32_t ifru_mtu; int ifru_phys; int ifru_media; caddr_t ifru_data; diff --git a/cpukit/libnetworking/net/pppcompress.c b/cpukit/libnetworking/net/pppcompress.c index 5c924e0446..ea98bdd852 100644 --- a/cpukit/libnetworking/net/pppcompress.c +++ b/cpukit/libnetworking/net/pppcompress.c @@ -426,10 +426,10 @@ vj_uncompress_tcp(bufp, len, type, comp) * header (we assume the packet we were handed has enough space to * prepend 128 bytes of header). */ - if ((int)cp & 3) { + if ((intptr_t)cp & 3) { if (len > 0) - (void) ovbcopy(cp, (caddr_t)((int)cp &~ 3), len); - cp = (u_char *)((int)cp &~ 3); + (void) ovbcopy(cp, (caddr_t)((intptr_t)cp &~ 3), len); + cp = (u_char *)((intptr_t)cp &~ 3); } cp -= hlen; len += hlen; diff --git a/cpukit/libnetworking/net/raw_usrreq.c b/cpukit/libnetworking/net/raw_usrreq.c index fb4faf4d6d..bb79355d1f 100644 --- a/cpukit/libnetworking/net/raw_usrreq.c +++ b/cpukit/libnetworking/net/raw_usrreq.c @@ -174,7 +174,7 @@ raw_usrreq(so, req, m, nam, control) error = EACCES; break; } - error = raw_attach(so, (int)nam); + error = raw_attach(so, (intptr_t)nam); break; /* diff --git a/cpukit/libnetworking/netinet/in_cksum.c b/cpukit/libnetworking/netinet/in_cksum.c index e4d8698dee..6f356b995b 100644 --- a/cpukit/libnetworking/netinet/in_cksum.c +++ b/cpukit/libnetworking/netinet/in_cksum.c @@ -117,7 +117,7 @@ in_cksum(m, len) /* * Force to even boundary. */ - if ((1 & (int) w) && (mlen > 0)) { + if ((1 & (intptr_t) w) && (mlen > 0)) { REDUCE; sum <<= 8; s_util.c[0] = *(u_char *)w; diff --git a/cpukit/libnetworking/netinet/ip.h b/cpukit/libnetworking/netinet/ip.h index e8e540a37d..148f68874e 100644 --- a/cpukit/libnetworking/netinet/ip.h +++ b/cpukit/libnetworking/netinet/ip.h @@ -94,7 +94,7 @@ struct ip { CTASSERT(sizeof (struct ip) == 20); #endif -#define IP_MAXPACKET 65535 /* maximum packet size */ +#define IP_MAXPACKET 65535L /* maximum packet size */ /* * Definitions for IP type of service (ip_tos) diff --git a/cpukit/libnetworking/netinet/ip_divert.c b/cpukit/libnetworking/netinet/ip_divert.c index c681f8dc10..a28f606b88 100644 --- a/cpukit/libnetworking/netinet/ip_divert.c +++ b/cpukit/libnetworking/netinet/ip_divert.c @@ -295,7 +295,7 @@ div_usrreq(so, req, m, nam, control) if (error) break; inp = (struct inpcb *)so->so_pcb; - inp->inp_ip_p = (int)nam; /* XXX */ + inp->inp_ip_p = (intptr_t)nam; /* XXX */ inp->inp_flags |= INP_HDRINCL; /* The socket is always "connected" because we always know "where" to send the packet */ diff --git a/cpukit/libnetworking/sys/mbuf.h b/cpukit/libnetworking/sys/mbuf.h index c5e34fce11..813d920c7b 100644 --- a/cpukit/libnetworking/sys/mbuf.h +++ b/cpukit/libnetworking/sys/mbuf.h @@ -83,7 +83,7 @@ struct m_hdr { */ struct pkthdr { struct ifnet *rcvif; /* rcv interface */ - int len; /* total packet length */ + int32_t len; /* total packet length */ }; /* diff --git a/cpukit/librpc/src/xdr/xdr_rec.c b/cpukit/librpc/src/xdr/xdr_rec.c index d87b413ee6..9ce73577b7 100644 --- a/cpukit/librpc/src/xdr/xdr_rec.c +++ b/cpukit/librpc/src/xdr/xdr_rec.c @@ -96,7 +96,7 @@ static struct xdr_ops xdrrec_ops = { * meet the needs of xdr and rpc based on tcp. */ -#define LAST_FRAG ((u_int32_t)(1 << 31)) +#define LAST_FRAG ((u_int32_t)(1L << 31)) typedef struct rec_strm { caddr_t tcp_handle; @@ -165,7 +165,7 @@ xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit) return; } for (rstrm->out_base = rstrm->the_buffer; - (u_long)rstrm->out_base % BYTES_PER_XDR_UNIT != 0; + (uintptr_t)rstrm->out_base % BYTES_PER_XDR_UNIT != 0; rstrm->out_base++); rstrm->in_base = rstrm->out_base + sendsize; /* @@ -205,7 +205,7 @@ xdrrec_getlong(xdrs, lp) /* first try the inline, fast case */ if ((rstrm->fbtbc >= sizeof(int32_t)) && - (((long)rstrm->in_boundry - (long)buflp) >= sizeof(int32_t))) { + (((intptr_t)rstrm->in_boundry - (intptr_t)buflp) >= sizeof(int32_t))) { *lp = (long)ntohl((u_int32_t)(*buflp)); rstrm->fbtbc -= sizeof(int32_t); rstrm->in_finger += sizeof(int32_t); @@ -279,8 +279,8 @@ xdrrec_putbytes(xdrs, addr, len) register long current; while (len > 0) { - current = (u_long)rstrm->out_boundry - - (u_long)rstrm->out_finger; + current = (intptr_t)rstrm->out_boundry - + (intptr_t)rstrm->out_finger; current = (len < current) ? len : current; memcpy(rstrm->out_finger, addr, current); rstrm->out_finger += current; @@ -302,7 +302,7 @@ xdrrec_getpos(xdrs) register RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; register long pos; - pos = lseek((int)(long)rstrm->tcp_handle, (off_t) 0, 1); + pos = lseek((intptr_t)rstrm->tcp_handle, (off_t) 0, 1); if (pos != -1) switch (xdrs->x_op) { @@ -465,14 +465,14 @@ xdrrec_endofrecord(xdrs, sendnow) register u_long len; /* fragment length */ if (sendnow || rstrm->frag_sent || - ((u_long)rstrm->out_finger + sizeof(u_int32_t) >= - (u_long)rstrm->out_boundry)) { + ((uintptr_t)rstrm->out_finger + sizeof(u_int32_t) >= + (uintptr_t)rstrm->out_boundry)) { rstrm->frag_sent = FALSE; return (flush_out(rstrm, TRUE)); } - len = (u_long)(rstrm->out_finger) - (u_long)(rstrm->frag_header) - + len = (uintptr_t)(rstrm->out_finger) - (uintptr_t)(rstrm->frag_header) - sizeof(u_int32_t); - *(rstrm->frag_header) = htonl((u_long)len | LAST_FRAG); + *(rstrm->frag_header) = htonl((u_int32_t)len | LAST_FRAG); rstrm->frag_header = (u_int32_t *)rstrm->out_finger; rstrm->out_finger += sizeof(u_int32_t); return (TRUE); @@ -487,12 +487,12 @@ flush_out(rstrm, eor) register RECSTREAM *rstrm; bool_t eor; { - register u_long eormask = (eor == TRUE) ? LAST_FRAG : 0; - register u_int32_t len = (u_long)(rstrm->out_finger) - - (u_long)(rstrm->frag_header) - sizeof(u_int32_t); + register u_int32_t eormask = (eor == TRUE) ? LAST_FRAG : 0; + register u_int32_t len = (uintptr_t)(rstrm->out_finger) - + (uintptr_t)(rstrm->frag_header) - sizeof(u_int32_t); *(rstrm->frag_header) = htonl(len | eormask); - len = (u_long)(rstrm->out_finger) - (u_long)(rstrm->out_base); + len = (uintptr_t)(rstrm->out_finger) - (uintptr_t)(rstrm->out_base); if ((*(rstrm->writeit))(rstrm->tcp_handle, rstrm->out_base, (int)len) != (int)len) return (FALSE); @@ -510,7 +510,7 @@ fill_input_buf(rstrm) register long len; where = rstrm->in_base; - i = (u_long)rstrm->in_boundry % BYTES_PER_XDR_UNIT; + i = (uintptr_t)rstrm->in_boundry % BYTES_PER_XDR_UNIT; where += i; len = rstrm->in_size - i; if ((len = (*(rstrm->readit))(rstrm->tcp_handle, where, len)) == -1) @@ -530,7 +530,7 @@ get_input_bytes(rstrm, addr, len) register long current; while (len > 0) { - current = (long)rstrm->in_boundry - (long)rstrm->in_finger; + current = (intptr_t)rstrm->in_boundry - (intptr_t)rstrm->in_finger; if (current == 0) { if (! fill_input_buf(rstrm)) return (FALSE); @@ -577,7 +577,7 @@ skip_input_bytes(rstrm, cnt) register long current; while (cnt > 0) { - current = (long)rstrm->in_boundry - (long)rstrm->in_finger; + current = (intptr_t)rstrm->in_boundry - (intptr_t)rstrm->in_finger; if (current == 0) { if (! fill_input_buf(rstrm)) return (FALSE); diff --git a/cpukit/librpc/src/xdr/xdr_sizeof.c b/cpukit/librpc/src/xdr/xdr_sizeof.c index 5a4c1a78dc..70ea012e45 100644 --- a/cpukit/librpc/src/xdr/xdr_sizeof.c +++ b/cpukit/librpc/src/xdr/xdr_sizeof.c @@ -89,7 +89,7 @@ x_inline(xdrs, len) if (xdrs->x_op != XDR_ENCODE) { return (NULL); } - if (len < (long) xdrs->x_base) { + if (len < (intptr_t) xdrs->x_base) { /* x_private was already allocated */ xdrs->x_handy += len; return ((int32_t *) xdrs->x_private); @@ -101,7 +101,7 @@ x_inline(xdrs, len) xdrs->x_base = 0; return (NULL); } - xdrs->x_base = (caddr_t) len; + xdrs->x_base = (caddr_t)((intptr_t) len); xdrs->x_handy += len; return ((int32_t *) xdrs->x_private); } diff --git a/cpukit/score/include/rtems/score/tod.h b/cpukit/score/include/rtems/score/tod.h index af416a529d..8f5256e245 100644 --- a/cpukit/score/include/rtems/score/tod.h +++ b/cpukit/score/include/rtems/score/tod.h @@ -279,7 +279,7 @@ void _TOD_Tickle( * * @note This must be a macro so it can be used in "static" tables. */ -#define TOD_MILLISECONDS_TO_MICROSECONDS(_ms) ((_ms) * 1000) +#define TOD_MILLISECONDS_TO_MICROSECONDS(_ms) ((uint32_t)(_ms) * 1000L) /** @brief TOD_MICROSECONDS_TO_TICKS * -- cgit v1.2.3