diff options
author | delphij <delphij@FreeBSD.org> | 2005-02-10 12:43:16 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2005-02-10 12:43:16 +0000 |
commit | 2dae001657dfe1ec592bb5a5d2bc1ac70eb69192 (patch) | |
tree | 0c1d44ccca058bdb8b3b31adee02a610d0896caf /usr.sbin/sa | |
parent | 5dd8d305754a018754a81424da7eb8d297b122eb (diff) | |
download | FreeBSD-src-2dae001657dfe1ec592bb5a5d2bc1ac70eb69192.zip FreeBSD-src-2dae001657dfe1ec592bb5a5d2bc1ac70eb69192.tar.gz |
Full modernize cleanup:
- De-__P()
- constify where appropriate
- ANSI functions instead of K&R
Pointed out by: stefanf
Diffstat (limited to 'usr.sbin/sa')
-rw-r--r-- | usr.sbin/sa/main.c | 30 | ||||
-rw-r--r-- | usr.sbin/sa/pdb.c | 19 | ||||
-rw-r--r-- | usr.sbin/sa/usrdb.c | 8 |
3 files changed, 20 insertions, 37 deletions
diff --git a/usr.sbin/sa/main.c b/usr.sbin/sa/main.c index 5dc4506..1796c9c 100644 --- a/usr.sbin/sa/main.c +++ b/usr.sbin/sa/main.c @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); #include "extern.h" #include "pathnames.h" -static int acct_load(char *, int); +static int acct_load(const char *, int); static u_quad_t decode_comp_t(comp_t); static int cmp_comm(const char *, const char *); static int cmp_usrsys(const DBT *, const DBT *); @@ -299,9 +299,7 @@ usage() } static int -acct_load(pn, wr) - char *pn; - int wr; +acct_load(const char *pn, int wr) { struct acct ac; struct cmdinfo ci; @@ -392,8 +390,7 @@ decode_comp_t(comp_t comp) /* 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; @@ -405,8 +402,7 @@ cmp_comm(s1, s2) /* 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; @@ -427,8 +423,7 @@ cmp_usrsys(d1, d2) /* 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; @@ -452,8 +447,7 @@ cmp_avgusrsys(d1, d2) /* 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; @@ -470,8 +464,7 @@ cmp_dkio(d1, d2) /* 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; @@ -492,8 +485,7 @@ cmp_avgdkio(d1, d2) /* 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; @@ -510,8 +502,7 @@ cmp_cpumem(d1, d2) /* 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; @@ -536,8 +527,7 @@ cmp_avgcpumem(d1, d2) /* 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; diff --git a/usr.sbin/sa/pdb.c b/usr.sbin/sa/pdb.c index e82f973..93dc24c 100644 --- a/usr.sbin/sa/pdb.c +++ b/usr.sbin/sa/pdb.c @@ -42,9 +42,9 @@ __FBSDID("$FreeBSD$"); #include "extern.h" #include "pathnames.h" -static int check_junk __P((struct cmdinfo *)); -static void add_ci __P((const struct cmdinfo *, struct cmdinfo *)); -static void print_ci __P((const struct cmdinfo *, const struct cmdinfo *)); +static int check_junk(const struct cmdinfo *); +static void add_ci(const struct cmdinfo *, struct cmdinfo *); +static void print_ci(const struct cmdinfo *, const struct cmdinfo *); static DB *pacct_db; @@ -113,8 +113,7 @@ pacct_destroy() } int -pacct_add(ci) - const struct cmdinfo *ci; +pacct_add(const struct cmdinfo *ci) { DBT key, data; struct cmdinfo newci; @@ -302,8 +301,7 @@ next: rv = DB_SEQ(pacct_db, &key, &data, R_NEXT); } static int -check_junk(cip) - struct cmdinfo *cip; +check_junk(const struct cmdinfo *cip) { char *cp; size_t len; @@ -315,9 +313,7 @@ check_junk(cip) } 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; @@ -328,8 +324,7 @@ add_ci(fromcip, tocip) } 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; diff --git a/usr.sbin/sa/usrdb.c b/usr.sbin/sa/usrdb.c index d2f739d..991fc90 100644 --- a/usr.sbin/sa/usrdb.c +++ b/usr.sbin/sa/usrdb.c @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include "extern.h" #include "pathnames.h" -static int uid_compare __P((const DBT *, const DBT *)); +static int uid_compare(const DBT *, const DBT *); static DB *usracct_db; @@ -120,8 +120,7 @@ usracct_destroy() } int -usracct_add(ci) - const struct cmdinfo *ci; +usracct_add(const struct cmdinfo *ci) { DBT key, data; struct userinfo newui; @@ -269,8 +268,7 @@ usracct_print() } static int -uid_compare(k1, k2) - const DBT *k1, *k2; +uid_compare(const DBT *k1, const DBT *k2) { u_long d1, d2; |