summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-09-17 19:37:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-09-17 19:37:41 +0000
commit9bd223c2bc56f227e5c70f7c4418fa69d6bd495b (patch)
tree719939b410c8bdef29d3079b200a357a34e1434f
parent6a10e81fbad0827c1ebc1ca38b0dc440f12b7424 (diff)
ansi
-rw-r--r--usr.bin/man/config.c16
-rw-r--r--usr.bin/man/man.c51
-rw-r--r--usr.bin/uname/uname.c10
-rw-r--r--usr.bin/users/users.c11
-rw-r--r--usr.bin/vmstat/dkstats.c13
-rw-r--r--usr.bin/vmstat/vmstat.c54
-rw-r--r--usr.bin/w/w.c24
-rw-r--r--usr.bin/wc/wc.c17
-rw-r--r--usr.bin/yes/yes.c8
9 files changed, 85 insertions, 119 deletions
diff --git a/usr.bin/man/config.c b/usr.bin/man/config.c
index 3e7c662a513..1508e7ffaa1 100644
--- a/usr.bin/man/config.c
+++ b/usr.bin/man/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.2 1996/06/26 05:36:59 deraadt Exp $ */
+/* $OpenBSD: config.c,v 1.3 2002/09/17 19:37:39 deraadt Exp $ */
/* $NetBSD: config.c,v 1.7 1995/09/28 06:05:21 tls Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)config.c 8.8 (Berkeley) 1/31/95";
#else
-static char rcsid[] = "$OpenBSD: config.c,v 1.2 1996/06/26 05:36:59 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: config.c,v 1.3 2002/09/17 19:37:39 deraadt Exp $";
#endif
#endif /* not lint */
@@ -68,8 +68,7 @@ struct _head head;
* tag2 <-> record <-> record <-> record
*/
void
-config(fname)
- char *fname;
+config(char *fname)
{
TAG *tp;
ENTRY *ep;
@@ -138,8 +137,7 @@ config(fname)
* Add a tag to the list.
*/
TAG *
-addlist(name)
- char *name;
+addlist(char *name)
{
TAG *tp;
@@ -156,8 +154,7 @@ addlist(name)
* Return the linked list of entries for a tag if it exists.
*/
TAG *
-getlist(name)
- char *name;
+getlist(char *name)
{
TAG *tp;
@@ -168,8 +165,7 @@ getlist(name)
}
void
-debug(l)
- char *l;
+debug(char *l)
{
TAG *tp;
ENTRY *ep;
diff --git a/usr.bin/man/man.c b/usr.bin/man/man.c
index dcb0ee8f612..b3b3f28793a 100644
--- a/usr.bin/man/man.c
+++ b/usr.bin/man/man.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man.c,v 1.20 2002/02/16 21:27:48 millert Exp $ */
+/* $OpenBSD: man.c,v 1.21 2002/09/17 19:37:39 deraadt Exp $ */
/* $NetBSD: man.c,v 1.7 1995/09/28 06:05:34 tls Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)man.c 8.17 (Berkeley) 1/31/95";
#else
-static char rcsid[] = "$OpenBSD: man.c,v 1.20 2002/02/16 21:27:48 millert Exp $";
+static char rcsid[] = "$OpenBSD: man.c,v 1.21 2002/09/17 19:37:39 deraadt Exp $";
#endif
#endif /* not lint */
@@ -85,9 +85,7 @@ static void usage(void);
sigset_t blocksigs;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
extern char *optarg;
extern int optind;
@@ -270,17 +268,24 @@ main(argc, argv)
if ((ep = malloc(sizeof(ENTRY))) == NULL ||
(ep->s = strdup(buf)) == NULL)
err(1, NULL);
- /* puts it at the end, should be at the top, but then the added
- entries would be in reverse order, fix later when all are added*/
+ /*
+ * puts it at the end, should be at the top,
+ * but then the added entries would be in
+ * reverse order, fix later when all are added
+ */
TAILQ_INSERT_TAIL(&defp->list, ep, q);
- if (e_sectp == NULL) /* save first added, to-be the new top */
+ if (e_sectp == NULL)
+ /* save first added, to-be the new top */
e_sectp = ep;
}
}
if (e_sectp != NULL) { /* entries added, fix order */
- ep->q.tqe_next = defp->list.tqh_first; /* save original head */
- defp->list.tqh_first = e_sectp; /* first added entry, new top */
- *e_sectp->q.tqe_prev = NULL; /* terminate list */
+ /* save original head */
+ ep->q.tqe_next = defp->list.tqh_first;
+ /* first added entry, new top */
+ defp->list.tqh_first = e_sectp;
+ /* terminate list */
+ *e_sectp->q.tqe_prev = NULL;
}
}
/*
@@ -529,8 +534,7 @@ next: anyfound = 1;
* Build a man page for display.
*/
static void
-build_page(fmt, pathp)
- char *fmt, **pathp;
+build_page(char *fmt, char **pathp)
{
static int warned;
ENTRY *ep;
@@ -614,8 +618,7 @@ build_page(fmt, pathp)
* display how information
*/
static void
-how(fname)
- char *fname;
+how(char *fname)
{
FILE *fp;
@@ -661,8 +664,7 @@ how(fname)
* cat out the file
*/
static void
-cat(fname)
- char *fname;
+cat(char *fname)
{
int fd, n;
char buf[2048];
@@ -691,8 +693,7 @@ cat(fname)
* check the user supplied page information
*/
static char *
-check_pager(name)
- char *name;
+check_pager(char *name)
{
char *p, *save;
@@ -724,8 +725,7 @@ check_pager(name)
* strip out flag argument and jump
*/
static void
-jump(argv, flag, name)
- char **argv, *flag, *name;
+jump(char **argv, char *flag, char *name)
{
char **arg;
@@ -745,10 +745,9 @@ jump(argv, flag, name)
* If signaled, delete the temporary files.
*/
static void
-onsig(signo)
- int signo;
+onsig(int signo)
{
- (void)cleanup();
+ (void)cleanup(); /* XXX signal race */
(void)signal(signo, SIG_DFL);
(void)kill(getpid(), signo);
@@ -762,7 +761,7 @@ onsig(signo)
* Clean up temporary files, show any error messages.
*/
static int
-cleanup()
+cleanup(void)
{
TAG *intmpp, *missp;
ENTRY *ep;
@@ -793,7 +792,7 @@ cleanup()
* print usage message and die
*/
static void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s [-achw] [-C file] [-M path] [-m path] "
"[-s section] [-S subsection] [section] title ...\n", __progname);
diff --git a/usr.bin/uname/uname.c b/usr.bin/uname/uname.c
index 469a5f2aca5..ee17c7989aa 100644
--- a/usr.bin/uname/uname.c
+++ b/usr.bin/uname/uname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uname.c,v 1.5 2001/07/12 05:17:27 deraadt Exp $ */
+/* $OpenBSD: uname.c,v 1.6 2002/09/17 19:37:40 deraadt Exp $ */
/*
* Copyright (c) 1994 Winning Strategies, Inc.
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: uname.c,v 1.5 2001/07/12 05:17:27 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: uname.c,v 1.6 2002/09/17 19:37:40 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -54,9 +54,7 @@ static void usage();
#define PRINT_PROCESSOR 0x20
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
struct utsname u;
int c;
@@ -148,7 +146,7 @@ main(argc, argv)
}
static void
-usage()
+usage(void)
{
fprintf(stderr, "usage: uname [-amnprsv]\n");
exit(1);
diff --git a/usr.bin/users/users.c b/usr.bin/users/users.c
index 02b23a9530a..dcaac2ee449 100644
--- a/usr.bin/users/users.c
+++ b/usr.bin/users/users.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: users.c,v 1.5 2002/02/16 21:27:56 millert Exp $ */
+/* $OpenBSD: users.c,v 1.6 2002/09/17 19:37:40 deraadt Exp $ */
/* $NetBSD: users.c,v 1.5 1994/12/20 15:58:19 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)users.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: users.c,v 1.5 2002/02/16 21:27:56 millert Exp $";
+static char rcsid[] = "$OpenBSD: users.c,v 1.6 2002/09/17 19:37:40 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -59,9 +59,7 @@ typedef char namebuf[UT_NAMESIZE];
int scmp(const void *, const void *);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
namebuf *names = NULL;
int ncnt = 0;
@@ -115,8 +113,7 @@ main(argc, argv)
}
int
-scmp(p, q)
- const void *p, *q;
+scmp(const void *p, const void *q)
{
return(strncmp((char *) p, (char *) q, UT_NAMESIZE));
}
diff --git a/usr.bin/vmstat/dkstats.c b/usr.bin/vmstat/dkstats.c
index 22af0ffb2a7..0c5d34e6051 100644
--- a/usr.bin/vmstat/dkstats.c
+++ b/usr.bin/vmstat/dkstats.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dkstats.c,v 1.20 2002/08/04 00:51:01 deraadt Exp $ */
+/* $OpenBSD: dkstats.c,v 1.21 2002/09/17 19:37:40 deraadt Exp $ */
/* $NetBSD: dkstats.c,v 1.1 1996/05/10 23:19:27 thorpej Exp $ */
/*
@@ -117,7 +117,7 @@ char **dr_name;
* the delta values in the 'cur' structure.
*/
void
-dkswap()
+dkswap(void)
{
u_int64_t tmp;
int i;
@@ -154,7 +154,7 @@ dkswap()
* Also collect statistics for tty i/o and cpu ticks.
*/
void
-dkreadstats()
+dkreadstats(void)
{
#if !defined(NOKVM)
struct disk cur_disk, *p;
@@ -230,8 +230,7 @@ dkreadstats()
* track disk statistics.
*/
int
-dkinit(select)
-int select;
+dkinit(int select)
{
#if !defined(NOKVM)
struct disklist_head disk_head;
@@ -373,9 +372,7 @@ int select;
* 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];
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 9b4439ff549..0ae8ee4cbb3 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -1,5 +1,5 @@
/* $NetBSD: vmstat.c,v 1.29.4.1 1996/06/05 00:21:05 cgd Exp $ */
-/* $OpenBSD: vmstat.c,v 1.71 2002/09/05 04:05:53 art Exp $ */
+/* $OpenBSD: vmstat.c,v 1.72 2002/09/17 19:37:40 deraadt Exp $ */
/*
* Copyright (c) 1980, 1986, 1991, 1993
@@ -158,9 +158,7 @@ extern char *__progname;
int verbose = 0;
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
extern int optind;
extern char *optarg;
@@ -299,8 +297,7 @@ main(argc, argv)
}
char **
-choosedrives(argv)
- char **argv;
+choosedrives(char **argv)
{
int i;
@@ -334,7 +331,7 @@ choosedrives(argv)
}
time_t
-getuptime()
+getuptime(void)
{
static time_t now;
static struct timeval boottime;
@@ -366,9 +363,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;
@@ -447,7 +442,7 @@ dovmstat(interval, reps)
}
void
-printhdr()
+printhdr(void)
{
int i;
@@ -474,14 +469,14 @@ printhdr()
* Force a header to be prepended to the next output.
*/
void
-needhdr()
+needhdr(void)
{
hdrcnt = 1;
}
void
-dotimes()
+dotimes(void)
{
u_int pgintime, rectime;
int mib[2];
@@ -514,8 +509,7 @@ dotimes()
}
int
-pct(top, bot)
- long top, bot;
+pct(long top, long bot)
{
long ans;
@@ -528,7 +522,7 @@ pct(top, bot)
#define PCT(top, bot) pct((long)(top), (long)(bot))
void
-dosum()
+dosum(void)
{
struct nchstats nchstats;
long nchtotal;
@@ -633,7 +627,7 @@ dosum()
}
void
-doforkst()
+doforkst(void)
{
struct forkstat fks;
size_t size;
@@ -654,15 +648,18 @@ doforkst()
(void)printf("%d forks, %d pages, average %.2f\n",
fks.cntfork, fks.sizfork, (double)fks.sizfork / fks.cntfork);
(void)printf("%d vforks, %d pages, average %.2f\n",
- fks.cntvfork, fks.sizvfork, (double)fks.sizvfork / (fks.cntvfork ? fks.cntvfork : 1));
+ fks.cntvfork, fks.sizvfork,
+ (double)fks.sizvfork / (fks.cntvfork ? fks.cntvfork : 1));
(void)printf("%d rforks, %d pages, average %.2f\n",
- fks.cntrfork, fks.sizrfork, (double)fks.sizrfork / (fks.cntrfork ? fks.cntrfork : 1));
+ fks.cntrfork, fks.sizrfork,
+ (double)fks.sizrfork / (fks.cntrfork ? fks.cntrfork : 1));
(void)printf("%d kthread creations, %d pages, average %.2f\n",
- fks.cntkthread, fks.sizkthread, (double)fks.sizkthread / (fks.cntkthread ? fks.cntkthread : 1));
+ fks.cntkthread, fks.sizkthread,
+ (double)fks.sizkthread / (fks.cntkthread ? fks.cntkthread : 1));
}
void
-dkstats()
+dkstats(void)
{
int dn, state;
double etime;
@@ -684,7 +681,7 @@ dkstats()
}
void
-cpustats()
+cpustats(void)
{
int state;
double pct, total;
@@ -708,7 +705,7 @@ cpustats()
#include <machine/cpu.h>
#undef _KERNEL
void
-dointr()
+dointr(void)
{
struct intrhand *intrhand[16], *ihp, ih;
u_long inttotal = 0;
@@ -834,7 +831,7 @@ dointr()
}
#else
void
-dointr()
+dointr(void)
{
long *intrcnt, inttotal;
time_t uptime;
@@ -891,7 +888,7 @@ dointr()
char *kmemnames[] = INITKMEMNAMES;
void
-domem()
+domem(void)
{
struct kmembuckets *kp;
struct kmemstats *ks;
@@ -1223,10 +1220,7 @@ dopool_kvm(void)
* 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)
{
char *sym;
@@ -1245,7 +1239,7 @@ kread(nlx, addr, size)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s [-fimst] [-c count] [-M core] "
"[-N system] [-w wait] [disks]\n", __progname);
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 2a03fbbb55e..8f9b4551249 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: w.c,v 1.37 2002/06/08 22:57:34 angelos Exp $ */
+/* $OpenBSD: w.c,v 1.38 2002/09/17 19:37:40 deraadt Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993, 1994
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94";
#else
-static char *rcsid = "$OpenBSD: w.c,v 1.37 2002/06/08 22:57:34 angelos Exp $";
+static char *rcsid = "$OpenBSD: w.c,v 1.38 2002/09/17 19:37:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -121,9 +121,7 @@ static struct stat
static void usage(int);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
extern char *__progname;
struct kinfo_proc *kp;
@@ -179,7 +177,8 @@ main(argc, argv)
argv += optind;
if (nlistf == NULL && memf == NULL) {
- if ((kd = kvm_openfiles(nlistf, memf, NULL, KVM_NO_FILES, errbuf)) == NULL)
+ if ((kd = kvm_openfiles(nlistf, memf, NULL, KVM_NO_FILES,
+ errbuf)) == NULL)
errx(1, "%s", errbuf);
} else {
if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf)) == NULL)
@@ -347,8 +346,7 @@ main(argc, argv)
}
static void
-pr_args(kp)
- struct kinfo_proc *kp;
+pr_args(struct kinfo_proc *kp)
{
char **argv, *str;
int left;
@@ -387,9 +385,7 @@ nothing:
}
static void
-pr_header(nowp, nusers)
- time_t *nowp;
- int nusers;
+pr_header(time_t *nowp, int nusers)
{
double avenrun[3];
time_t uptime;
@@ -463,8 +459,7 @@ pr_header(nowp, nusers)
}
static struct stat *
-ttystat(line)
- char *line;
+ttystat(char *line)
{
static struct stat sb;
char ttybuf[sizeof(_PATH_DEV) + UT_LINESIZE];
@@ -478,8 +473,7 @@ ttystat(line)
}
static void
-usage(wcmd)
- int wcmd;
+usage(int wcmd)
{
if (wcmd)
(void)fprintf(stderr,
diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c
index 7316aded68f..af35e83d58d 100644
--- a/usr.bin/wc/wc.c
+++ b/usr.bin/wc/wc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wc.c,v 1.7 2002/02/16 21:27:58 millert Exp $ */
+/* $OpenBSD: wc.c,v 1.8 2002/09/17 19:37:40 deraadt Exp $ */
/*
* Copyright (c) 1980, 1987, 1991, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)wc.c 8.2 (Berkeley) 5/2/95";
#else
-static char rcsid[] = "$OpenBSD: wc.c,v 1.7 2002/02/16 21:27:58 millert Exp $";
+static char rcsid[] = "$OpenBSD: wc.c,v 1.8 2002/09/17 19:37:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -67,9 +67,7 @@ void print_counts(int64_t, int64_t, int64_t, char *);
void cnt(char *);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch;
@@ -122,8 +120,7 @@ main(argc, argv)
}
void
-cnt(file)
- char *file;
+cnt(char *file)
{
u_char *C;
short gotsp;
@@ -244,11 +241,7 @@ cnt(file)
}
void
-print_counts(lines, words, chars, name)
- int64_t lines;
- int64_t words;
- int64_t chars;
- char *name;
+print_counts(int64_t lines, int64_t words, int64_t chars, char *name)
{
if (doline)
diff --git a/usr.bin/yes/yes.c b/usr.bin/yes/yes.c
index c510da5d72e..92d880b017e 100644
--- a/usr.bin/yes/yes.c
+++ b/usr.bin/yes/yes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yes.c,v 1.4 2002/02/26 07:31:52 todd Exp $ */
+/* $OpenBSD: yes.c,v 1.5 2002/09/17 19:37:40 deraadt Exp $ */
/* $NetBSD: yes.c,v 1.3 1994/11/14 04:56:15 jtc Exp $ */
/*
@@ -44,15 +44,13 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)yes.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: yes.c,v 1.4 2002/02/26 07:31:52 todd Exp $";
+static char rcsid[] = "$OpenBSD: yes.c,v 1.5 2002/09/17 19:37:40 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
if (argc > 1)
for (;;)