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>
* 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;
int error;
plen = 0; /* RTEMS - to avoid warnings */
oid[0] = 0; /* sysctl internal magic */
oid[1] = 3; /* name2oid */
oidlen = sizeof(oid);

View File

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

View File

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

View File

@@ -405,7 +405,8 @@ vj_uncompress_tcp(bufp, len, type, comp)
struct vjcompress *comp;
{
u_char *hdr, *cp;
int hlen, vjlen;
u_int hlen;
int vjlen;
cp = bufp? *bufp: NULL;
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;
{
u_char *hdr, *cp;
int hlen, vjlen;
u_int hlen;
int vjlen;
cp = bufp? *bufp: NULL;
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 mbuf *m = m0;
int hlen = sizeof (struct ip);
int len, off, error = 0;
int len = 0, off, error = 0;
struct sockaddr_in *dst;
struct in_ifaddr *ia;
int isbroadcast;

View File

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

View File

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

View File

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

View File

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

View File

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