diff options
author | julian <julian@FreeBSD.org> | 1999-10-21 07:08:56 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1999-10-21 07:08:56 +0000 |
commit | 698af92f8613624eb9b69ed626a553ef9ed11bc3 (patch) | |
tree | 34f8c1411b594ef1f2403820c4a879e1fe6bf163 /usr.bin/netstat | |
parent | 15e239d7e5b385cfdafaca3aebfbcbc63892abdc (diff) | |
download | FreeBSD-src-698af92f8613624eb9b69ed626a553ef9ed11bc3.zip FreeBSD-src-698af92f8613624eb9b69ed626a553ef9ed11bc3.tar.gz |
Cleanup towards -Wall
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r-- | usr.bin/netstat/atalk.c | 19 | ||||
-rw-r--r-- | usr.bin/netstat/if.c | 5 | ||||
-rw-r--r-- | usr.bin/netstat/inet.c | 2 | ||||
-rw-r--r-- | usr.bin/netstat/ipx.c | 2 | ||||
-rw-r--r-- | usr.bin/netstat/mroute.c | 7 |
5 files changed, 17 insertions, 18 deletions
diff --git a/usr.bin/netstat/atalk.c b/usr.bin/netstat/atalk.c index f0a72e4..b8071a1 100644 --- a/usr.bin/netstat/atalk.c +++ b/usr.bin/netstat/atalk.c @@ -204,27 +204,20 @@ atalkprotopr(off, name) u_long off; char *name; { - struct ddpcb cb; - register struct ddpcb *prev, *next; - struct ddpcb *initial; + struct ddpcb *this, *next; if (off == 0) return; - kread(off, (char *)&initial, sizeof (struct ddpcb *)); - ddpcb = cb; - prev = (struct ddpcb *)off; - for (next = initial ;next != NULL; prev = next) { - u_long ppcb; - - kread((u_long)next, (char *)&ddpcb, sizeof (ddpcb)); + kread(off, (char *)&this, sizeof (struct ddpcb *)); + for ( ; this != NULL; this = next) { + kread((u_long)this, (char *)&ddpcb, sizeof (ddpcb)); next = ddpcb.ddp_next; #if 0 if (!aflag && atalk_nullhost(ddpcb.ddp_lsat) ) { continue; } #endif - kread((u_long)ddpcb.ddp_socket, - (char *)&sockb, sizeof (sockb)); + kread((u_long)ddpcb.ddp_socket, (char *)&sockb, sizeof (sockb)); if (first) { printf("Active ATALK connections"); if (aflag) @@ -240,7 +233,7 @@ atalkprotopr(off, name) first = 0; } if (Aflag) - printf("%8lx ", ppcb); + printf("%8lx ", (u_long) this); printf("%-5.5s %6lu %6lu ", name, sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc); printf(Aflag?" %-18.18s":" %-22.22s", atalk_print( diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index 61ad2b6..32a8eaa 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -135,7 +135,7 @@ intpr(interval, ifnetaddr) u_long ifaddraddr; u_long ifaddrfound; u_long ifnetfound; - struct sockaddr *sa; + struct sockaddr *sa = NULL; char name[32], tname[16]; if (ifnetaddr == 0) { @@ -199,7 +199,8 @@ intpr(interval, ifnetaddr) } #define CP(x) ((char *)(x)) cp = (CP(ifaddr.ifa.ifa_addr) - CP(ifaddraddr)) + - CP(&ifaddr); sa = (struct sockaddr *)cp; + CP(&ifaddr); + sa = (struct sockaddr *)cp; switch (sa->sa_family) { case AF_UNSPEC: printf("%-13.13s ", "none"); diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 826afcc..783cbc7 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -94,7 +94,7 @@ protopr(proto, name) static int first = 1; char *buf; const char *mibvar; - struct tcpcb *tp; + struct tcpcb *tp = NULL; struct inpcb *inp; struct xinpgen *xig, *oxig; struct xsocket *so; diff --git a/usr.bin/netstat/ipx.c b/usr.bin/netstat/ipx.c index 8f7c1ba..973c4cf 100644 --- a/usr.bin/netstat/ipx.c +++ b/usr.bin/netstat/ipx.c @@ -262,6 +262,7 @@ ipx_stats(off, name) ANYl(ipxstat.ipxs_mtutoosmall, "packet", " too big"); } +#ifdef IPXERRORMSGS static struct { u_short code; char *name; @@ -278,7 +279,6 @@ static struct { {-1, 0, 0}, }; -#ifdef IPXERRORMSGS /* * Dump IPX Error statistics structure. */ diff --git a/usr.bin/netstat/mroute.c b/usr.bin/netstat/mroute.c index 4110d00..83dbd08 100644 --- a/usr.bin/netstat/mroute.c +++ b/usr.bin/netstat/mroute.c @@ -37,12 +37,18 @@ * @(#)mroute.c 8.2 (Berkeley) 4/28/95 */ +#ifndef lint +static const char rcsid[] = + "$FreeBSD$"; +#endif /* not lint */ + /* * Print DVMRP multicast routing structures and statistics. * * MROUTING 1.0 */ + #include <sys/param.h> #include <sys/queue.h> #include <sys/socket.h> @@ -65,7 +71,6 @@ void mroutepr(mfcaddr, vifaddr) u_long mfcaddr, vifaddr; { - u_int mrtproto; struct mfc *mfctable[MFCTBLSIZ]; struct vif viftable[MAXVIFS]; struct mfc mfc, *m; |