2005-04-28 Joel Sherrill <joel@OARcorp.com>

* libnetworking/kern/kern_sysctl.c, libnetworking/libc/inet_ntop.c,
	libnetworking/net/if_ppp.c, libnetworking/net/pppcompress.c,
	libnetworking/net/slcompress.c, libnetworking/netinet/ip_output.c,
	libnetworking/netinet/udp_usrreq.c, libnetworking/nfs/bootp_subr.c,
	libnetworking/rtems/rtems_select.c,
	libnetworking/rtems/rtems_showifstat.c,
	libnetworking/rtems/rtems_showroute.c,
	libnetworking/rtems/rtems_syscall.c: Fixed type mismatch and
	uninitialized variable warnings.
This commit is contained in:
Joel Sherrill
2005-04-28 21:49:50 +00:00
parent f48f64ab8a
commit 3274c87676
13 changed files with 40 additions and 17 deletions

View File

@@ -1,3 +1,15 @@
2005-04-28 Joel Sherrill <joel@OARcorp.com>
* libnetworking/kern/kern_sysctl.c, libnetworking/libc/inet_ntop.c,
libnetworking/net/if_ppp.c, libnetworking/net/pppcompress.c,
libnetworking/net/slcompress.c, libnetworking/netinet/ip_output.c,
libnetworking/netinet/udp_usrreq.c, libnetworking/nfs/bootp_subr.c,
libnetworking/rtems/rtems_select.c,
libnetworking/rtems/rtems_showifstat.c,
libnetworking/rtems/rtems_showroute.c,
libnetworking/rtems/rtems_syscall.c: Fixed type mismatch and
uninitialized variable warnings.
2005-04-28 Joel Sherrill <joel@OARcorp.com> 2005-04-28 Joel Sherrill <joel@OARcorp.com>
* score/src/objectidtoname.c: Fixed spacing. * score/src/objectidtoname.c: Fixed spacing.

View File

@@ -1010,6 +1010,8 @@ kernel_sysctlbyname(struct thread *td, char *name, void *old, size_t *oldlenp,
size_t oidlen, plen; size_t oidlen, plen;
int error; int error;
plen = 0; /* RTEMS - to avoid warnings */
oid[0] = 0; /* sysctl internal magic */ oid[0] = 0; /* sysctl internal magic */
oid[1] = 3; /* name2oid */ oid[1] = 3; /* name2oid */
oidlen = sizeof(oid); oidlen = sizeof(oid);

View File

@@ -126,7 +126,9 @@ inet_ntop6(src, dst, size)
for (i = 0; i < NS_IN6ADDRSZ; i++) for (i = 0; i < NS_IN6ADDRSZ; i++)
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
best.base = -1; best.base = -1;
best.len = 0;
cur.base = -1; cur.base = -1;
cur.len = 0;
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
if (words[i] == 0) { if (words[i] == 0) {
if (cur.base == -1) if (cur.base == -1)

View File

@@ -1169,7 +1169,10 @@ struct mbuf *
ppp_dequeue(sc) ppp_dequeue(sc)
struct ppp_softc *sc; struct ppp_softc *sc;
{ {
struct mbuf *m, *mp; #ifdef PPP_COMPRESS
struct mbuf *mp;
#endif
struct mbuf *m;
u_char *cp; u_char *cp;
int address, control, protocol; int address, control, protocol;

View File

@@ -405,7 +405,8 @@ vj_uncompress_tcp(bufp, len, type, comp)
struct vjcompress *comp; struct vjcompress *comp;
{ {
u_char *hdr, *cp; u_char *hdr, *cp;
int hlen, vjlen; u_int hlen;
int vjlen;
cp = bufp? *bufp: NULL; cp = bufp? *bufp: NULL;
vjlen = vj_uncompress_tcp_core(cp, len, len, type, comp, &hdr, &hlen); vjlen = vj_uncompress_tcp_core(cp, len, len, type, comp, &hdr, &hlen);

View File

@@ -423,7 +423,8 @@ sl_uncompress_tcp(bufp, len, type, comp)
struct slcompress *comp; struct slcompress *comp;
{ {
u_char *hdr, *cp; u_char *hdr, *cp;
int hlen, vjlen; u_int hlen;
int vjlen;
cp = bufp? *bufp: NULL; cp = bufp? *bufp: NULL;
vjlen = sl_uncompress_tcp_core(cp, len, len, type, comp, &hdr, &hlen); vjlen = sl_uncompress_tcp_core(cp, len, len, type, comp, &hdr, &hlen);

View File

@@ -100,7 +100,7 @@ ip_output(m0, opt, ro, flags, imo)
struct ifnet *ifp; struct ifnet *ifp;
struct mbuf *m = m0; struct mbuf *m = m0;
int hlen = sizeof (struct ip); int hlen = sizeof (struct ip);
int len, off, error = 0; int len = 0, off, error = 0;
struct sockaddr_in *dst; struct sockaddr_in *dst;
struct in_ifaddr *ia; struct in_ifaddr *ia;
int isbroadcast; int isbroadcast;

View File

@@ -367,6 +367,7 @@ udp_output(inp, m, addr, control)
struct in_addr laddr; struct in_addr laddr;
int s = 0, error = 0; int s = 0, error = 0;
laddr.s_addr = 0;
if (control) if (control)
m_freem(control); /* XXX */ m_freem(control); /* XXX */

View File

@@ -736,7 +736,7 @@ processOptions (unsigned char *optbuf, int optbufSize)
int j = 0; int j = 0;
int len; int len;
int code, ncode; int code, ncode;
char *p; unsigned char *p;
ncode = optbuf[0]; ncode = optbuf[0];
while (j < optbufSize) { while (j < optbufSize) {
@@ -832,10 +832,10 @@ processOptions (unsigned char *optbuf, int optbufSize)
/* Host name */ /* Host name */
if (len>=MAXHOSTNAMELEN) if (len>=MAXHOSTNAMELEN)
panic ("bootpc: hostname >=%d bytes", MAXHOSTNAMELEN); panic ("bootpc: hostname >=%d bytes", MAXHOSTNAMELEN);
if (sethostname (p, len) < 0) if (sethostname ((char *)p, len) < 0)
panic("Can't set host name"); panic("Can't set host name");
printf("Hostname is %s\n", p); printf("Hostname is %s\n", p);
dhcp_hostname = bootp_strdup_realloc(dhcp_hostname,p); dhcp_hostname = bootp_strdup_realloc(dhcp_hostname,(char *)p);
break; break;
case 7: case 7:
@@ -852,7 +852,7 @@ processOptions (unsigned char *optbuf, int optbufSize)
/* Domain name */ /* Domain name */
if (p[0]) { if (p[0]) {
rtems_bsdnet_domain_name = rtems_bsdnet_domain_name =
bootp_strdup_realloc(rtems_bsdnet_domain_name,p); bootp_strdup_realloc(rtems_bsdnet_domain_name,(char *)p);
printf("Domain name is %s\n", rtems_bsdnet_domain_name); printf("Domain name is %s\n", rtems_bsdnet_domain_name);
} }
break; break;
@@ -888,14 +888,14 @@ processOptions (unsigned char *optbuf, int optbufSize)
/* DHCP server name option */ /* DHCP server name option */
if (p[0]) if (p[0])
rtems_bsdnet_bootp_server_name = rtems_bsdnet_bootp_server_name =
bootp_strdup_realloc(rtems_bsdnet_bootp_server_name,p); bootp_strdup_realloc(rtems_bsdnet_bootp_server_name,(char *)p);
break; break;
case 67: case 67:
/* DHCP bootfile option */ /* DHCP bootfile option */
if (p[0]) if (p[0])
rtems_bsdnet_bootp_boot_file_name = rtems_bsdnet_bootp_boot_file_name =
bootp_strdup_realloc(rtems_bsdnet_bootp_boot_file_name,p); bootp_strdup_realloc(rtems_bsdnet_bootp_boot_file_name,(char *)p);
break; break;
case 129: case 129:
@@ -903,7 +903,7 @@ processOptions (unsigned char *optbuf, int optbufSize)
* a 'command line string' * a 'command line string'
*/ */
if (p[0]) if (p[0])
rtems_bsdnet_bootp_cmdline = strdup(p); rtems_bsdnet_bootp_cmdline = strdup((char *)p);
break; break;
default: default:
@@ -1054,7 +1054,7 @@ bootpc_init(int update_files)
processOptions (&reply.vend[4], sizeof(reply.vend) - 4); processOptions (&reply.vend[4], sizeof(reply.vend) - 4);
} }
if (dhcpOptionOverload & 1) { if (dhcpOptionOverload & 1) {
processOptions (reply.file, sizeof reply.file); processOptions ((unsigned char *)reply.file, sizeof reply.file);
} }
else { else {
if (reply.file[0]) if (reply.file[0])
@@ -1062,7 +1062,7 @@ bootpc_init(int update_files)
bootp_strdup_realloc(rtems_bsdnet_bootp_boot_file_name,reply.file); bootp_strdup_realloc(rtems_bsdnet_bootp_boot_file_name,reply.file);
} }
if (dhcpOptionOverload & 2) { if (dhcpOptionOverload & 2) {
processOptions (reply.sname, sizeof reply.sname); processOptions ((unsigned char *)reply.sname, sizeof reply.sname);
} }
else { else {
if (reply.sname[0]) if (reply.sname[0])

View File

@@ -119,7 +119,7 @@ select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct t
fd_mask *ibits[3], *obits[3]; fd_mask *ibits[3], *obits[3];
fd_set ob[3]; fd_set ob[3];
int error, timo; int error, timo;
int retval; int retval = 0;
rtems_id tid; rtems_id tid;
rtems_interval then, now; rtems_interval then, now;
rtems_event_set events; rtems_event_set events;

View File

@@ -59,7 +59,7 @@ rtems_bsdnet_show_if_stats (void)
case AF_LINK: case AF_LINK:
{ {
struct sockaddr_dl *sdl = (struct sockaddr_dl *)ifa->ifa_addr; struct sockaddr_dl *sdl = (struct sockaddr_dl *)ifa->ifa_addr;
unsigned char *cp = LLADDR(sdl); char *cp = LLADDR(sdl);
int i; int i;
switch ( sdl->sdl_type ) { switch ( sdl->sdl_type ) {

View File

@@ -147,7 +147,7 @@ link_ascii (struct sockaddr_dl *sdl, char *buf, int bufsize)
int i; int i;
int first = 1; int first = 1;
int nleft = sdl->sdl_alen; int nleft = sdl->sdl_alen;
unsigned char *ap = LLADDR (sdl); char *ap = LLADDR (sdl);
static const char hextab[16] = "0123456789ABCDEF"; static const char hextab[16] = "0123456789ABCDEF";
cp = buf; cp = buf;

View File

@@ -289,7 +289,8 @@ sendmsg (int s, const struct msghdr *mp, int flags)
struct uio auio; struct uio auio;
struct iovec *iov; struct iovec *iov;
struct socket *so; struct socket *so;
struct mbuf *to, *control; struct mbuf *to;
struct mbuf *control = NULL;
int i; int i;
int len; int len;