Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sa ANSIfy function declarations



details:   https://anonhg.NetBSD.org/src/rev/99594df0ccb4
branches:  trunk
changeset: 755578:99594df0ccb4
user:      dholland <dholland%NetBSD.org@localhost>
date:      Thu Jun 10 06:17:21 2010 +0000

description:
ANSIfy function declarations

diffstat:

 usr.sbin/sa/extern.h |   3 +--
 usr.sbin/sa/main.c   |  41 ++++++++++++++---------------------------
 usr.sbin/sa/pdb.c    |  25 ++++++++++---------------
 usr.sbin/sa/usrdb.c  |  18 ++++++++----------
 4 files changed, 33 insertions(+), 54 deletions(-)

diffs (truncated from 323 to 300 lines):

diff -r d9ea8a98fb4a -r 99594df0ccb4 usr.sbin/sa/extern.h
--- a/usr.sbin/sa/extern.h      Thu Jun 10 06:09:10 2010 +0000
+++ b/usr.sbin/sa/extern.h      Thu Jun 10 06:17:21 2010 +0000
@@ -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 */
diff -r d9ea8a98fb4a -r 99594df0ccb4 usr.sbin/sa/main.c
--- a/usr.sbin/sa/main.c        Thu Jun 10 06:09:10 2010 +0000
+++ b/usr.sbin/sa/main.c        Thu Jun 10 06:17:21 2010 +0000
@@ -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;
diff -r d9ea8a98fb4a -r 99594df0ccb4 usr.sbin/sa/pdb.c
--- a/usr.sbin/sa/pdb.c Thu Jun 10 06:09:10 2010 +0000
+++ b/usr.sbin/sa/pdb.c Thu Jun 10 06:17:21 2010 +0000
@@ -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;
diff -r d9ea8a98fb4a -r 99594df0ccb4 usr.sbin/sa/usrdb.c
--- a/usr.sbin/sa/usrdb.c       Thu Jun 10 06:09:10 2010 +0000
+++ b/usr.sbin/sa/usrdb.c       Thu Jun 10 06:17:21 2010 +0000
@@ -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()



Home | Main Index | Thread Index | Old Index