From 9e34fe7efd02802c8741141cf670713ba1ade2e5 Mon Sep 17 00:00:00 2001 From: assar Date: Fri, 15 Jun 2001 01:53:05 +0000 Subject: remove most of the warnings --- usr.bin/netstat/main.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'usr.bin/netstat/main.c') diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index db75f0a..db11fba 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -160,9 +160,11 @@ struct protox { u_char pr_index; /* index into nlist of cb head */ u_char pr_sindex; /* index into nlist of stat block */ u_char pr_wanted; /* 1 if wanted, 0 otherwise */ - void (*pr_cblocks)(); /* control blocks printing routine */ - void (*pr_stats)(); /* statistics printing routine */ - void (*pr_istats)(); /* per/if statistics printing routine */ + void (*pr_cblocks)(u_long, char *, int); + /* control blocks printing routine */ + void (*pr_stats)(u_long, char *, int); + /* statistics printing routine */ + void (*pr_istats)(char *); /* per/if statistics printing routine */ char *pr_name; /* well-known name */ int pr_usesysctl; /* true if we use sysctl, not kvm */ } protox[] = { @@ -500,11 +502,11 @@ main(argc, argv) exit(0); } if (tp->pr_usesysctl) { - (*tp->pr_stats)(tp->pr_usesysctl, tp->pr_name); + (*tp->pr_stats)(tp->pr_usesysctl, tp->pr_name, af); } else { kread(0, 0, 0); (*tp->pr_stats)(nl[tp->pr_sindex].n_value, - tp->pr_name); + tp->pr_name, af); } exit(0); } @@ -611,7 +613,7 @@ printproto(tp, name) register struct protox *tp; char *name; { - void (*pr)(); + void (*pr)(u_long, char *, int); u_long off; if (sflag) { @@ -639,10 +641,7 @@ printproto(tp, name) * Read kernel memory, return 0 on success. */ int -kread(addr, buf, size) - u_long addr; - char *buf; - int size; +kread(u_long addr, char *buf, int size) { if (kvmd == 0) { /* @@ -679,15 +678,13 @@ kread(addr, buf, size) } char * -plural(n) - int n; +plural(int n) { return (n != 1 ? "s" : ""); } char * -plurales(n) - int n; +plurales(int n) { return (n != 1 ? "es" : ""); } @@ -696,8 +693,7 @@ plurales(n) * Find the protox for the given "well-known" name. */ static struct protox * -knownname(name) - char *name; +knownname(char *name) { struct protox **tpp, *tp; @@ -712,8 +708,7 @@ knownname(name) * Find the protox corresponding to name. */ static struct protox * -name2protox(name) - char *name; +name2protox(char *name) { struct protox *tp; char **alias; /* alias from p->aliases */ @@ -740,7 +735,7 @@ name2protox(name) } static void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", "usage: netstat [-AaLlnW] [-f address_family] [-M core] [-N system]", -- cgit v1.1