From 80bd9216d26114dd42761088913f3de414824b9f Mon Sep 17 00:00:00 2001 From: simonb Date: Thu, 30 Nov 2000 23:59:03 +0000 Subject: [PATCH] ANSIfy. --- libexec/rpc.rstatd/rstat_proc.c | 18 +++--- usr.bin/vmstat/dkstats.c | 22 +++----- usr.bin/vmstat/vmstat.c | 97 ++++++++++++++------------------- usr.sbin/iostat/iostat.c | 55 ++++++++----------- 4 files changed, 83 insertions(+), 109 deletions(-) diff --git a/libexec/rpc.rstatd/rstat_proc.c b/libexec/rpc.rstatd/rstat_proc.c index ba9d04c4f9cf..9fe58702f5d9 100644 --- a/libexec/rpc.rstatd/rstat_proc.c +++ b/libexec/rpc.rstatd/rstat_proc.c @@ -1,4 +1,4 @@ -/* $NetBSD: rstat_proc.c,v 1.36 2000/11/29 11:18:34 simonb Exp $ */ +/* $NetBSD: rstat_proc.c,v 1.37 2000/11/30 23:59:03 simonb Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -35,7 +35,7 @@ static char sccsid[] = "from: @(#)rpc.rstatd.c 1.1 86/09/25 Copyr 1984 Sun Micro"; static char sccsid[] = "from: @(#)rstat_proc.c 2.2 88/08/01 4.0 RPCSRC"; #else -__RCSID("$NetBSD: rstat_proc.c,v 1.36 2000/11/29 11:18:34 simonb Exp $"); +__RCSID("$NetBSD: rstat_proc.c,v 1.37 2000/11/30 23:59:03 simonb Exp $"); #endif #endif @@ -380,7 +380,7 @@ rstat_service(struct svc_req *rqstp, SVCXPRT *transp) } argument; char *result; xdrproc_t xdr_argument, xdr_result; - char *(*local) __P((void *, struct svc_req *)); + char *(*local)(void *, struct svc_req *); switch (rqstp->rq_proc) { case NULLPROC: @@ -392,15 +392,15 @@ rstat_service(struct svc_req *rqstp, SVCXPRT *transp) xdr_result = (xdrproc_t)xdr_statstime; switch (rqstp->rq_vers) { case RSTATVERS_ORIG: - local = (char *(*) __P((void *, struct svc_req *))) + local = (char *(*)(void *, struct svc_req *)) rstatproc_stats_1_svc; break; case RSTATVERS_SWTCH: - local = (char *(*) __P((void *, struct svc_req *))) + local = (char *(*)(void *, struct svc_req *)) rstatproc_stats_2_svc; break; case RSTATVERS_TIME: - local = (char *(*) __P((void *, struct svc_req *))) + local = (char *(*)(void *, struct svc_req *)) rstatproc_stats_3_svc; break; default: @@ -414,15 +414,15 @@ rstat_service(struct svc_req *rqstp, SVCXPRT *transp) xdr_result = (xdrproc_t)xdr_u_int; switch (rqstp->rq_vers) { case RSTATVERS_ORIG: - local = (char *(*) __P((void *, struct svc_req *))) + local = (char *(*)(void *, struct svc_req *)) rstatproc_havedisk_1_svc; break; case RSTATVERS_SWTCH: - local = (char *(*) __P((void *, struct svc_req *))) + local = (char *(*)(void *, struct svc_req *)) rstatproc_havedisk_2_svc; break; case RSTATVERS_TIME: - local = (char *(*) __P((void *, struct svc_req *))) + local = (char *(*)(void *, struct svc_req *)) rstatproc_havedisk_3_svc; break; default: diff --git a/usr.bin/vmstat/dkstats.c b/usr.bin/vmstat/dkstats.c index 4bcaf1df344c..92135a26fd9a 100644 --- a/usr.bin/vmstat/dkstats.c +++ b/usr.bin/vmstat/dkstats.c @@ -1,4 +1,4 @@ -/* $NetBSD: dkstats.c,v 1.9 2000/07/07 15:13:25 itojun Exp $ */ +/* $NetBSD: dkstats.c,v 1.10 2000/11/30 23:59:04 simonb Exp $ */ /* * Copyright (c) 1996 John M. Vinopal @@ -97,10 +97,10 @@ char **dr_name; #define timerset(tvp, uvp) ((uvp)->tv_sec = (tvp)->tv_sec); \ ((uvp)->tv_usec = (tvp)->tv_usec) -void dkswap __P((void)); -void dkreadstats __P((void)); -int dkinit __P((int, gid_t)); -static void deref_kptr __P((void *, void *, size_t)); +void dkswap(void); +void dkreadstats(void); +int dkinit(int, gid_t); +static void deref_kptr(void *, void *, size_t); /* * Take the delta between the present values and the last recorded @@ -108,7 +108,7 @@ static void deref_kptr __P((void *, void *, size_t)); * the delta values in the 'cur' structure. */ void -dkswap() +dkswap(void) { u_int64_t tmp; int i; @@ -149,7 +149,7 @@ dkswap() * Also collect statistics for tty i/o and cpu ticks. */ void -dkreadstats() +dkreadstats(void) { struct disk cur_disk, *p; size_t ssize; @@ -190,9 +190,7 @@ dkreadstats() * track disk statistics. */ int -dkinit(select, egid) - int select; - gid_t egid; +dkinit(int select, gid_t egid) { gid_t oldgid; struct disklist_head disk_head; @@ -283,9 +281,7 @@ dkinit(select, egid) * and the size of the copy passed in `len'. */ static void -deref_kptr(kptr, ptr, len) - void *kptr, *ptr; - size_t len; +deref_kptr(void *kptr, void *ptr, size_t len) { char buf[128]; diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 5f2c0005abec..bf40f2450db8 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1,4 +1,4 @@ -/* $NetBSD: vmstat.c,v 1.72 2000/11/30 12:02:19 simonb Exp $ */ +/* $NetBSD: vmstat.c,v 1.73 2000/11/30 23:59:04 simonb Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -80,7 +80,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1991, 1993\n\ #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95"; #else -__RCSID("$NetBSD: vmstat.c,v 1.72 2000/11/30 12:02:19 simonb Exp $"); +__RCSID("$NetBSD: vmstat.c,v 1.73 2000/11/30 23:59:04 simonb Exp $"); #endif #endif /* not lint */ @@ -160,7 +160,7 @@ extern char **dr_name; extern int *dk_select, dk_ndrive; struct uvmexp uvmexp, ouvmexp; -int ndrives; +int ndrives; int winlines = 20; @@ -175,31 +175,31 @@ kvm_t *kd; #define HISTLIST 0x40 #define HISTDUMP 0x80 -void cpustats __P((void)); -void dkstats __P((void)); -void doevcnt __P((int verbose)); -void dointr __P((int verbose)); -void domem __P((void)); -void dopool __P((void)); -void dosum __P((void)); -void dovmstat __P((u_int, int)); -void kread __P((int, void *, size_t)); -void needhdr __P((int)); -long getuptime __P((void)); -void printhdr __P((void)); -long pct __P((long, long)); -void usage __P((void)); -void doforkst __P((void)); +void cpustats(void); +void dkstats(void); +void doevcnt(int verbose); +void dointr(int verbose); +void domem(void); +void dopool(void); +void dosum(void); +void dovmstat(u_int, int); +void kread(int, void *, size_t); +void needhdr(int); +long getuptime(void); +void printhdr(void); +long pct(long, long); +void usage(void); +void doforkst(void); -void hist_traverse __P((int, const char *)); -void hist_dodump __P((struct uvm_history *)); +void hist_traverse(int, const char *); +void hist_dodump(struct uvm_history *); -int main __P((int, char **)); -char **choosedrives __P((char **)); +int main(int, char **); +char **choosedrives(char **); -extern int dkinit __P((int, gid_t)); -extern void dkreadstats __P((void)); -extern void dkswap __P((void)); +extern int dkinit(int, gid_t); +extern void dkreadstats(void); +extern void dkswap(void); /* Namelist and memory file names. */ char *nlistf, *memf; @@ -208,9 +208,7 @@ char *nlistf, *memf; #define BACKWARD_COMPATIBILITY int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int c, todo, verbose; u_int interval; @@ -364,8 +362,7 @@ main(argc, argv) } char ** -choosedrives(argv) - char **argv; +choosedrives(char **argv) { int i; @@ -399,7 +396,7 @@ choosedrives(argv) } long -getuptime() +getuptime(void) { static time_t now; static struct timeval boottime; @@ -420,9 +417,7 @@ getuptime() int hz, hdrcnt; void -dovmstat(interval, reps) - u_int interval; - int reps; +dovmstat(u_int interval, int reps) { struct vmtotal total; time_t uptime, halfuptime; @@ -497,7 +492,7 @@ dovmstat(interval, reps) } void -printhdr() +printhdr(void) { int i; @@ -523,16 +518,14 @@ printhdr() * Force a header to be prepended to the next output. */ void -needhdr(dummy) - int dummy; +needhdr(int dummy) { hdrcnt = 1; } long -pct(top, bot) - long top, bot; +pct(long top, long bot) { long ans; @@ -545,7 +538,7 @@ pct(top, bot) #define PCT(top, bot) (int)pct((long)(top), (long)(bot)) void -dosum() +dosum(void) { struct nchstats nchstats; long nchtotal; @@ -649,7 +642,7 @@ dosum() } void -doforkst() +doforkst(void) { kread(X_UVMEXP, &uvmexp, sizeof(uvmexp)); @@ -661,7 +654,7 @@ doforkst() } void -dkstats() +dkstats(void) { int dn, state; double etime; @@ -683,7 +676,7 @@ dkstats() } void -cpustats() +cpustats(void) { int state; double pct, total; @@ -857,7 +850,7 @@ event_chain_trashed: char *kmemnames[] = INITKMEMNAMES; void -domem() +domem(void) { struct kmembuckets *kp; struct kmemstats *ks; @@ -967,7 +960,7 @@ domem() } void -dopool() +dopool(void) { int first, ovflw; long addr; @@ -1057,10 +1050,7 @@ dopool() * kread reads something from the kernel, given its nlist index. */ void -kread(nlx, addr, size) - int nlx; - void *addr; - size_t size; +kread(int nlx, void *addr, size_t size) { const char *sym; @@ -1093,9 +1083,7 @@ struct nlist histnl[] = { * Note, we assume that if we're not listing, we're dumping. */ void -hist_traverse(todo, histname) - int todo; - const char *histname; +hist_traverse(int todo, const char *histname) { struct uvm_history_head histhead; struct uvm_history hist, *histkva; @@ -1173,8 +1161,7 @@ hist_traverse(todo, histname) * Actually dump the history buffer at the specified KVA. */ void -hist_dodump(histp) - struct uvm_history *histp; +hist_dodump(struct uvm_history *histp) { struct uvm_history_ent *histents, *e; size_t histsize; @@ -1247,7 +1234,7 @@ hist_dodump(histp) } void -usage() +usage(void) { (void)fprintf(stderr, diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index ac9d82a3c753..28118d3546e7 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -1,4 +1,4 @@ -/* $NetBSD: iostat.c,v 1.22 2000/06/03 21:03:25 thorpej Exp $ */ +/* $NetBSD: iostat.c,v 1.23 2000/11/30 23:59:04 simonb Exp $ */ /* * Copyright (c) 1996 John M. Vinopal @@ -75,7 +75,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1991, 1993\n\ #if 0 static char sccsid[] = "@(#)iostat.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: iostat.c,v 1.22 2000/06/03 21:03:25 thorpej Exp $"); +__RCSID("$NetBSD: iostat.c,v 1.23 2000/11/30 23:59:04 simonb Exp $"); #endif #endif /* not lint */ @@ -113,24 +113,22 @@ static int todo = 0; #define SHOW_TOTALS 1<<7 #define SHOW_STATS_ALL (SHOW_STATS_1 | SHOW_STATS_2 | SHOW_STATS_X) -static void cpustats __P((void)); -static void disk_stats __P((double)); -static void disk_stats2 __P((double)); -static void disk_statsx __P((double)); -static void header __P((int)); -static void usage __P((void)); -static void display __P((void)); -static void selectdrives __P((int, char **)); +static void cpustats(void); +static void disk_stats(double); +static void disk_stats2(double); +static void disk_statsx(double); +static void header(int); +static void usage(void); +static void display(void); +static void selectdrives(int, char **); -void dkswap __P((void)); -void dkreadstats __P((void)); -int dkinit __P((int, gid_t)); -int main __P((int, char **)); +void dkswap(void); +void dkreadstats(void); +int dkinit(int, gid_t); +int main(int, char **); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch, hdrcnt; struct timeval tv; @@ -224,8 +222,7 @@ main(argc, argv) } static void -header(signo) - int signo; +header(int signo) { int i; @@ -278,8 +275,7 @@ header(signo) } static void -disk_stats(etime) - double etime; +disk_stats(double etime) { int dn; double atime, mbps; @@ -312,8 +308,7 @@ disk_stats(etime) } static void -disk_stats2(etime) - double etime; +disk_stats2(double etime) { int dn; double atime; @@ -336,8 +331,7 @@ disk_stats2(etime) } static void -disk_statsx(etime) - double etime; +disk_statsx(double etime) { int dn; double atime, kbps; @@ -374,7 +368,7 @@ disk_statsx(etime) } static void -cpustats() +cpustats(void) { int state; double time; @@ -390,7 +384,7 @@ cpustats() } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: iostat [-CdDITx] [-c count] [-M core] \ @@ -399,7 +393,7 @@ usage() } static void -display() +display(void) { int i; double etime; @@ -440,9 +434,7 @@ display() } static void -selectdrives(argc, argv) - int argc; - char *argv[]; +selectdrives(int argc, char *argv[]) { int i, ndrives; @@ -498,4 +490,3 @@ selectdrives(argc, argv) ++ndrives; } } -