summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/if.c
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2002-09-05 17:06:51 +0000
committerdwmalone <dwmalone@FreeBSD.org>2002-09-05 17:06:51 +0000
commitcb4604919fc3c4fef1de7daff27468d6c5fbd56d (patch)
tree959e14da31f6b728ead4e7600874639513bcf91a /usr.bin/netstat/if.c
parentbd265f5118e4fb79ee5176679e737794dc630d3d (diff)
downloadFreeBSD-src-cb4604919fc3c4fef1de7daff27468d6c5fbd56d.zip
FreeBSD-src-cb4604919fc3c4fef1de7daff27468d6c5fbd56d.tar.gz
Warns cleanups for netstat:
1) Include arpa/inet.h for ntohs. 2) Constness fixes. 3) Fix shadowing except for "sin" which shouldn't be in scope. 4) Remove register keyword. 5) Add missing initialsers to user defined structs. 5) Make prototype of netname6 globally visable. 6) Use right macros for printing syncache stats (even though entrie isn't a word).
Diffstat (limited to 'usr.bin/netstat/if.c')
-rw-r--r--usr.bin/netstat/if.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index e58fbd2..1b012ce 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -80,14 +80,13 @@ static void sidewaysintpr (u_int, u_long);
static void catchalarm (int);
#ifdef INET6
-char *netname6 (struct sockaddr_in6 *, struct in6_addr *);
static char ntop_buf[INET6_ADDRSTRLEN]; /* for inet_ntop() */
static int bdg_done;
#endif
/* print bridge statistics */
void
-bdg_stats(u_long dummy __unused, char *name, int _af __unused)
+bdg_stats(u_long dummy __unused, const char *name, int af1 __unused)
{
int i;
size_t slen ;
@@ -223,7 +222,7 @@ intpr(int _interval, u_long ifnetaddr, void (*pfunc)(char *))
#ifdef INET6
struct sockaddr_in6 *sin6;
#endif
- register char *cp;
+ char *cp;
int n, m;
network_layer = 0;
@@ -318,7 +317,7 @@ intpr(int _interval, u_long ifnetaddr, void (*pfunc)(char *))
netname6(&ifaddr.in6.ia_addr,
&ifaddr.in6.ia_prefixmask.sin6_addr));
printf("%-17.17s ",
- (char *)inet_ntop(AF_INET6,
+ inet_ntop(AF_INET6,
&sin6->sin6_addr,
ntop_buf, sizeof(ntop_buf)));
@@ -516,13 +515,13 @@ u_char signalled; /* set if alarm goes off "early" */
* XXX - should be rewritten to use ifmib(4).
*/
static void
-sidewaysintpr(unsigned interval, u_long off)
+sidewaysintpr(unsigned interval1, u_long off)
{
struct ifnet ifnet;
u_long firstifnet;
struct ifnethead ifnethead;
struct iftot *iftot, *ip, *ipn, *total, *sum, *interesting;
- register int line;
+ int line;
int oldmask, first;
u_long interesting_off;
@@ -575,7 +574,7 @@ sidewaysintpr(unsigned interval, u_long off)
(void)signal(SIGALRM, catchalarm);
signalled = NO;
- (void)alarm(interval);
+ (void)alarm(interval1);
first = 1;
banner:
printf("%17s %14s %16s", "input",
@@ -664,7 +663,7 @@ loop:
}
sigsetmask(oldmask);
signalled = NO;
- (void)alarm(interval);
+ (void)alarm(interval1);
line++;
first = 0;
if (line == 21)
OpenPOWER on IntegriCloud