Full modernize cleanup:

- De-__P()
	- constify where appropriate
	- ANSI functions instead of K&R

Pointed out by:	stefanf
This commit is contained in:
Xin LI 2005-02-10 12:43:16 +00:00
parent 1ba212823f
commit 69315c6f32
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=141638
3 changed files with 20 additions and 37 deletions

View File

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

View File

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

View File

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