Skip to content

Commit

Permalink
ANSIfy.
Browse files Browse the repository at this point in the history
  • Loading branch information
snarkophilus committed Nov 30, 2000
1 parent 11ef11f commit ab99f36
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 112 deletions.
18 changes: 9 additions & 9 deletions libexec/rpc.rstatd/rstat_proc.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
22 changes: 9 additions & 13 deletions usr.bin/vmstat/dkstats.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -97,18 +97,18 @@ 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
* values, storing the present values in the 'last' structure, and
* the delta values in the 'cur' structure.
*/
void
dkswap()
dkswap(void)
{
u_int64_t tmp;
int i;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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];

Expand Down
103 changes: 45 additions & 58 deletions usr.bin/vmstat/vmstat.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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 */

Expand Down Expand Up @@ -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;

Expand All @@ -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 hist_traverse __P((int, const char *));
void hist_dodump __P((struct uvm_history *));

int main __P((int, char **));
char **choosedrives __P((char **));

extern int dkinit __P((int, gid_t));
extern void dkreadstats __P((void));
extern void dkswap __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(int, const char *);
void hist_dodump(struct uvm_history *);

int main(int, char **);
char **choosedrives(char **);

extern int dkinit(int, gid_t);
extern void dkreadstats(void);
extern void dkswap(void);

/* Namelist and memory file names. */
char *nlistf, *memf;
Expand All @@ -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;
Expand Down Expand Up @@ -364,8 +362,7 @@ main(argc, argv)
}

char **
choosedrives(argv)
char **argv;
choosedrives(char **argv)
{
int i;

Expand Down Expand Up @@ -399,7 +396,7 @@ choosedrives(argv)
}

long
getuptime()
getuptime(void)
{
static time_t now;
static struct timeval boottime;
Expand All @@ -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;
Expand Down Expand Up @@ -497,7 +492,7 @@ dovmstat(interval, reps)
}

void
printhdr()
printhdr(void)
{
int i;

Expand All @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -649,7 +642,7 @@ dosum()
}

void
doforkst()
doforkst(void)
{

kread(X_UVMEXP, &uvmexp, sizeof(uvmexp));
Expand All @@ -661,7 +654,7 @@ doforkst()
}

void
dkstats()
dkstats(void)
{
int dn, state;
double etime;
Expand All @@ -683,7 +676,7 @@ dkstats()
}

void
cpustats()
cpustats(void)
{
int state;
double pct, total;
Expand Down Expand Up @@ -857,7 +850,7 @@ doevcnt(int verbose)
char *kmemnames[] = INITKMEMNAMES;

void
domem()
domem(void)
{
struct kmembuckets *kp;
struct kmemstats *ks;
Expand Down Expand Up @@ -967,7 +960,7 @@ domem()
}

void
dopool()
dopool(void)
{
int first, ovflw;
long addr;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1247,7 +1234,7 @@ hist_dodump(histp)
}

void
usage()
usage(void)
{

(void)fprintf(stderr,
Expand Down
Loading

0 comments on commit ab99f36

Please sign in to comment.