Module Name: src Committed By: dholland Date: Thu Jun 10 06:17:21 UTC 2010
Modified Files: src/usr.sbin/sa: extern.h main.c pdb.c usrdb.c Log Message: ANSIfy function declarations To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sa/extern.h cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/sa/main.c cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sa/pdb.c cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sa/usrdb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/sa/extern.h diff -u src/usr.sbin/sa/extern.h:1.8 src/usr.sbin/sa/extern.h:1.9 --- src/usr.sbin/sa/extern.h:1.8 Thu Jun 10 06:09:10 2010 +++ src/usr.sbin/sa/extern.h Thu Jun 10 06:17:21 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.8 2010/06/10 06:09:10 dholland Exp $ */ +/* $NetBSD: extern.h,v 1.9 2010/06/10 06:17:21 dholland Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -67,7 +67,6 @@ typedef int (*cmpf_t)(const DBT *, const DBT *); /* external functions in sa.c */ -int main(int argc, char **argv); const char *fmt(const DBT *); /* external functions in pdb.c */ Index: src/usr.sbin/sa/main.c diff -u src/usr.sbin/sa/main.c:1.26 src/usr.sbin/sa/main.c:1.27 --- src/usr.sbin/sa/main.c:1.26 Thu Jun 10 06:09:10 2010 +++ src/usr.sbin/sa/main.c Thu Jun 10 06:17:21 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.26 2010/06/10 06:09:10 dholland Exp $ */ +/* $NetBSD: main.c,v 1.27 2010/06/10 06:17:21 dholland Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1994\ Christopher G. Demetriou. All rights reserved."); -__RCSID("$NetBSD: main.c,v 1.26 2010/06/10 06:09:10 dholland Exp $"); +__RCSID("$NetBSD: main.c,v 1.27 2010/06/10 06:17:21 dholland Exp $"); #endif /* @@ -83,9 +83,7 @@ cmpf_t sa_cmp = cmp_usrsys; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int ch; int error; @@ -297,9 +295,7 @@ } static int -acct_load(pn, wr) - char *pn; - int wr; +acct_load(char *pn, int wr) { struct acct ac; struct cmdinfo ci; @@ -393,8 +389,7 @@ /* sort commands, doing the right thing in terms of reversals */ static int -cmp_comm(s1, s2) - const char *s1, *s2; +cmp_comm(const char *s1, const char *s2) { int rv; @@ -406,8 +401,7 @@ /* sort by total user and system time */ static int -cmp_usrsys(d1, d2) - const DBT *d1, *d2; +cmp_usrsys(const DBT *d1, const DBT *d2) { struct cmdinfo c1, c2; u_quad_t t1, t2; @@ -428,8 +422,7 @@ /* sort by average user and system time */ static int -cmp_avgusrsys(d1, d2) - const DBT *d1, *d2; +cmp_avgusrsys(const DBT *d1, const DBT *d2) { struct cmdinfo c1, c2; double t1, t2; @@ -453,8 +446,7 @@ /* sort by total number of disk I/O operations */ static int -cmp_dkio(d1, d2) - const DBT *d1, *d2; +cmp_dkio(const DBT *d1, const DBT *d2) { struct cmdinfo c1, c2; @@ -471,8 +463,7 @@ /* sort by average number of disk I/O operations */ static int -cmp_avgdkio(d1, d2) - const DBT *d1, *d2; +cmp_avgdkio(const DBT *d1, const DBT *d2) { struct cmdinfo c1, c2; double n1, n2; @@ -493,8 +484,7 @@ /* sort by the CPU-storage integral */ static int -cmp_cpumem(d1, d2) - const DBT *d1, *d2; +cmp_cpumem(const DBT *d1, const DBT *d2) { struct cmdinfo c1, c2; @@ -511,8 +501,7 @@ /* sort by the CPU-time average memory usage */ static int -cmp_avgcpumem(d1, d2) - const DBT *d1, *d2; +cmp_avgcpumem(const DBT *d1, const DBT *d2) { struct cmdinfo c1, c2; u_quad_t t1, t2; @@ -537,8 +526,7 @@ /* sort by the number of invocations */ static int -cmp_calls(d1, d2) - const DBT *d1, *d2; +cmp_calls(const DBT *d1, const DBT *d2) { struct cmdinfo c1, c2; @@ -554,7 +542,7 @@ } static void -usage() +usage(void) { (void)fprintf(stderr, @@ -564,8 +552,7 @@ } const char * -fmt(key) - const DBT *key; +fmt(const DBT *key) { static char *buf = NULL; static size_t len = 0; Index: src/usr.sbin/sa/pdb.c diff -u src/usr.sbin/sa/pdb.c:1.14 src/usr.sbin/sa/pdb.c:1.15 --- src/usr.sbin/sa/pdb.c:1.14 Thu Jun 10 06:09:10 2010 +++ src/usr.sbin/sa/pdb.c Thu Jun 10 06:17:21 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pdb.c,v 1.14 2010/06/10 06:09:10 dholland Exp $ */ +/* $NetBSD: pdb.c,v 1.15 2010/06/10 06:17:21 dholland Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: pdb.c,v 1.14 2010/06/10 06:09:10 dholland Exp $"); +__RCSID("$NetBSD: pdb.c,v 1.15 2010/06/10 06:17:21 dholland Exp $"); #endif #include <sys/types.h> @@ -56,7 +56,7 @@ static DB *pacct_db; int -pacct_init() +pacct_init(void) { DB *saved_pacct_db; int error; @@ -125,15 +125,14 @@ } void -pacct_destroy() +pacct_destroy(void) { if (DB_CLOSE(pacct_db) < 0) warn("destroying process accounting stats"); } int -pacct_add(ci) - const struct cmdinfo *ci; +pacct_add(const struct cmdinfo *ci) { DBT key, data; struct cmdinfo newci; @@ -175,7 +174,7 @@ } int -pacct_update() +pacct_update(void) { DB *saved_pacct_db; DBT key, data; @@ -223,7 +222,7 @@ } void -pacct_print() +pacct_print(void) { BTREEINFO bti; DBT key, data, ndata; @@ -319,8 +318,7 @@ } static int -check_junk(cip) - struct cmdinfo *cip; +check_junk(struct cmdinfo *cip) { char *cp; size_t len; @@ -333,9 +331,7 @@ } static void -add_ci(fromcip, tocip) - const struct cmdinfo *fromcip; - struct cmdinfo *tocip; +add_ci(const struct cmdinfo *fromcip, struct cmdinfo *tocip) { tocip->ci_calls += fromcip->ci_calls; tocip->ci_etime += fromcip->ci_etime; @@ -346,8 +342,7 @@ } static void -print_ci(cip, totalcip) - const struct cmdinfo *cip, *totalcip; +print_ci(const struct cmdinfo *cip, const struct cmdinfo *totalcip) { double t, c; int uflow; Index: src/usr.sbin/sa/usrdb.c diff -u src/usr.sbin/sa/usrdb.c:1.12 src/usr.sbin/sa/usrdb.c:1.13 --- src/usr.sbin/sa/usrdb.c:1.12 Thu Jun 10 06:09:10 2010 +++ src/usr.sbin/sa/usrdb.c Thu Jun 10 06:17:21 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: usrdb.c,v 1.12 2010/06/10 06:09:10 dholland Exp $ */ +/* $NetBSD: usrdb.c,v 1.13 2010/06/10 06:17:21 dholland Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: usrdb.c,v 1.12 2010/06/10 06:09:10 dholland Exp $"); +__RCSID("$NetBSD: usrdb.c,v 1.13 2010/06/10 06:17:21 dholland Exp $"); #endif #include <sys/types.h> @@ -55,7 +55,7 @@ static DB *usracct_db; int -usracct_init() +usracct_init(void) { DB *saved_usracct_db; BTREEINFO bti; @@ -130,15 +130,14 @@ } void -usracct_destroy() +usracct_destroy(void) { if (DB_CLOSE(usracct_db) < 0) warn("destroying user accounting stats"); } int -usracct_add(ci) - const struct cmdinfo *ci; +usracct_add(const struct cmdinfo *ci) { DBT key, data; struct userinfo newui; @@ -188,7 +187,7 @@ } int -usracct_update() +usracct_update(void) { DB *saved_usracct_db; DBT key, data; @@ -240,7 +239,7 @@ } void -usracct_print() +usracct_print(void) { DBT key, data; struct userinfo uistore, *ui = &uistore; @@ -291,8 +290,7 @@ } static int -uid_compare(k1, k2) - const DBT *k1, *k2; +uid_compare(const DBT *k1, const DBT *k2) { u_long d1, d2;