summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-10 22:20:55 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-10 22:20:55 +0000
commitb8aaa8bec8414f8e55cf9b61fe0873d242c773b8 (patch)
tree5e43016c4fae834239fd38972fd58355ed6b54b5
parentf18f6607440f6d2da08fac3522d88a65c77a5f3e (diff)
mostly ansi cleanup; pval ok
-rw-r--r--usr.bin/apply/apply.c13
-rw-r--r--usr.bin/apropos/apropos.c20
-rw-r--r--usr.bin/arch/arch.c8
-rw-r--r--usr.bin/asa/asa.c11
-rw-r--r--usr.bin/aucat/aucat.c10
-rw-r--r--usr.bin/banner/banner.c20
-rw-r--r--usr.bin/basename/basename.c10
-rw-r--r--usr.bin/bdes/bdes.c49
-rw-r--r--usr.bin/biff/biff.c10
-rw-r--r--usr.bin/cal/cal.c41
-rw-r--r--usr.bin/calendar/calendar.c13
-rw-r--r--usr.bin/cap_mkdb/cap_mkdb.c15
-rw-r--r--usr.bin/cap_mkdb/getinfo.c22
-rw-r--r--usr.bin/cdio/cdio.c8
-rw-r--r--usr.bin/checknr/checknr.c43
-rw-r--r--usr.bin/cksum/cksum.c10
-rw-r--r--usr.bin/cmp/cmp.c16
-rw-r--r--usr.bin/col/col.c30
-rw-r--r--usr.bin/colcrt/colcrt.c17
-rw-r--r--usr.bin/colrm/colrm.c13
-rw-r--r--usr.bin/column/column.c24
-rw-r--r--usr.bin/comm/comm.c17
-rw-r--r--usr.bin/compress/main.c38
-rw-r--r--usr.bin/ctags/ctags.c13
-rw-r--r--usr.bin/cut/cut.c21
-rw-r--r--usr.bin/dirname/dirname.c8
-rw-r--r--usr.bin/du/du.c21
-rw-r--r--usr.bin/elf2aout/elf2aout.c842
-rw-r--r--usr.bin/elf2ecoff/elf2ecoff.c26
-rw-r--r--usr.bin/elf2olf/elf2olf.c6
-rw-r--r--usr.bin/env/env.c10
-rw-r--r--usr.bin/error/main.c23
-rw-r--r--usr.bin/error/pi.c7
-rw-r--r--usr.bin/expand/expand.c16
-rw-r--r--usr.bin/find/function.c32
-rw-r--r--usr.bin/find/main.c10
-rw-r--r--usr.bin/finger/finger.c14
-rw-r--r--usr.bin/finger/lprint.c19
-rw-r--r--usr.bin/finger/sprint.c14
-rw-r--r--usr.bin/finger/util.c48
-rw-r--r--usr.bin/fold/fold.c15
-rw-r--r--usr.bin/from/from.c11
-rw-r--r--usr.bin/fsplit/fsplit.c36
-rw-r--r--usr.bin/fstat/fstat.c8
-rw-r--r--usr.bin/gencat/gencat.c63
-rw-r--r--usr.bin/getconf/getconf.c10
-rw-r--r--usr.bin/getopt/getopt.c8
-rw-r--r--usr.bin/gprof/gprof.c33
-rw-r--r--usr.bin/head/head.c10
-rw-r--r--usr.bin/hexdump/hexdump.c8
-rw-r--r--usr.bin/id/id.c25
-rw-r--r--usr.bin/ipcrm/ipcrm.c23
-rw-r--r--usr.bin/join/join.c42
-rw-r--r--usr.bin/jot/jot.c17
-rw-r--r--usr.bin/ktrace/ktrace.c16
-rw-r--r--usr.bin/lam/lam.c20
-rw-r--r--usr.bin/last/last.c35
-rw-r--r--usr.bin/lastcomm/lastcomm.c23
-rw-r--r--usr.bin/leave/leave.c13
-rw-r--r--usr.bin/logger/logger.c17
-rw-r--r--usr.bin/logname/logname.c10
-rw-r--r--usr.bin/look/look.c25
-rw-r--r--usr.bin/m4/main.c10
-rw-r--r--usr.bin/man/man.c9
-rw-r--r--usr.bin/mesg/mesg.c8
-rw-r--r--usr.bin/mg/tty.c6
-rw-r--r--usr.bin/midiplay/midiplay.c34
-rw-r--r--usr.bin/mktemp/mktemp.c10
-rw-r--r--usr.bin/modstat/modstat.c6
-rw-r--r--usr.bin/msgs/msgs.c33
-rw-r--r--usr.bin/nc/netcat.c4
-rw-r--r--usr.bin/nfsstat/nfsstat.c24
-rw-r--r--usr.bin/nice/nice.c10
-rw-r--r--usr.bin/nm/nm.c51
-rw-r--r--usr.bin/paste/paste.c19
-rw-r--r--usr.bin/pctr/pctr.c44
-rw-r--r--usr.bin/pmdb/pmdb.c4
-rw-r--r--usr.bin/pr/pr.c8
-rw-r--r--usr.bin/printenv/printenv.c8
-rw-r--r--usr.bin/printf/printf.c38
-rw-r--r--usr.bin/quota/quota.c72
-rw-r--r--usr.bin/readlink/readlink.c6
-rw-r--r--usr.bin/renice/renice.c15
-rw-r--r--usr.bin/rev/rev.c10
-rw-r--r--usr.bin/rpcinfo/rpcinfo.c55
-rw-r--r--usr.bin/rs/rs.c38
-rw-r--r--usr.bin/rup/rup.c47
-rw-r--r--usr.bin/ruptime/ruptime.c26
-rw-r--r--usr.bin/rusers/rusers.c8
-rw-r--r--usr.bin/rwall/rwall.c11
-rw-r--r--usr.bin/script/script.c26
-rw-r--r--usr.bin/sed/compile.c53
-rw-r--r--usr.bin/sed/main.c23
-rw-r--r--usr.bin/sed/process.c37
-rw-r--r--usr.bin/showmount/showmount.c21
-rw-r--r--usr.bin/size/size.c24
-rw-r--r--usr.bin/skeyinfo/skeyinfo.c4
-rw-r--r--usr.bin/soelim/soelim.c12
-rw-r--r--usr.bin/sort/fields.c6
-rw-r--r--usr.bin/sort/sort.c16
-rw-r--r--usr.bin/sort/tmp.c6
-rw-r--r--usr.bin/split/split.c16
-rw-r--r--usr.bin/ssh/packet.c4
-rw-r--r--usr.bin/ssh/progressmeter.c6
-rw-r--r--usr.bin/strings/strings.c12
-rw-r--r--usr.bin/strip/strip.c24
-rw-r--r--usr.bin/tail/misc.c8
-rw-r--r--usr.bin/tail/tail.c13
-rw-r--r--usr.bin/talk/ctl.c11
-rw-r--r--usr.bin/talk/init_disp.c20
-rw-r--r--usr.bin/talk/invite.c13
-rw-r--r--usr.bin/talk/io.c9
-rw-r--r--usr.bin/talk/look_up.c9
-rw-r--r--usr.bin/talk/msgs.c8
-rw-r--r--usr.bin/talk/talk.c8
-rw-r--r--usr.bin/tcopy/tcopy.c23
-rw-r--r--usr.bin/tee/tee.c12
-rw-r--r--usr.bin/tftp/main.c82
-rw-r--r--usr.bin/tftp/tftp.c8
-rw-r--r--usr.bin/time/time.c10
-rw-r--r--usr.bin/touch/touch.c28
-rw-r--r--usr.bin/tput/tput.c19
-rw-r--r--usr.bin/tr/tr.c16
-rw-r--r--usr.bin/tsort/tsort.c4
-rw-r--r--usr.bin/tty/tty.c10
-rw-r--r--usr.bin/ul/ul.c34
-rw-r--r--usr.bin/unexpand/unexpand.c11
-rw-r--r--usr.bin/units/units.c6
-rw-r--r--usr.bin/unvis/unvis.c12
-rw-r--r--usr.bin/uudecode/uudecode.c12
-rw-r--r--usr.bin/uuencode/uuencode.c16
-rw-r--r--usr.bin/vacation/vacation.c27
-rw-r--r--usr.bin/vis/vis.c14
-rw-r--r--usr.bin/what/what.c13
-rw-r--r--usr.bin/whatis/whatis.c18
-rw-r--r--usr.bin/which/which.c6
-rw-r--r--usr.bin/who/who.c21
-rw-r--r--usr.bin/whois/whois.c6
-rw-r--r--usr.bin/window/main.c11
-rw-r--r--usr.bin/write/write.c6
-rw-r--r--usr.bin/xargs/xargs.c18
-rw-r--r--usr.bin/xinstall/xinstall.c55
142 files changed, 1396 insertions, 2161 deletions
diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c
index a0425b36991..83d499c48cc 100644
--- a/usr.bin/apply/apply.c
+++ b/usr.bin/apply/apply.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apply.c,v 1.14 2003/06/03 02:56:05 millert Exp $ */
+/* $OpenBSD: apply.c,v 1.15 2003/06/10 22:20:44 deraadt Exp $ */
/* $NetBSD: apply.c,v 1.3 1995/03/25 03:38:23 glass Exp $ */
/*-
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)apply.c 8.4 (Berkeley) 4/4/94";
#else
-static char rcsid[] = "$OpenBSD: apply.c,v 1.14 2003/06/03 02:56:05 millert Exp $";
+static char rcsid[] = "$OpenBSD: apply.c,v 1.15 2003/06/10 22:20:44 deraadt Exp $";
#endif
#endif /* not lint */
@@ -56,9 +56,7 @@ void usage(void);
int system(const char *);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch, clen, debug, i, l, magic, n, nargs, rval;
char *c, *cmd, *p, *q;
@@ -203,8 +201,7 @@ main(argc, argv)
* variable as the shell to execute.
*/
int
-system(command)
- const char *command;
+system(const char *command)
{
static char *name, *shell;
pid_t pid;
@@ -244,7 +241,7 @@ system(command)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: apply [-#] [-a magic] [-d] command argument [...]\n");
diff --git a/usr.bin/apropos/apropos.c b/usr.bin/apropos/apropos.c
index 61e53d8e6be..e39d546e0d9 100644
--- a/usr.bin/apropos/apropos.c
+++ b/usr.bin/apropos/apropos.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apropos.c,v 1.9 2003/06/03 02:56:05 millert Exp $ */
+/* $OpenBSD: apropos.c,v 1.10 2003/06/10 22:20:44 deraadt Exp $ */
/* $NetBSD: apropos.c,v 1.5 1995/09/04 20:46:20 tls Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)apropos.c 8.8 (Berkeley) 5/4/95";
#else
-static char rcsid[] = "$OpenBSD: apropos.c,v 1.9 2003/06/03 02:56:05 millert Exp $";
+static char rcsid[] = "$OpenBSD: apropos.c,v 1.10 2003/06/10 22:20:44 deraadt Exp $";
#endif
#endif /* not lint */
@@ -68,9 +68,7 @@ int match(char *, char *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
ENTRY *ep;
TAG *tp;
@@ -133,9 +131,7 @@ main(argc, argv)
}
void
-apropos(argv, path, buildpath)
- char **argv, *path;
- int buildpath;
+apropos(char **argv, char *path, int buildpath)
{
char *end, *name, **p;
char buf[MAXLINELEN + 1], wbuf[MAXLINELEN + 1];
@@ -183,8 +179,7 @@ apropos(argv, path, buildpath)
* match anywhere the string appears
*/
int
-match(bp, str)
- char *bp, *str;
+match(char *bp, char *str)
{
int len;
char test;
@@ -205,8 +200,7 @@ match(bp, str)
* convert a string to lower case
*/
void
-lowstr(from, to)
- char *from, *to;
+lowstr(char *from, char *to)
{
char ch;
@@ -220,7 +214,7 @@ lowstr(from, to)
* print usage message and die
*/
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
diff --git a/usr.bin/arch/arch.c b/usr.bin/arch/arch.c
index c76069332c8..f584f9d7848 100644
--- a/usr.bin/arch/arch.c
+++ b/usr.bin/arch/arch.c
@@ -24,7 +24,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: arch.c,v 1.7 2003/06/04 16:24:45 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: arch.c,v 1.8 2003/06/10 22:20:44 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -39,9 +39,7 @@ static void usage(void);
static int machine;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
char *arch;
char *opts;
@@ -89,7 +87,7 @@ main(argc, argv)
}
static void
-usage()
+usage(void)
{
if (machine)
fprintf(stderr, "usage: machine [-a]\n");
diff --git a/usr.bin/asa/asa.c b/usr.bin/asa/asa.c
index d298699c69e..8fa539607d2 100644
--- a/usr.bin/asa/asa.c
+++ b/usr.bin/asa/asa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asa.c,v 1.3 1998/07/20 19:57:17 deraadt Exp $ */
+/* $OpenBSD: asa.c,v 1.4 2003/06/10 22:20:44 deraadt Exp $ */
/* $NetBSD: asa.c,v 1.10 1995/04/21 03:01:41 cgd Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: asa.c,v 1.3 1998/07/20 19:57:17 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: asa.c,v 1.4 2003/06/10 22:20:44 deraadt Exp $";
#endif
#include <stdio.h>
@@ -42,9 +42,7 @@ static char rcsid[] = "$OpenBSD: asa.c,v 1.3 1998/07/20 19:57:17 deraadt Exp $";
static void asa();
int
-main (argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
FILE *fp;
@@ -69,8 +67,7 @@ main (argc, argv)
}
static void
-asa(f)
- FILE *f;
+asa(FILE *f)
{
char *buf;
size_t len;
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c
index 82f56fc45af..03156392020 100644
--- a/usr.bin/aucat/aucat.c
+++ b/usr.bin/aucat/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.5 2002/12/09 00:45:38 millert Exp $ */
+/* $OpenBSD: aucat.c,v 1.6 2003/06/10 22:20:44 deraadt Exp $ */
/*
* Copyright (c) 1997 Kenneth Stailey. All rights reserved.
*
@@ -45,9 +45,7 @@
* device. Return 0 on success, -1 on failure.
*/
int
-playfile(fd, dev)
- int fd;
- char *dev;
+playfile(int fd, char *dev)
{
static int afd = -1;
int rd;
@@ -67,9 +65,7 @@ playfile(fd, dev)
}
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int fd, ch;
unsigned long data;
diff --git a/usr.bin/banner/banner.c b/usr.bin/banner/banner.c
index e513de26ee4..261d7f02cc4 100644
--- a/usr.bin/banner/banner.c
+++ b/usr.bin/banner/banner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: banner.c,v 1.7 2003/06/03 02:56:06 millert Exp $ */
+/* $OpenBSD: banner.c,v 1.8 2003/06/10 22:20:44 deraadt Exp $ */
/* $NetBSD: banner.c,v 1.2 1995/04/09 06:00:15 cgd Exp $ */
/*
@@ -55,7 +55,7 @@ static const char copyright[] =
#if 0
static char sccsid[] = "@(#)printjob.c 8.2 (Berkeley) 4/16/94";
#else
-static const char rcsid[] = "$OpenBSD: banner.c,v 1.7 2003/06/03 02:56:06 millert Exp $";
+static const char rcsid[] = "$OpenBSD: banner.c,v 1.8 2003/06/10 22:20:44 deraadt Exp $";
#endif
#endif /* not lint */
@@ -71,10 +71,7 @@ static long PW = LINELEN;
/* the char gen code below is lifted from lpd */
static char *
-scnline(key, p, c)
- int key;
- char *p;
- int c;
+scnline(int key, char *p, int c)
{
int scnwidth;
@@ -98,8 +95,7 @@ scnline(key, p, c)
static int
-dropit(c)
- int c;
+dropit(int c)
{
switch(c) {
@@ -119,9 +115,7 @@ dropit(c)
}
static void
-scan_out(scfd, scsp, dlm)
- int scfd, dlm;
- char *scsp;
+scan_out(int scfd, char *scsp, int dlm)
{
char *strp;
int nchrs, j;
@@ -164,9 +158,7 @@ scan_out(scfd, scsp, dlm)
* for each word, print up to 10 chars in big letters.
*/
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
char word[10+1]; /* strings limited to 10 chars */
diff --git a/usr.bin/basename/basename.c b/usr.bin/basename/basename.c
index e5a279f8595..758b95afc08 100644
--- a/usr.bin/basename/basename.c
+++ b/usr.bin/basename/basename.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: basename.c,v 1.5 2003/06/03 02:56:06 millert Exp $ */
+/* $OpenBSD: basename.c,v 1.6 2003/06/10 22:20:44 deraadt Exp $ */
/* $NetBSD: basename.c,v 1.9 1995/09/02 05:29:46 jtc Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)basename.c 8.4 (Berkeley) 5/4/95";
#endif
-static char rcsid[] = "$OpenBSD: basename.c,v 1.5 2003/06/03 02:56:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: basename.c,v 1.6 2003/06/10 22:20:44 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -52,9 +52,7 @@ static char rcsid[] = "$OpenBSD: basename.c,v 1.5 2003/06/03 02:56:06 millert Ex
void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
char *p;
@@ -127,7 +125,7 @@ main(argc, argv)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: basename string [suffix]\n");
diff --git a/usr.bin/bdes/bdes.c b/usr.bin/bdes/bdes.c
index 3cb3b4c3578..0a784bdd53d 100644
--- a/usr.bin/bdes/bdes.c
+++ b/usr.bin/bdes/bdes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bdes.c,v 1.10 2003/06/03 02:56:06 millert Exp $ */
+/* $OpenBSD: bdes.c,v 1.11 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: bdes.c,v 1.2 1995/03/26 03:33:19 glass Exp $ */
/*-
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)bdes.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: bdes.c,v 1.10 2003/06/03 02:56:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: bdes.c,v 1.11 2003/06/10 22:20:45 deraadt Exp $";
#endif
#endif /* not lint */
@@ -181,9 +181,7 @@ int pflag; /* 1 to preserve parity bits */
int
-main(ac, av)
- int ac; /* arg count */
- char **av; /* arg vector */
+main(int ac, char *av[])
{
extern int optind; /* option (argument) number */
extern char *optarg; /* argument to option if any */
@@ -357,9 +355,7 @@ main(ac, av)
* map a hex character to an integer
*/
int
-tobinhex(c, radix)
- char c; /* char to be converted */
- int radix; /* base (2 to 16) */
+tobinhex(char c, int radix)
{
switch(c) {
case '0': return(0x0);
@@ -389,9 +385,7 @@ tobinhex(c, radix)
* convert the key to a bit pattern
*/
void
-cvtkey(obuf, ibuf)
- char *obuf; /* bit pattern */
- char *ibuf; /* the key itself */
+cvtkey(char *obuf, char *ibuf)
{
int i, j; /* counter in a for loop */
int nbuf[64]; /* used for hex/key translation */
@@ -458,9 +452,7 @@ cvtkey(obuf, ibuf)
* 3. must be a multiple of mult
*/
int
-setbits(s, mult)
- char *s; /* the ASCII string */
- int mult; /* what it must be a multiple of */
+setbits(char *s, int mult)
{
char *p; /* pointer in a for loop */
int n = 0; /* the integer collected */
@@ -501,8 +493,7 @@ setbits(s, mult)
* DES ignores the low order bit of each character.
*/
void
-makekey(buf)
- Desbuf buf; /* key block */
+makekey(Desbuf buf)
{
int i, j; /* counter in a for loop */
int par; /* parity counter */
@@ -530,7 +521,7 @@ makekey(buf)
* This encrypts using the Electronic Code Book mode of DES
*/
void
-ecbenc()
+ecbenc(void)
{
int n; /* number of bytes actually read */
int bn; /* block number */
@@ -559,7 +550,7 @@ ecbenc()
* This decrypts using the Electronic Code Book mode of DES
*/
void
-ecbdec()
+ecbdec(void)
{
int n; /* number of bytes actually read */
int c; /* used to test for EOF */
@@ -591,7 +582,7 @@ ecbdec()
* This encrypts using the Cipher Block Chaining mode of DES
*/
void
-cbcenc()
+cbcenc(void)
{
int n; /* number of bytes actually read */
int bn; /* block number */
@@ -625,7 +616,7 @@ cbcenc()
* This decrypts using the Cipher Block Chaining mode of DES
*/
void
-cbcdec()
+cbcdec(void)
{
int n; /* number of bytes actually read */
Desbuf msgbuf; /* I/O buffer */
@@ -662,7 +653,7 @@ cbcdec()
* This authenticates using the Cipher Block Chaining mode of DES
*/
void
-cbcauth()
+cbcauth(void)
{
int n, j; /* number of bytes actually read */
Desbuf msgbuf; /* I/O buffer */
@@ -707,7 +698,7 @@ cbcauth()
* This encrypts using the Cipher FeedBack mode of DES
*/
void
-cfbenc()
+cfbenc(void)
{
int n; /* number of bytes actually read */
int nbytes; /* number of bytes to read */
@@ -749,7 +740,7 @@ cfbenc()
* This decrypts using the Cipher Block Chaining mode of DES
*/
void
-cfbdec()
+cfbdec(void)
{
int n; /* number of bytes actually read */
int c; /* used to test for EOF */
@@ -795,7 +786,7 @@ cfbdec()
* This encrypts using the alternative Cipher FeedBack mode of DES
*/
void
-cfbaenc()
+cfbaenc(void)
{
int n; /* number of bytes actually read */
int nbytes; /* number of bytes to read */
@@ -841,7 +832,7 @@ cfbaenc()
* This decrypts using the alternative Cipher Block Chaining mode of DES
*/
void
-cfbadec()
+cfbadec(void)
{
int n; /* number of bytes actually read */
int c; /* used to test for EOF */
@@ -888,7 +879,7 @@ cfbadec()
* This encrypts using the Output FeedBack mode of DES
*/
void
-ofbenc()
+ofbenc(void)
{
int n; /* number of bytes actually read */
int c; /* used to test for EOF */
@@ -934,7 +925,7 @@ ofbenc()
* This decrypts using the Output Block Chaining mode of DES
*/
void
-ofbdec()
+ofbdec(void)
{
int n; /* number of bytes actually read */
int c; /* used to test for EOF */
@@ -983,7 +974,7 @@ ofbdec()
* This authenticates using the Cipher FeedBack mode of DES
*/
void
-cfbauth()
+cfbauth(void)
{
int n, j; /* number of bytes actually read */
int nbytes; /* number of bytes to read */
@@ -1066,7 +1057,7 @@ compress(from, to)
* message about usage
*/
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "%s\n",
"usage: bdes [-abdp] [-F bit] [-f bit] [-k key] [-m bit] [-o bit] [-v vector]");
diff --git a/usr.bin/biff/biff.c b/usr.bin/biff/biff.c
index ad6c0caee77..6d2c07db556 100644
--- a/usr.bin/biff/biff.c
+++ b/usr.bin/biff/biff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biff.c,v 1.8 2003/06/03 02:56:06 millert Exp $ */
+/* $OpenBSD: biff.c,v 1.9 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: biff.c,v 1.3 1995/03/26 02:34:22 glass Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)biff.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: biff.c,v 1.8 2003/06/03 02:56:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: biff.c,v 1.9 2003/06/10 22:20:45 deraadt Exp $";
#endif
#endif /* not lint */
@@ -57,9 +57,7 @@ static char rcsid[] = "$OpenBSD: biff.c,v 1.8 2003/06/03 02:56:06 millert Exp $"
static void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat sb;
int ch;
@@ -102,7 +100,7 @@ main(argc, argv)
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: biff [y | n]\n");
exit(2);
diff --git a/usr.bin/cal/cal.c b/usr.bin/cal/cal.c
index 0774d67c78d..ef33b217d53 100644
--- a/usr.bin/cal/cal.c
+++ b/usr.bin/cal/cal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cal.c,v 1.9 2003/06/03 02:56:06 millert Exp $ */
+/* $OpenBSD: cal.c,v 1.10 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: cal.c,v 1.6 1995/03/26 03:10:24 glass Exp $ */
/*
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)cal.c 8.4 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: cal.c,v 1.9 2003/06/03 02:56:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: cal.c,v 1.10 2003/06/10 22:20:45 deraadt Exp $";
#endif
#endif /* not lint */
@@ -134,9 +134,7 @@ void usage(void);
void yearly(int);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
struct tm *local_time;
time_t now;
@@ -196,8 +194,7 @@ main(argc, argv)
#define J_HEAD_SEP 2
void
-monthly(month, year)
- int month, year;
+monthly(int month, int year)
{
int col, row, len, days[MAXDAYS];
char *p, lineout[30];
@@ -219,8 +216,7 @@ monthly(month, year)
}
void
-j_yearly(year)
- int year;
+j_yearly(int year)
{
int col, *dp, i, month, row, which_cal;
int days[12][MAXDAYS];
@@ -254,8 +250,7 @@ j_yearly(year)
}
void
-yearly(year)
- int year;
+yearly(int year)
{
int col, *dp, i, month, row, which_cal;
int days[12][MAXDAYS];
@@ -297,9 +292,7 @@ yearly(year)
* builds that array for any month from Jan. 1 through Dec. 9999.
*/
void
-day_array(month, year, days)
- int month, year;
- int *days;
+day_array(int month, int year, int *days)
{
int day, dw, dm;
@@ -321,8 +314,7 @@ day_array(month, year, days)
* return the 1 based day number within the year
*/
int
-day_in_year(day, month, year)
- int day, month, year;
+day_in_year(int day, int month, int year)
{
int i, leap;
@@ -340,8 +332,7 @@ day_in_year(day, month, year)
* missing days.
*/
int
-day_in_week(day, month, year)
- int day, month, year;
+day_in_week(int day, int month, int year)
{
long temp;
@@ -355,9 +346,7 @@ day_in_week(day, month, year)
}
void
-ascii_day(p, day)
- char *p;
- int day;
+ascii_day(char *p, int day)
{
int display, val;
static char *aday[] = {
@@ -397,8 +386,7 @@ ascii_day(p, day)
}
void
-trim_trailing_spaces(s)
- char *s;
+trim_trailing_spaces(char *s)
{
char *p;
@@ -412,10 +400,7 @@ trim_trailing_spaces(s)
}
void
-center(str, len, separate)
- char *str;
- int len;
- int separate;
+center(char *str, int len, int separate)
{
len -= strlen(str);
@@ -425,7 +410,7 @@ center(str, len, separate)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: cal [-jy] [[month] year]\n");
diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c
index 17fc1de2b20..bbb9d071936 100644
--- a/usr.bin/calendar/calendar.c
+++ b/usr.bin/calendar/calendar.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: calendar.c,v 1.20 2003/06/03 02:56:06 millert Exp $ */
+/* $OpenBSD: calendar.c,v 1.21 2003/06/10 22:20:45 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@@ -39,7 +39,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94";
#else
-static char rcsid[] = "$OpenBSD: calendar.c,v 1.20 2003/06/03 02:56:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: calendar.c,v 1.21 2003/06/10 22:20:45 deraadt Exp $";
#endif
#endif /* not lint */
@@ -79,9 +79,7 @@ struct specialev spev[NUMEV];
void childsig(int);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch;
char *caldir;
@@ -256,7 +254,7 @@ main(argc, argv)
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: calendar [-a] [-A num] [-b] [-B num] [-t [[[cc]yy][mm]]dd] "
@@ -266,7 +264,6 @@ usage()
void
-childsig(sig)
- int sig;
+childsig(int signo)
{
}
diff --git a/usr.bin/cap_mkdb/cap_mkdb.c b/usr.bin/cap_mkdb/cap_mkdb.c
index 6e3186f169e..5c0005cb98b 100644
--- a/usr.bin/cap_mkdb/cap_mkdb.c
+++ b/usr.bin/cap_mkdb/cap_mkdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cap_mkdb.c,v 1.10 2003/06/03 02:56:06 millert Exp $ */
+/* $OpenBSD: cap_mkdb.c,v 1.11 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: cap_mkdb.c,v 1.5 1995/09/02 05:47:12 jtc Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)cap_mkdb.c 8.2 (Berkeley) 4/27/95";
#endif
-static char rcsid[] = "$OpenBSD: cap_mkdb.c,v 1.10 2003/06/03 02:56:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: cap_mkdb.c,v 1.11 2003/06/10 22:20:45 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -84,9 +84,7 @@ HASHINFO openinfo = {
* the correct record is stored.
*/
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int c;
@@ -136,7 +134,7 @@ main(argc, argv)
}
void
-dounlink()
+dounlink(void)
{
if (capname != NULL)
(void)unlink(capname);
@@ -155,8 +153,7 @@ dounlink()
* details above.
*/
void
-db_build(ifiles)
- char **ifiles;
+db_build(char **ifiles)
{
DBT key, data;
recno_t reccnt;
@@ -301,7 +298,7 @@ db_build(ifiles)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: cap_mkdb [-iv] [-f outfile] file1 [file2 ...]\n");
diff --git a/usr.bin/cap_mkdb/getinfo.c b/usr.bin/cap_mkdb/getinfo.c
index dcc1a8344ba..5a026a49645 100644
--- a/usr.bin/cap_mkdb/getinfo.c
+++ b/usr.bin/cap_mkdb/getinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getinfo.c,v 1.6 2003/06/04 16:24:45 deraadt Exp $ */
+/* $OpenBSD: getinfo.c,v 1.7 2003/06/10 22:20:45 deraadt Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -30,7 +30,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: getinfo.c,v 1.6 2003/06/04 16:24:45 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: getinfo.c,v 1.7 2003/06/10 22:20:45 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -74,9 +74,7 @@ int igetnext(char **, char **);
* return NULL.
*/
static char *
-igetcap(buf, cap, type)
- char *buf, *cap;
- int type;
+igetcap(char *buf, char *cap, int type)
{
char *bp, *cp;
@@ -135,10 +133,7 @@ igetcap(buf, cap, type)
* MAX_RECURSION.
*/
static int
-getent(cap, len, db_array, fd, name, depth)
- char **cap, **db_array, *name;
- u_int *len;
- int fd, depth;
+getent(char **cap, u_int *len, char **db_array, int fd, char *name, int depth)
{
char *r_end, *rp, **db_p;
int myfd, eof, foundit;
@@ -464,8 +459,7 @@ getent(cap, len, db_array, fd, name, depth)
* record buf, -1 if not.
*/
static int
-igetmatch(buf, name)
- char *buf, *name;
+igetmatch(char *buf, char *name)
{
char *np, *bp;
@@ -507,7 +501,7 @@ static int slash;
static char **dbp;
static int
-igetclose()
+igetclose(void)
{
if (pfp != NULL) {
(void)fclose(pfp);
@@ -524,9 +518,7 @@ igetclose()
* upon returning an entry with more remaining, and -1 if an error occurs.
*/
int
-igetnext(bp, db_array)
- char **bp;
- char **db_array;
+igetnext(char **bp, char **db_array)
{
size_t len;
int status, done;
diff --git a/usr.bin/cdio/cdio.c b/usr.bin/cdio/cdio.c
index 3c98593ec53..167bf24806d 100644
--- a/usr.bin/cdio/cdio.c
+++ b/usr.bin/cdio/cdio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cdio.c,v 1.29 2003/04/06 20:50:05 krw Exp $ */
+/* $OpenBSD: cdio.c,v 1.30 2003/06/10 22:20:45 deraadt Exp $ */
/* Copyright (c) 1995 Serge V. Vakulenko
* All rights reserved.
@@ -178,7 +178,7 @@ char *strstatus(int);
int cdid(void);
void
-help()
+help(void)
{
struct cmdtab *c;
char *s, n;
@@ -204,7 +204,7 @@ help()
}
void
-usage()
+usage(void)
{
fprintf(stderr, "usage: %s [-sv] [-f device] [command args ...]\n",
__progname);
@@ -932,7 +932,7 @@ pstatus(char *arg)
}
int
-cdid()
+cdid(void)
{
unsigned long id;
struct ioc_toc_header h;
diff --git a/usr.bin/checknr/checknr.c b/usr.bin/checknr/checknr.c
index f20556dc867..55ea439326d 100644
--- a/usr.bin/checknr/checknr.c
+++ b/usr.bin/checknr/checknr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: checknr.c,v 1.9 2003/06/03 02:56:06 millert Exp $ */
+/* $OpenBSD: checknr.c,v 1.10 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: checknr.c,v 1.4 1995/03/26 04:10:19 glass Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)checknr.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: checknr.c,v 1.9 2003/06/03 02:56:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: checknr.c,v 1.10 2003/06/10 22:20:45 deraadt Exp $";
#endif
#endif /* not lint */
@@ -191,9 +191,7 @@ int slot; /* slot in knowncmds found by binsrch */
char *malloc();
int
-main(argc, argv)
-int argc;
-char **argv;
+main(int argc, char *argv[])
{
FILE *f;
int i;
@@ -272,7 +270,7 @@ char **argv;
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: checknr [-fs] [-a.x1.y1.x2.y2. ... .xn.yn] "
@@ -281,8 +279,7 @@ usage()
}
void
-process(f)
-FILE *f;
+process(FILE *f)
{
int i, n;
char mac[5]; /* The current macro or nroff command */
@@ -378,7 +375,7 @@ FILE *f;
}
void
-complain(i)
+complain(int i)
{
pe(stk[i].lno);
printf("Unmatched ");
@@ -387,8 +384,7 @@ complain(i)
}
void
-prop(i)
- int i;
+prop(int i)
{
if (stk[i].pl == 0)
printf(".%s", br[stk[i].opno].opbr);
@@ -406,9 +402,7 @@ prop(i)
}
void
-chkcmd(line, mac)
-char *line;
-char *mac;
+chkcmd(char *line, char *mac)
{
int i;
@@ -444,8 +438,7 @@ char *mac;
}
void
-nomatch(mac)
-char *mac;
+nomatch(char *mac)
{
int i, j;
@@ -490,16 +483,14 @@ char *mac;
/* eq: are two strings equal? */
int
-eq(s1, s2)
-char *s1, *s2;
+eq(char *s1, char *s2)
{
return (strcmp(s1, s2) == 0);
}
/* print the first part of an error message, given the line number */
void
-pe(lineno)
-int lineno;
+pe(int lineno)
{
if (nfiles > 1)
printf("%s: ", cfilename);
@@ -507,8 +498,7 @@ int lineno;
}
void
-checkknown(mac)
-char *mac;
+checkknown(char *mac)
{
if (eq(mac, "."))
@@ -526,8 +516,7 @@ char *mac;
* We have a .de xx line in "line". Add xx to the list of known commands.
*/
void
-addcmd(line)
-char *line;
+addcmd(char *line)
{
char *mac;
@@ -558,8 +547,7 @@ char *line;
* nroff programs, and the register loop below is pretty fast.
*/
void
-addmac(mac)
-char *mac;
+addmac(char *mac)
{
char **src, **dest, **loc;
@@ -590,8 +578,7 @@ printf("after: %s %s %s %s %s, %d cmds\n", knowncmds[slot-2], knowncmds[slot-1],
* If found, return the index. If not, return -1.
*/
int
-binsrch(mac)
-char *mac;
+binsrch(char *mac)
{
char *p; /* pointer to current cmd in list */
int d; /* difference if any */
diff --git a/usr.bin/cksum/cksum.c b/usr.bin/cksum/cksum.c
index 376db265981..3a9a558dfb1 100644
--- a/usr.bin/cksum/cksum.c
+++ b/usr.bin/cksum/cksum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cksum.c,v 1.10 2003/06/03 02:56:06 millert Exp $ */
+/* $OpenBSD: cksum.c,v 1.11 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: cksum.c,v 1.7 1995/09/02 05:45:18 jtc Exp $ */
/*-
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)cksum.c 8.2 (Berkeley) 4/28/95";
#endif
-static char rcsid[] = "$OpenBSD: cksum.c,v 1.10 2003/06/03 02:56:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: cksum.c,v 1.11 2003/06/10 22:20:45 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -64,9 +64,7 @@ void usage(void);
extern char *__progname;
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int ch, fd, rval;
u_int32_t len, val;
@@ -128,7 +126,7 @@ main(argc, argv)
}
void
-usage()
+usage(void)
{
if (!strcmp(__progname, "cksum"))
(void)fprintf(stderr, "usage: cksum [-o 1 | 2] [file ...]\n");
diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c
index a325a4b0bff..cb7ae3765b2 100644
--- a/usr.bin/cmp/cmp.c
+++ b/usr.bin/cmp/cmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmp.c,v 1.10 2003/06/03 02:56:06 millert Exp $ */
+/* $OpenBSD: cmp.c,v 1.11 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: cmp.c,v 1.7 1995/09/08 03:22:56 tls Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: cmp.c,v 1.10 2003/06/03 02:56:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: cmp.c,v 1.11 2003/06/10 22:20:45 deraadt Exp $";
#endif
#endif /* not lint */
@@ -62,9 +62,7 @@ int lflag, sflag;
static void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat sb1, sb2;
off_t skip1, skip2;
@@ -101,8 +99,7 @@ main(argc, argv)
special = 1;
fd1 = 0;
file1 = "stdin";
- }
- else if ((fd1 = open(file1, O_RDONLY, 0)) < 0) {
+ } else if ((fd1 = open(file1, O_RDONLY, 0)) < 0) {
if (sflag)
exit(ERR_EXIT);
else
@@ -119,8 +116,7 @@ main(argc, argv)
special = 1;
fd2 = 0;
file2 = "stdin";
- }
- else if ((fd2 = open(file2, O_RDONLY, 0)) < 0) {
+ } else if ((fd2 = open(file2, O_RDONLY, 0)) < 0) {
if (sflag)
exit(ERR_EXIT);
else
@@ -160,7 +156,7 @@ main(argc, argv)
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,
diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c
index c4553f965fa..3a022db0b26 100644
--- a/usr.bin/col/col.c
+++ b/usr.bin/col/col.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: col.c,v 1.8 2003/06/03 02:56:06 millert Exp $ */
+/* $OpenBSD: col.c,v 1.9 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: col.c,v 1.7 1995/09/02 05:48:50 jtc Exp $ */
/*-
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)col.c 8.5 (Berkeley) 5/4/95";
#endif
-static char rcsid[] = "$OpenBSD: col.c,v 1.8 2003/06/03 02:56:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: col.c,v 1.9 2003/06/10 22:20:45 deraadt Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -112,9 +112,7 @@ int no_backspaces; /* if not to output any backspaces */
err(1, "stdout");
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int ch;
CHAR *c;
@@ -320,8 +318,7 @@ main(argc, argv)
}
void
-flush_lines(nflush)
- int nflush;
+flush_lines(int nflush)
{
LINE *l;
@@ -347,7 +344,7 @@ flush_lines(nflush)
* feeds.
*/
void
-flush_blanks()
+flush_blanks(void)
{
int half, i, nb;
@@ -376,8 +373,7 @@ flush_blanks()
* and character set shifts.
*/
void
-flush_line(l)
- LINE *l;
+flush_line(LINE *l)
{
CHAR *c, *endc;
int nchars, last_col, this_col;
@@ -476,7 +472,7 @@ flush_line(l)
static LINE *line_freelist;
LINE *
-alloc_line()
+alloc_line(void)
{
LINE *l;
int i;
@@ -496,8 +492,7 @@ alloc_line()
}
void
-free_line(l)
- LINE *l;
+free_line(LINE *l)
{
l->l_next = line_freelist;
@@ -505,9 +500,7 @@ free_line(l)
}
void *
-xmalloc(p, size)
- void *p;
- size_t size;
+xmalloc(void *p, size_t size)
{
if (!(p = (void *)realloc(p, size)))
@@ -516,15 +509,14 @@ xmalloc(p, size)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: col [-bfhx] [-l num]\n");
exit(1);
}
void
-dowarn(line)
- int line;
+dowarn(int line)
{
warnx("warning: can't back up %s",
diff --git a/usr.bin/colcrt/colcrt.c b/usr.bin/colcrt/colcrt.c
index ad7bdb30e54..0b87f60b0b1 100644
--- a/usr.bin/colcrt/colcrt.c
+++ b/usr.bin/colcrt/colcrt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: colcrt.c,v 1.5 2003/06/03 02:56:07 millert Exp $ */
+/* $OpenBSD: colcrt.c,v 1.6 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: colcrt.c,v 1.3 1995/03/26 05:31:00 glass Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)colcrt.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: colcrt.c,v 1.5 2003/06/03 02:56:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: colcrt.c,v 1.6 2003/06/10 22:20:45 deraadt Exp $";
#endif
#endif /* not lint */
@@ -80,9 +80,7 @@ int plus(char, char);
void move(int, int);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int c;
char *cp, *dp;
@@ -194,8 +192,7 @@ main(argc, argv)
}
int
-plus(c, d)
- char c, d;
+plus(char c, char d)
{
return ((c == '|' && d == '-') || d == '_');
@@ -204,8 +201,7 @@ plus(c, d)
int first;
void
-pflush(ol)
- int ol;
+pflush(int ol)
{
int i;
char *cp;
@@ -239,8 +235,7 @@ pflush(ol)
}
void
-move(l, m)
- int l, m;
+move(int l, int m)
{
char *cp, *dp;
diff --git a/usr.bin/colrm/colrm.c b/usr.bin/colrm/colrm.c
index eb64238a95a..abc50882b3b 100644
--- a/usr.bin/colrm/colrm.c
+++ b/usr.bin/colrm/colrm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: colrm.c,v 1.7 2003/06/03 02:56:07 millert Exp $ */
+/* $OpenBSD: colrm.c,v 1.8 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: colrm.c,v 1.4 1995/09/02 05:51:37 jtc Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)colrm.c 8.2 (Berkeley) 5/4/95";
#endif
-static char rcsid[] = "$OpenBSD: colrm.c,v 1.7 2003/06/03 02:56:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: colrm.c,v 1.8 2003/06/10 22:20:45 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -59,9 +59,7 @@ void check(FILE *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
u_long column, start, stop;
int ch;
@@ -124,8 +122,7 @@ main(argc, argv)
}
void
-check(stream)
- FILE *stream;
+check(FILE *stream)
{
if (feof(stream))
exit(0);
@@ -134,7 +131,7 @@ check(stream)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: colrm [start [stop]]\n");
exit(1);
diff --git a/usr.bin/column/column.c b/usr.bin/column/column.c
index 416287bb2c2..af90ee2b37c 100644
--- a/usr.bin/column/column.c
+++ b/usr.bin/column/column.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: column.c,v 1.8 2003/06/03 02:56:07 millert Exp $ */
+/* $OpenBSD: column.c,v 1.9 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: column.c,v 1.4 1995/09/02 05:53:03 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)column.c 8.4 (Berkeley) 5/4/95";
#endif
-static char rcsid[] = "$OpenBSD: column.c,v 1.8 2003/06/03 02:56:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: column.c,v 1.9 2003/06/10 22:20:45 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -71,9 +71,7 @@ char **list; /* array of pointers to records */
char *separator = "\t "; /* field separator for table option */
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
struct winsize win;
FILE *fp;
@@ -135,7 +133,7 @@ main(argc, argv)
#define TAB 8
void
-c_columnate()
+c_columnate(void)
{
int chcnt, col, cnt, endcol, numcols;
char **lp;
@@ -164,7 +162,7 @@ c_columnate()
}
void
-r_columnate()
+r_columnate(void)
{
int base, chcnt, cnt, col, endcol, numcols, numrows, row;
@@ -193,7 +191,7 @@ r_columnate()
}
void
-print()
+print(void)
{
int cnt;
char **lp;
@@ -209,7 +207,7 @@ typedef struct _tbl {
#define DEFCOLS 25
void
-maketbl()
+maketbl(void)
{
TBL *t;
int coloff, cnt;
@@ -255,8 +253,7 @@ maketbl()
#define MAXLINELEN (LINE_MAX + 1)
void
-input(fp)
- FILE *fp;
+input(FILE *fp)
{
static int maxentry;
int len;
@@ -288,8 +285,7 @@ input(fp)
}
void *
-emalloc(size)
- int size;
+emalloc(int size)
{
char *p;
@@ -300,7 +296,7 @@ emalloc(size)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
diff --git a/usr.bin/comm/comm.c b/usr.bin/comm/comm.c
index 53389f7a8d5..7d2e71d10d8 100644
--- a/usr.bin/comm/comm.c
+++ b/usr.bin/comm/comm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: comm.c,v 1.6 2003/06/03 02:56:07 millert Exp $ */
+/* $OpenBSD: comm.c,v 1.7 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: comm.c,v 1.10 1995/09/05 19:57:43 jtc Exp $ */
/*
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)comm.c 8.4 (Berkeley) 5/4/95";
#endif
-static char rcsid[] = "$OpenBSD: comm.c,v 1.6 2003/06/03 02:56:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: comm.c,v 1.7 2003/06/10 22:20:45 deraadt Exp $";
#endif /* not lint */
#include <err.h>
@@ -63,9 +63,7 @@ void show(FILE *, char *, char *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int comp, file1done, file2done, read1, read2;
int ch, flag1, flag2, flag3;
@@ -166,17 +164,14 @@ main(argc, argv)
}
void
-show(fp, offset, buf)
- FILE *fp;
- char *offset, *buf;
+show(FILE *fp, char *offset, char *buf)
{
while (printf("%s%s", offset, buf) >= 0 && fgets(buf, MAXLINELEN, fp))
;
}
FILE *
-file(name)
- const char *name;
+file(const char *name)
{
FILE *fp;
@@ -188,7 +183,7 @@ file(name)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: comm [-123f] file1 file2\n");
exit(1);
diff --git a/usr.bin/compress/main.c b/usr.bin/compress/main.c
index b2c5fb45009..22fcc3dedd6 100644
--- a/usr.bin/compress/main.c
+++ b/usr.bin/compress/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.23 2003/06/04 04:55:58 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.24 2003/06/10 22:20:45 deraadt Exp $ */
static const char copyright[] =
"@(#) Copyright (c) 1992, 1993\n\
@@ -35,7 +35,7 @@ static const char license[] =
#if 0
static char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94";
#else
-static const char main_rcsid[] = "$OpenBSD: main.c,v 1.23 2003/06/04 04:55:58 deraadt Exp $";
+static const char main_rcsid[] = "$OpenBSD: main.c,v 1.24 2003/06/10 22:20:45 deraadt Exp $";
#endif
#endif /* not lint */
@@ -118,9 +118,7 @@ const struct option longopts[] = {
};
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
FTS *ftsp;
FTSENT *entry;
@@ -421,12 +419,8 @@ main(argc, argv)
}
int
-compress(in, out, method, bits, sb)
- const char *in;
- const char *out;
- const struct compressor *method;
- int bits;
- struct stat *sb;
+compress(const char *in, const char *out, const struct compressor *method,
+ int bits, struct stat *sb)
{
u_char buf[Z_BUFSIZE];
int error, ifd, ofd;
@@ -489,10 +483,7 @@ compress(in, out, method, bits, sb)
}
const struct compressor *
-check_method(fd, sb, out)
- int fd;
- struct stat *sb;
- const char *out;
+check_method(int fd, struct stat *sb, const char *out)
{
const struct compressor *method;
@@ -508,12 +499,8 @@ check_method(fd, sb, out)
}
int
-decompress(in, out, method, bits, sb)
- const char *in;
- const char *out;
- const struct compressor *method;
- int bits;
- struct stat *sb;
+decompress(const char *in, const char *out, const struct compressor *method,
+ int bits, struct stat *sb)
{
u_char buf[Z_BUFSIZE];
int error, ifd, ofd;
@@ -578,9 +565,7 @@ decompress(in, out, method, bits, sb)
}
void
-setfile(name, fs)
- const char *name;
- struct stat *fs;
+setfile(const char *name, struct stat *fs)
{
struct timeval tv[2];
@@ -610,8 +595,7 @@ setfile(name, fs)
}
int
-permission(fname)
- const char *fname;
+permission(const char *fname)
{
int ch, first;
@@ -625,7 +609,7 @@ permission(fname)
}
void
-usage()
+usage(void)
{
fprintf(stderr,
"usage: %s [-cdfghlnLOqrStvV] [-b <bits>] [-[0-9]] [file ...]\n",
diff --git a/usr.bin/ctags/ctags.c b/usr.bin/ctags/ctags.c
index 3263a09d0af..c586cbff2dd 100644
--- a/usr.bin/ctags/ctags.c
+++ b/usr.bin/ctags/ctags.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctags.c,v 1.9 2003/06/03 02:56:07 millert Exp $ */
+/* $OpenBSD: ctags.c,v 1.10 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: ctags.c,v 1.4 1995/09/02 05:57:23 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ctags.c 8.4 (Berkeley) 2/7/95";
#endif
-static char rcsid[] = "$OpenBSD: ctags.c,v 1.9 2003/06/03 02:56:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: ctags.c,v 1.10 2003/06/10 22:20:45 deraadt Exp $";
#endif /* not lint */
#include <err.h>
@@ -81,9 +81,7 @@ void init(void);
void find_entries(char *);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
static char *outfile = "tags"; /* output file */
int aflag; /* -a: append to tags */
@@ -194,7 +192,7 @@ usage: (void)fprintf(stderr,
* the string CWHITE, else NO.
*/
void
-init()
+init(void)
{
int i;
unsigned char *sp;
@@ -226,8 +224,7 @@ init()
* which searches the file.
*/
void
-find_entries(file)
- char *file;
+find_entries(char *file)
{
char *cp;
diff --git a/usr.bin/cut/cut.c b/usr.bin/cut/cut.c
index 8f0f681b1f9..ba5b63f1709 100644
--- a/usr.bin/cut/cut.c
+++ b/usr.bin/cut/cut.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cut.c,v 1.10 2003/06/03 02:56:07 millert Exp $ */
+/* $OpenBSD: cut.c,v 1.11 2003/06/10 22:20:45 deraadt Exp $ */
/* $NetBSD: cut.c,v 1.9 1995/09/02 05:59:23 jtc Exp $ */
/*
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)cut.c 8.3 (Berkeley) 5/4/95";
#endif
-static char rcsid[] = "$OpenBSD: cut.c,v 1.10 2003/06/03 02:56:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: cut.c,v 1.11 2003/06/10 22:20:45 deraadt Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -68,9 +68,7 @@ void get_list(char *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
FILE *fp;
void (*fcn)(FILE *, char *);
@@ -134,8 +132,7 @@ int autostart, autostop, maxval;
char positions[_POSIX2_LINE_MAX + 1];
void
-get_list(list)
- char *list;
+get_list(char *list)
{
int setautostart, start, stop;
char *pos;
@@ -193,9 +190,7 @@ get_list(list)
/* ARGSUSED */
void
-c_cut(fp, fname)
- FILE *fp;
- char *fname;
+c_cut(FILE *fp, char *fname)
{
int ch, col;
char *pos;
@@ -223,9 +218,7 @@ c_cut(fp, fname)
}
void
-f_cut(fp, fname)
- FILE *fp;
- char *fname;
+f_cut(FILE *fp, char *fname)
{
int ch, field, isdelim;
char *pos, *p, sep;
@@ -287,7 +280,7 @@ f_cut(fp, fname)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage:\tcut -c list [file1 ...]\n"
diff --git a/usr.bin/dirname/dirname.c b/usr.bin/dirname/dirname.c
index 2b4b71e3f31..a4b02678140 100644
--- a/usr.bin/dirname/dirname.c
+++ b/usr.bin/dirname/dirname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dirname.c,v 1.7 2003/06/03 01:52:41 millert Exp $ */
+/* $OpenBSD: dirname.c,v 1.8 2003/06/10 22:20:45 deraadt Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: dirname.c,v 1.7 2003/06/03 01:52:41 millert Exp $";
+static char rcsid[] = "$OpenBSD: dirname.c,v 1.8 2003/06/10 22:20:45 deraadt Exp $";
#endif /* not lint */
#include <err.h>
@@ -26,9 +26,7 @@ static char rcsid[] = "$OpenBSD: dirname.c,v 1.7 2003/06/03 01:52:41 millert Exp
#include <stdio.h>
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
char *dir;
extern char *__progname;
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
index f7d14bae37b..e1f1b374cb8 100644
--- a/usr.bin/du/du.c
+++ b/usr.bin/du/du.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: du.c,v 1.12 2003/06/03 02:56:07 millert Exp $ */
+/* $OpenBSD: du.c,v 1.13 2003/06/10 22:20:46 deraadt Exp $ */
/* $NetBSD: du.c,v 1.11 1996/10/18 07:20:35 thorpej Exp $ */
/*
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)du.c 8.5 (Berkeley) 5/4/95";
#else
-static char rcsid[] = "$OpenBSD: du.c,v 1.12 2003/06/03 02:56:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: du.c,v 1.13 2003/06/10 22:20:46 deraadt Exp $";
#endif
#endif /* not lint */
@@ -65,9 +65,7 @@ void prtout(quad_t, char *, int);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
FTS *fts;
FTSENT *p;
@@ -224,8 +222,7 @@ typedef struct _ID {
} ID;
int
-linkchk(p)
- FTSENT *p;
+linkchk(FTSENT *p)
{
static ID *files;
static int maxfiles, nfiles;
@@ -257,8 +254,7 @@ linkchk(p)
typedef enum { NONE = 0, KILO, MEGA, GIGA, TERA, PETA /* , EXA */ } unit_t;
unit_t
-unit_adjust(val)
- double *val;
+unit_adjust(double *val)
{
double abval;
unit_t unit;
@@ -286,10 +282,7 @@ unit_adjust(val)
}
void
-prtout(size, path, hflag)
- quad_t size;
- char *path;
- int hflag;
+prtout(quad_t size, char *path, int hflag)
{
unit_t unit;
double bytes;
@@ -310,7 +303,7 @@ prtout(size, path, hflag)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
diff --git a/usr.bin/elf2aout/elf2aout.c b/usr.bin/elf2aout/elf2aout.c
index a155a3b2202..a784735d721 100644
--- a/usr.bin/elf2aout/elf2aout.c
+++ b/usr.bin/elf2aout/elf2aout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: elf2aout.c,v 1.2 2001/01/29 01:57:56 niklas Exp $ */
+/* $OpenBSD: elf2aout.c,v 1.3 2003/06/10 22:20:46 deraadt Exp $ */
/*
* Copyright (c) 1995
@@ -41,476 +41,458 @@
#define SHN_MIPS_ACOMMON 0xfff0
-extern char *__progname;
+extern char *__progname;
struct sect {
- unsigned long vaddr;
- unsigned long len;
+ unsigned long vaddr;
+ unsigned long len;
};
-int phcmp ();
-char *saveRead (int file, off_t offset, off_t len, char *name);
-int copy (int, int, off_t, off_t);
-int translate_syms (int, int, off_t, off_t, off_t, off_t);
-extern int errno;
-int *symTypeTable;
+int phcmp();
+char *saveRead(int file, off_t offset, off_t len, char *name);
+int copy(int, int, off_t, off_t);
+int translate_syms(int, int, off_t, off_t, off_t, off_t);
+extern int errno;
+int *symTypeTable;
/* Symbol table entry... */
struct sym {
- unsigned long name; /* Index into strtab of symbol name. */
- unsigned long value; /* Section offset, virt addr or common align. */
- unsigned long size; /* Size of object referenced. */
- unsigned type : 4; /* Symbol type (e.g., function, data)... */
- unsigned binding : 4; /* Symbol binding (e.g., global, local)... */
- unsigned char other; /* Unused. */
- unsigned short shndx; /* Section containing symbol. */
+ unsigned long name; /* Index into strtab of symbol name. */
+ unsigned long value; /* Section offset, virt addr or common align. */
+ unsigned long size; /* Size of object referenced. */
+ unsigned type:4; /* Symbol type (e.g., function, data)... */
+ unsigned binding:4; /* Symbol binding (e.g., global,
+ * local)... */
+ unsigned char other; /* Unused. */
+ unsigned short shndx; /* Section containing symbol. */
};
struct phdr {
- unsigned long type; /* Segment type... */
- unsigned long offset; /* File offset... */
- unsigned long vaddr; /* Virtual address... */
- unsigned long paddr; /* Physical address... */
- unsigned long filesz; /* Size of segment in file... */
- unsigned long memsz; /* Size of segment in memory... */
- unsigned long flags; /* Segment flags... */
- unsigned long align; /* Alighment, file and memory... */
+ unsigned long type; /* Segment type... */
+ unsigned long offset; /* File offset... */
+ unsigned long vaddr; /* Virtual address... */
+ unsigned long paddr; /* Physical address... */
+ unsigned long filesz; /* Size of segment in file... */
+ unsigned long memsz; /* Size of segment in memory... */
+ unsigned long flags; /* Segment flags... */
+ unsigned long align; /* Alighment, file and memory... */
};
-main (int argc, char **argv, char **envp)
+int
+main(int argc, char *argv[])
{
- Elf32_Ehdr ex;
- Elf32_Phdr *ph;
- Elf32_Shdr *sh;
- struct sym *symtab;
- char *shstrtab;
- int strtabix, symtabix;
- int i;
- struct sect text, data, bss;
- struct exec aex;
- int infile, outfile;
- unsigned long cur_vma = ULONG_MAX;
- int symflag = 0;
-
- text.len = data.len = bss.len = 0;
- text.vaddr = data.vaddr = bss.vaddr = 0;
-
- /* Check args... */
- if (argc < 3 || argc > 4)
- {
- usage:
- fprintf (stderr,
- "usage: %s <elf executable> <a.out executable>\n", __progname);
- exit (1);
- }
-
- /* Try the input file... */
- if ((infile = open (argv [1], O_RDONLY)) < 0)
- {
- fprintf (stderr, "Can't open %s for read: %s\n",
- argv [1], strerror (errno));
- exit (1);
- }
-
- /* Read the header, which is at the beginning of the file... */
- i = read (infile, &ex, sizeof ex);
- if (i != sizeof ex)
- {
- fprintf (stderr, "ex: %s: %s.\n",
- argv [1], i ? strerror (errno) : "End of file reached");
- exit (1);
- }
-
- /* Read the program headers... */
- ph = (Elf32_Phdr *)saveRead (infile, ex.e_phoff,
- ex.e_phnum * sizeof (Elf32_Phdr), "ph");
- /* Read the section headers... */
- sh = (Elf32_Shdr *)saveRead (infile, ex.e_shoff,
- ex.e_shnum * sizeof (Elf32_Shdr), "sh");
- /* Read in the section string table. */
- shstrtab = saveRead (infile, sh [ex.e_shstrndx].sh_offset,
- sh [ex.e_shstrndx].sh_size, "shstrtab");
-
- /* Find space for a table matching ELF section indices to a.out symbol
- types. */
- symTypeTable = (int *)malloc (ex.e_shnum * sizeof (int));
- if (!symTypeTable)
- {
- fprintf (stderr, "symTypeTable: can't allocate.\n");
- exit (1);
- }
- memset (symTypeTable, 0, ex.e_shnum * sizeof (int));
-
- /* Look for the symbol table and string table...
- Also map section indices to symbol types for a.out */
- for (i = 0; i < ex.e_shnum; i++)
- {
- char *name = shstrtab + sh [i].sh_name;
- if (!strcmp (name, ".symtab"))
- symtabix = i;
- else if (!strcmp (name, ".strtab"))
- strtabix = i;
- else if (!strcmp (name, ".text") || !strcmp (name, ".rodata"))
- symTypeTable [i] = N_TEXT;
- else if (!strcmp (name, ".data") || !strcmp (name, ".sdata") ||
- !strcmp (name, ".lit4") || !strcmp (name, ".lit8"))
- symTypeTable [i] = N_DATA;
- else if (!strcmp (name, ".bss") || !strcmp (name, ".sbss"))
- symTypeTable [i] = N_BSS;
- }
-
- /* Figure out if we can cram the program header into an a.out header...
- Basically, we can't handle anything but loadable segments, but we
- can ignore some kinds of segments. We can't handle holes in the
- address space, and we handle start addresses other than 0x1000 by
- hoping that the loader will know where to load - a.out doesn't have
- an explicit load address. Segments may be out of order, so we
- sort them first. */
- qsort (ph, ex.e_phnum, sizeof (Elf32_Phdr), phcmp);
- for (i = 0; i < ex.e_phnum; i++)
- {
- /* Section types we can ignore... */
- if (ph [i].p_type == PT_NULL || ph [i].p_type == PT_NOTE ||
- ph [i].p_type == PT_PHDR || ph [i].p_type == PT_MIPS_REGINFO)
- continue;
- /* Section types we can't handle... */
- else if (ph [i].p_type != PT_LOAD)
- {
- fprintf (stderr, "Program header %d type %d can't be converted.\n");
- exit (1);
+ Elf32_Ehdr ex;
+ Elf32_Phdr *ph;
+ Elf32_Shdr *sh;
+ struct sym *symtab;
+ char *shstrtab;
+ int strtabix, symtabix;
+ int i;
+ struct sect text, data, bss;
+ struct exec aex;
+ int infile, outfile;
+ unsigned long cur_vma = ULONG_MAX;
+ int symflag = 0;
+
+ text.len = data.len = bss.len = 0;
+ text.vaddr = data.vaddr = bss.vaddr = 0;
+
+ /* Check args... */
+ if (argc < 3 || argc > 4) {
+usage:
+ fprintf(stderr,
+ "usage: %s elf a.out\n", __progname);
+ exit(1);
}
- /* Writable (data) segment? */
- if (ph [i].p_flags & PF_W)
- {
- struct sect ndata, nbss;
-
- ndata.vaddr = ph [i].p_vaddr;
- ndata.len = ph [i].p_filesz;
- nbss.vaddr = ph [i].p_vaddr + ph [i].p_filesz;
- nbss.len = ph [i].p_memsz - ph [i].p_filesz;
-
- combine (&data, &ndata, 0);
- combine (&bss, &nbss, 1);
+ /* Try the input file... */
+ if ((infile = open(argv[1], O_RDONLY)) < 0) {
+ fprintf(stderr, "Can't open %s for read: %s\n",
+ argv[1], strerror(errno));
+ exit(1);
+ }
+ /* Read the header, which is at the beginning of the file... */
+ i = read(infile, &ex, sizeof ex);
+ if (i != sizeof ex) {
+ fprintf(stderr, "ex: %s: %s.\n",
+ argv[1], i ? strerror(errno) : "End of file reached");
+ exit(1);
+ }
+ /* Read the program headers... */
+ ph = (Elf32_Phdr *) saveRead(infile, ex.e_phoff,
+ ex.e_phnum * sizeof(Elf32_Phdr), "ph");
+ /* Read the section headers... */
+ sh = (Elf32_Shdr *) saveRead(infile, ex.e_shoff,
+ ex.e_shnum * sizeof(Elf32_Shdr), "sh");
+ /* Read in the section string table. */
+ shstrtab = saveRead(infile, sh[ex.e_shstrndx].sh_offset,
+ sh[ex.e_shstrndx].sh_size, "shstrtab");
+
+ /*
+ * Find space for a table matching ELF section indices to a.out
+ * symbol types.
+ */
+ symTypeTable = (int *) malloc(ex.e_shnum * sizeof(int));
+ if (!symTypeTable) {
+ fprintf(stderr, "symTypeTable: can't allocate.\n");
+ exit(1);
+ }
+ memset(symTypeTable, 0, ex.e_shnum * sizeof(int));
+
+ /*
+ * Look for the symbol table and string table... Also map section
+ * indices to symbol types for a.out
+ */
+ for (i = 0; i < ex.e_shnum; i++) {
+ char *name = shstrtab + sh[i].sh_name;
+ if (!strcmp(name, ".symtab"))
+ symtabix = i;
+ else if (!strcmp(name, ".strtab"))
+ strtabix = i;
+ else if (!strcmp(name, ".text") || !strcmp(name, ".rodata"))
+ symTypeTable[i] = N_TEXT;
+ else if (!strcmp(name, ".data") || !strcmp(name, ".sdata") ||
+ !strcmp(name, ".lit4") || !strcmp(name, ".lit8"))
+ symTypeTable[i] = N_DATA;
+ else if (!strcmp(name, ".bss") || !strcmp(name, ".sbss"))
+ symTypeTable[i] = N_BSS;
}
- else
- {
- struct sect ntxt;
- ntxt.vaddr = ph [i].p_vaddr;
- ntxt.len = ph [i].p_filesz;
+ /*
+ * Figure out if we can cram the program header into an a.out
+ * header... Basically, we can't handle anything but loadable
+ * segments, but we can ignore some kinds of segments. We can't
+ * handle holes in the address space, and we handle start addresses
+ * other than 0x1000 by hoping that the loader will know where to
+ * load - a.out doesn't have an explicit load address. Segments may
+ * be out of order, so we sort them first.
+ */
+ qsort(ph, ex.e_phnum, sizeof(Elf32_Phdr), phcmp);
+ for (i = 0; i < ex.e_phnum; i++) {
+ /* Section types we can ignore... */
+ if (ph[i].p_type == PT_NULL || ph[i].p_type == PT_NOTE ||
+ ph[i].p_type == PT_PHDR || ph[i].p_type == PT_MIPS_REGINFO)
+ continue;
+ /* Section types we can't handle... */
+ else if (ph[i].p_type != PT_LOAD) {
+ fprintf(stderr,
+ "Program header %d type %d can't be converted.\n");
+ exit(1);
+ }
+ /* Writable (data) segment? */
+ if (ph[i].p_flags & PF_W) {
+ struct sect ndata, nbss;
- combine (&text, &ntxt);
- }
- /* Remember the lowest segment start address. */
- if (ph [i].p_vaddr < cur_vma)
- cur_vma = ph [i].p_vaddr;
- }
-
- /* Sections must be in order to be converted... */
- if (text.vaddr > data.vaddr || data.vaddr > bss.vaddr ||
- text.vaddr + text.len > data.vaddr || data.vaddr + data.len > bss.vaddr)
- {
- fprintf (stderr, "Sections ordering prevents a.out conversion.\n");
- exit (1);
- }
-
- /* If there's a data section but no text section, then the loader
- combined everything into one section. That needs to be the
- text section, so just make the data section zero length following
- text. */
- if (data.len && !text.len)
- {
- text = data;
- data.vaddr = text.vaddr + text.len;
- data.len = 0;
- }
-
- /* If there is a gap between text and data, we'll fill it when we copy
- the data, so update the length of the text segment as represented in
- a.out to reflect that, since a.out doesn't allow gaps in the program
- address space. */
- if (text.vaddr + text.len < data.vaddr)
- text.len = data.vaddr - text.vaddr;
-
- /* We now have enough information to cons up an a.out header... */
- aex.a_midmag = htonl ((symflag << 26) | (MID_PMAX << 16) | OMAGIC);
- aex.a_text = text.len;
- aex.a_data = data.len;
- aex.a_bss = bss.len;
- aex.a_entry = ex.e_entry;
- aex.a_syms = (sizeof (struct nlist) *
- (symtabix != -1
- ? sh [symtabix].sh_size / sizeof (struct sym) : 0));
- aex.a_trsize = 0;
- aex.a_drsize = 0;
-
- /* Make the output file... */
- if ((outfile = open (argv [2], O_WRONLY | O_CREAT, 0777)) < 0)
- {
- fprintf (stderr, "Unable to create %s: %s\n", argv [2], strerror (errno));
- exit (1);
- }
- /* Write the header... */
- i = write (outfile, &aex, sizeof aex);
- if (i != sizeof aex)
- {
- perror ("aex: write");
- exit (1);
- }
-
- /* Copy the loadable sections. Zero-fill any gaps less than 64k;
- complain about any zero-filling, and die if we're asked to zero-fill
- more than 64k. */
- for (i = 0; i < ex.e_phnum; i++)
- {
- /* Unprocessable sections were handled above, so just verify that
- the section can be loaded before copying. */
- if (ph [i].p_type == PT_LOAD && ph [i].p_filesz)
- {
- if (cur_vma != ph [i].p_vaddr)
- {
- unsigned long gap = ph [i].p_vaddr - cur_vma;
- char obuf [1024];
- if (gap > 65536)
- {
- fprintf (stderr, "Intersegment gap (%d bytes) too large.\n",
- gap);
- exit (1);
+ ndata.vaddr = ph[i].p_vaddr;
+ ndata.len = ph[i].p_filesz;
+ nbss.vaddr = ph[i].p_vaddr + ph[i].p_filesz;
+ nbss.len = ph[i].p_memsz - ph[i].p_filesz;
+
+ combine(&data, &ndata, 0);
+ combine(&bss, &nbss, 1);
+ } else {
+ struct sect ntxt;
+
+ ntxt.vaddr = ph[i].p_vaddr;
+ ntxt.len = ph[i].p_filesz;
+
+ combine(&text, &ntxt);
}
- fprintf (stderr, "Warning: %d byte intersegment gap.\n", gap);
- memset (obuf, 0, sizeof obuf);
- while (gap)
- {
- int count = write (outfile, obuf, (gap > sizeof obuf
- ? sizeof obuf : gap));
- if (count < 0)
- {
- fprintf (stderr, "Error writing gap: %s\n",
- strerror (errno));
- exit (1);
- }
- gap -= count;
+ /* Remember the lowest segment start address. */
+ if (ph[i].p_vaddr < cur_vma)
+ cur_vma = ph[i].p_vaddr;
+ }
+
+ /* Sections must be in order to be converted... */
+ if (text.vaddr > data.vaddr || data.vaddr > bss.vaddr ||
+ text.vaddr + text.len > data.vaddr || data.vaddr + data.len > bss.vaddr) {
+ fprintf(stderr, "Sections ordering prevents a.out conversion.\n");
+ exit(1);
+ }
+ /*
+ * If there's a data section but no text section, then the loader
+ * combined everything into one section. That needs to be the text
+ * section, so just make the data section zero length following text.
+ */
+ if (data.len && !text.len) {
+ text = data;
+ data.vaddr = text.vaddr + text.len;
+ data.len = 0;
+ }
+ /*
+ * If there is a gap between text and data, we'll fill it when we
+ * copy the data, so update the length of the text segment as
+ * represented in a.out to reflect that, since a.out doesn't allow
+ * gaps in the program address space.
+ */
+ if (text.vaddr + text.len < data.vaddr)
+ text.len = data.vaddr - text.vaddr;
+
+ /* We now have enough information to cons up an a.out header... */
+ aex.a_midmag = htonl((symflag << 26) | (MID_PMAX << 16) | OMAGIC);
+ aex.a_text = text.len;
+ aex.a_data = data.len;
+ aex.a_bss = bss.len;
+ aex.a_entry = ex.e_entry;
+ aex.a_syms = (sizeof(struct nlist) *
+ (symtabix != -1
+ ? sh[symtabix].sh_size / sizeof(struct sym) : 0));
+ aex.a_trsize = 0;
+ aex.a_drsize = 0;
+
+ /* Make the output file... */
+ if ((outfile = open(argv[2], O_WRONLY | O_CREAT, 0777)) < 0) {
+ fprintf(stderr, "Unable to create %s: %s\n", argv[2], strerror(errno));
+ exit(1);
+ }
+ /* Write the header... */
+ i = write(outfile, &aex, sizeof aex);
+ if (i != sizeof aex) {
+ perror("aex: write");
+ exit(1);
+ }
+ /*
+ * Copy the loadable sections. Zero-fill any gaps less than 64k;
+ * complain about any zero-filling, and die if we're asked to
+ * zero-fill more than 64k.
+ */
+ for (i = 0; i < ex.e_phnum; i++) {
+ /*
+ * Unprocessable sections were handled above, so just verify
+ * that the section can be loaded before copying.
+ */
+ if (ph[i].p_type == PT_LOAD && ph[i].p_filesz) {
+ if (cur_vma != ph[i].p_vaddr) {
+ unsigned long gap = ph[i].p_vaddr - cur_vma;
+ char obuf[1024];
+
+ if (gap > 65536) {
+ fprintf(stderr,
+ "Intersegment gap (%d bytes) too large.\n",
+ gap);
+ exit(1);
+ }
+ fprintf(stderr,
+ "Warning: %d byte intersegment gap.\n", gap);
+ memset(obuf, 0, sizeof obuf);
+ while (gap) {
+ int count = write(outfile, obuf,
+ (gap > sizeof obuf ? sizeof obuf : gap));
+ if (count < 0) {
+ fprintf(stderr,
+ "Error writing gap: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+ gap -= count;
+ }
+ }
+ copy(outfile, infile, ph[i].p_offset, ph[i].p_filesz);
+ cur_vma = ph[i].p_vaddr + ph[i].p_filesz;
}
- }
- copy (outfile, infile, ph [i].p_offset, ph [i].p_filesz);
- cur_vma = ph [i].p_vaddr + ph [i].p_filesz;
}
- }
- /* Copy and translate the symbol table... */
- translate_syms (outfile, infile, sh [symtabix].sh_offset,
- sh [symtabix].sh_size,
- sh [strtabix].sh_offset, sh [strtabix].sh_size);
+ /* Copy and translate the symbol table... */
+ translate_syms(outfile, infile, sh[symtabix].sh_offset,
+ sh[symtabix].sh_size,
+ sh[strtabix].sh_offset, sh[strtabix].sh_size);
- /* Looks like we won... */
- exit (0);
+ /* Looks like we won... */
+ exit(0);
}
-/* translate_syms (out, in, offset, size)
-
- Read the ELF symbol table from in at offset; translate it into a.out
- nlist format and write it to out. */
+/*
+ * translate_syms (out, in, offset, size)
+ *
+ * Read the ELF symbol table from in at offset; translate it into a.out nlist
+ * format and write it to out.
+ */
-translate_syms (out, in, symoff, symsize, stroff, strsize)
- int out, in;
- off_t symoff, symsize;
- off_t stroff, strsize;
+translate_syms(int out, int in, off_t symoff, off_t symsize, off_t stroff,
+ off_t strsize)
{
-# define SYMS_PER_PASS 64
- struct sym inbuf [64];
- struct nlist outbuf [64];
- int i, remaining, cur;
- char *oldstrings;
- char *newstrings, *nsp;
- int newstringsize;
-
- /* Zero the unused fields in the output buffer.. */
- memset (outbuf, 0, sizeof outbuf);
-
- /* Find number of symbols to process... */
- remaining = symsize / sizeof (struct sym);
-
- /* Suck in the old string table... */
- oldstrings = saveRead (in, stroff, strsize, "string table");
-
- /* Allocate space for the new one. XXX We make the wild assumption that
- no two symbol table entries will point at the same place in the
- string table - if that assumption is bad, this could easily blow up. */
- newstringsize = strsize + remaining;
- newstrings = (char *)malloc (newstringsize);
- if (!newstrings)
- {
- fprintf (stderr, "No memory for new string table!\n");
- exit (1);
- }
- /* Initialize the table pointer... */
- nsp = newstrings;
-
- /* Go the the start of the ELF symbol table... */
- if (lseek (in, symoff, SEEK_SET) < 0)
- {
- perror ("translate_syms: lseek");
- exit (1);
- }
-
- /* Translate and copy symbols... */
- while (remaining)
- {
- cur = remaining;
- if (cur > SYMS_PER_PASS)
- cur = SYMS_PER_PASS;
- remaining -= cur;
- if ((i = read (in, inbuf, cur * sizeof (struct sym)))
- != cur * sizeof (struct sym))
- {
- if (i < 0)
- perror ("translate_syms");
- else
- fprintf (stderr, "translate_syms: premature end of file.\n");
- exit (1);
+#define SYMS_PER_PASS 64
+ struct sym inbuf[64];
+ struct nlist outbuf[64];
+ int i, remaining, cur;
+ char *oldstrings;
+ char *newstrings, *nsp;
+ int newstringsize;
+
+ /* Zero the unused fields in the output buffer.. */
+ memset(outbuf, 0, sizeof outbuf);
+
+ /* Find number of symbols to process... */
+ remaining = symsize / sizeof(struct sym);
+
+ /* Suck in the old string table... */
+ oldstrings = saveRead(in, stroff, strsize, "string table");
+
+ /*
+ * Allocate space for the new one. XXX We make the wild assumption
+ * that no two symbol table entries will point at the same place in
+ * the string table - if that assumption is bad, this could easily
+ * blow up.
+ */
+ newstringsize = strsize + remaining;
+ newstrings = (char *) malloc(newstringsize);
+ if (!newstrings) {
+ fprintf(stderr, "No memory for new string table!\n");
+ exit(1);
}
+ /* Initialize the table pointer... */
+ nsp = newstrings;
- /* Do the translation... */
- for (i = 0; i < cur; i++)
- {
- /* Copy the symbol into the new table, but prepend an underscore. */
- *nsp = '_';
- strcpy (nsp + 1, oldstrings + inbuf [i].name);
- outbuf [i].n_un.n_strx = nsp - newstrings + 4;
- nsp += strlen (nsp) + 1;
-
- /* Convert ELF symbol type/section/etc info into a.out type info. */
- if (inbuf [i].type == STT_FILE)
- outbuf [i].n_type = N_FN;
- else if (inbuf [i].shndx == SHN_UNDEF)
- outbuf [i].n_type = N_UNDF;
- else if (inbuf [i].shndx == SHN_ABS)
- outbuf [i].n_type = N_ABS;
- else if (inbuf [i].shndx == SHN_COMMON ||
- inbuf [i].shndx == SHN_MIPS_ACOMMON)
- outbuf [i].n_type = N_COMM;
- else
- outbuf [i].n_type = symTypeTable [inbuf [i].shndx];
- if (inbuf [i].binding == STB_GLOBAL)
- outbuf [i].n_type |= N_EXT;
- /* Symbol values in executables should be compatible. */
- outbuf [i].n_value = inbuf [i].value;
+ /* Go the the start of the ELF symbol table... */
+ if (lseek(in, symoff, SEEK_SET) < 0) {
+ perror("translate_syms: lseek");
+ exit(1);
}
- /* Write out the symbols... */
- if ((i = write (out, outbuf, cur * sizeof (struct nlist)))
- != cur * sizeof (struct nlist))
- {
- fprintf (stderr, "translate_syms: write: %s\n", strerror (errno));
- exit (1);
+ /* Translate and copy symbols... */
+ while (remaining) {
+ cur = remaining;
+ if (cur > SYMS_PER_PASS)
+ cur = SYMS_PER_PASS;
+ remaining -= cur;
+ if ((i = read(in, inbuf, cur * sizeof(struct sym)))
+ != cur * sizeof(struct sym)) {
+ if (i < 0)
+ perror("translate_syms");
+ else
+ fprintf(stderr,
+ "translate_syms: premature end of file.\n");
+ exit(1);
+ }
+ /* Do the translation... */
+ for (i = 0; i < cur; i++) {
+ /*
+ * Copy the symbol into the new table, but prepend an
+ * underscore.
+ */
+ *nsp = '_';
+ strcpy(nsp + 1, oldstrings + inbuf[i].name);
+ outbuf[i].n_un.n_strx = nsp - newstrings + 4;
+ nsp += strlen(nsp) + 1;
+
+ /*
+ * Convert ELF symbol type/section/etc info into
+ * a.out type info.
+ */
+ if (inbuf[i].type == STT_FILE)
+ outbuf[i].n_type = N_FN;
+ else if (inbuf[i].shndx == SHN_UNDEF)
+ outbuf[i].n_type = N_UNDF;
+ else if (inbuf[i].shndx == SHN_ABS)
+ outbuf[i].n_type = N_ABS;
+ else if (inbuf[i].shndx == SHN_COMMON ||
+ inbuf[i].shndx == SHN_MIPS_ACOMMON)
+ outbuf[i].n_type = N_COMM;
+ else
+ outbuf[i].n_type = symTypeTable[inbuf[i].shndx];
+ if (inbuf[i].binding == STB_GLOBAL)
+ outbuf[i].n_type |= N_EXT;
+ /* Symbol values in executables should be compatible. */
+ outbuf[i].n_value = inbuf[i].value;
+ }
+ /* Write out the symbols... */
+ if ((i = write(out, outbuf, cur * sizeof(struct nlist)))
+ != cur * sizeof(struct nlist)) {
+ fprintf(stderr, "translate_syms: write: %s\n", strerror(errno));
+ exit(1);
+ }
+ }
+ /* Write out the string table length... */
+ if (write(out, &newstringsize, sizeof newstringsize)
+ != sizeof newstringsize) {
+ fprintf(stderr,
+ "translate_syms: newstringsize: %s\n", strerror(errno));
+ exit(1);
+ }
+ /* Write out the string table... */
+ if (write(out, newstrings, newstringsize) != newstringsize) {
+ fprintf(stderr, "translate_syms: newstrings: %s\n", strerror(errno));
+ exit(1);
}
- }
- /* Write out the string table length... */
- if (write (out, &newstringsize, sizeof newstringsize)
- != sizeof newstringsize)
- {
- fprintf (stderr,
- "translate_syms: newstringsize: %s\n", strerror (errno));
- exit (1);
- }
- /* Write out the string table... */
- if (write (out, newstrings, newstringsize) != newstringsize)
- {
- fprintf (stderr, "translate_syms: newstrings: %s\n", strerror (errno));
- exit (1);
- }
}
-
-copy (out, in, offset, size)
- int out, in;
- off_t offset, size;
+
+copy(int out, int in, off_t offset, off_t size)
{
- char ibuf [4096];
- int remaining, cur, count;
-
- /* Go the the start of the ELF symbol table... */
- if (lseek (in, offset, SEEK_SET) < 0)
- {
- perror ("copy: lseek");
- exit (1);
- }
-
- remaining = size;
- while (remaining)
- {
- cur = remaining;
- if (cur > sizeof ibuf)
- cur = sizeof ibuf;
- remaining -= cur;
- if ((count = read (in, ibuf, cur)) != cur)
- {
- fprintf (stderr, "copy: read: %s\n",
- count ? strerror (errno) : "premature end of file");
- exit (1);
+ char ibuf[4096];
+ int remaining, cur, count;
+
+ /* Go the the start of the ELF symbol table... */
+ if (lseek(in, offset, SEEK_SET) < 0) {
+ perror("copy: lseek");
+ exit(1);
}
- if ((count = write (out, ibuf, cur)) != cur)
- {
- perror ("copy: write");
- exit (1);
+ remaining = size;
+ while (remaining) {
+ cur = remaining;
+ if (cur > sizeof ibuf)
+ cur = sizeof ibuf;
+ remaining -= cur;
+ if ((count = read(in, ibuf, cur)) != cur) {
+ fprintf(stderr, "copy: read: %s\n",
+ count ? strerror(errno) : "premature end of file");
+ exit(1);
+ }
+ if ((count = write(out, ibuf, cur)) != cur) {
+ perror("copy: write");
+ exit(1);
+ }
}
- }
}
-/* Combine two segments, which must be contiguous. If pad is true, it's
- okay for there to be padding between. */
-combine (base, new, pad)
- struct sect *base, *new;
- int pad;
+/*
+ * Combine two segments, which must be contiguous. If pad is true, it's
+ * okay for there to be padding between.
+ */
+combine(struct sect * base, struct sect * new, int pad)
{
- if (!base -> len)
- *base = *new;
- else if (new -> len)
- {
- if (base -> vaddr + base -> len != new -> vaddr)
- {
- if (pad)
- base -> len = new -> vaddr - base -> vaddr;
- else
- {
- fprintf (stderr,
- "Non-contiguous data can't be converted.\n");
- exit (1);
- }
+ if (!base->len)
+ *base = *new;
+ else if (new->len) {
+ if (base->vaddr + base->len != new->vaddr) {
+ if (pad)
+ base->len = new->vaddr - base->vaddr;
+ else {
+ fprintf(stderr,
+ "Non-contiguous data can't be converted.\n");
+ exit(1);
+ }
+ }
+ base->len += new->len;
}
- base -> len += new -> len;
- }
}
-phcmp (h1, h2)
- struct phdr *h1, *h2;
+phcmp(struct phdr * h1, struct phdr * h2)
{
- if (h1 -> vaddr > h2 -> vaddr)
- return 1;
- else if (h1 -> vaddr < h2 -> vaddr)
- return -1;
- else
- return 0;
+ if (h1->vaddr > h2->vaddr)
+ return 1;
+ else if (h1->vaddr < h2->vaddr)
+ return -1;
+ else
+ return 0;
}
-char *saveRead (int file, off_t offset, off_t len, char *name)
+char *
+saveRead(int file, off_t offset, off_t len, char *name)
{
- char *tmp;
- int count;
- off_t off;
- if ((off = lseek (file, offset, SEEK_SET)) < 0)
- {
- fprintf (stderr, "%s: fseek: %s\n", name, strerror (errno));
- exit (1);
- }
- if (!(tmp = (char *)malloc (len)))
- {
- fprintf (stderr, "%s: Can't allocate %d bytes.\n", name, len);
- exit (1);
- }
- count = read (file, tmp, len);
- if (count != len)
- {
- fprintf (stderr, "%s: read: %s.\n",
- name, count ? strerror (errno) : "End of file reached");
- exit (1);
- }
- return tmp;
+ char *tmp;
+ int count;
+ off_t off;
+
+ if ((off = lseek(file, offset, SEEK_SET)) < 0) {
+ fprintf(stderr, "%s: fseek: %s\n", name, strerror(errno));
+ exit(1);
+ }
+ if (!(tmp = (char *) malloc(len))) {
+ fprintf(stderr, "%s: Can't allocate %d bytes.\n", name, len);
+ exit(1);
+ }
+ count = read(file, tmp, len);
+ if (count != len) {
+ fprintf(stderr, "%s: read: %s.\n",
+ name, count ? strerror(errno) : "End of file reached");
+ exit(1);
+ }
+ return tmp;
}
diff --git a/usr.bin/elf2ecoff/elf2ecoff.c b/usr.bin/elf2ecoff/elf2ecoff.c
index c4d5163d3be..3996c9617f8 100644
--- a/usr.bin/elf2ecoff/elf2ecoff.c
+++ b/usr.bin/elf2ecoff/elf2ecoff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: elf2ecoff.c,v 1.3 2003/04/15 08:33:34 deraadt Exp $ */
+/* $OpenBSD: elf2ecoff.c,v 1.4 2003/06/10 22:20:46 deraadt Exp $ */
/* $NetBSD: elf2ecoff.c,v 1.8 1997/07/20 03:50:54 jonathan Exp $ */
/*
@@ -282,11 +282,13 @@ usage:
unsigned long gap = ph[i].p_vaddr - cur_vma;
char obuf[1024];
if (gap > 65536) {
- fprintf(stderr, "Intersegment gap (%d bytes) too large.\n",
- gap);
+ fprintf(stderr,
+ "Intersegment gap (%d bytes) too large.\n",
+ gap);
exit(1);
}
- fprintf(stderr, "Warning: %d byte intersegment gap.\n", gap);
+ fprintf(stderr,
+ "Warning: %d byte intersegment gap.\n", gap);
memset(obuf, 0, sizeof obuf);
while (gap) {
int count = write(outfile, obuf,
@@ -326,9 +328,8 @@ usage:
exit(0);
}
-copy(out, in, offset, size)
- int out, in;
- off_t offset, size;
+void
+copy(int out, int in, off_t offset, off_t size)
{
char ibuf[4096];
int remaining, cur, count;
@@ -360,9 +361,8 @@ copy(out, in, offset, size)
* Combine two segments, which must be contiguous. If pad is true, it's
* okay for there to be padding between.
*/
-combine(base, new, pad)
- struct sect *base, *new;
- int pad;
+void
+combine(struct sect *base, struct sect *new, int pad)
{
if (!base->len)
*base = *new;
@@ -380,8 +380,8 @@ combine(base, new, pad)
}
}
-phcmp(h1, h2)
- Elf32_Phdr *h1, *h2;
+int
+phcmp(Elf32_Phdr *h1, Elf32_Phdr *h2)
{
if (h1->p_vaddr > h2->p_vaddr)
return 1;
@@ -391,7 +391,7 @@ phcmp(h1, h2)
return 0;
}
-char *
+char *
saveRead(int file, off_t offset, off_t len, char *name)
{
char *tmp;
diff --git a/usr.bin/elf2olf/elf2olf.c b/usr.bin/elf2olf/elf2olf.c
index 13e968218ee..c0a2df47cd8 100644
--- a/usr.bin/elf2olf/elf2olf.c
+++ b/usr.bin/elf2olf/elf2olf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: elf2olf.c,v 1.6 2001/11/19 19:02:13 mpech Exp $ */
+/* $OpenBSD: elf2olf.c,v 1.7 2003/06/10 22:20:46 deraadt Exp $ */
/*
* Copyright (c) 1996 Erik Theisen. All rights reserved.
*
@@ -30,7 +30,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char rcsid[] = "@(#) $Id: elf2olf.c,v 1.6 2001/11/19 19:02:13 mpech Exp $";
+static char rcsid[] = "@(#) $Id: elf2olf.c,v 1.7 2003/06/10 22:20:46 deraadt Exp $";
#endif
#include <stdlib.h>
@@ -236,7 +236,7 @@ pwarn(name, fname, errval)
}
void
-usage()
+usage(void)
{
int i;
int col = 8;
diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c
index 7ddd5e0940a..445b50c20b4 100644
--- a/usr.bin/env/env.c
+++ b/usr.bin/env/env.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: env.c,v 1.9 2003/06/03 02:56:07 millert Exp $ */
+/* $OpenBSD: env.c,v 1.10 2003/06/10 22:20:46 deraadt Exp $ */
/*
* Copyright (c) 1988, 1993, 1994
@@ -37,7 +37,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "@(#)env.c 8.3 (Berkeley) 4/2/94";*/
-static char rcsid[] = "$OpenBSD: env.c,v 1.9 2003/06/03 02:56:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: env.c,v 1.10 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <err.h>
@@ -51,9 +51,7 @@ static char rcsid[] = "$OpenBSD: env.c,v 1.9 2003/06/03 02:56:07 millert Exp $";
void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
extern char **environ;
extern int optind;
@@ -98,7 +96,7 @@ main(argc, argv)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: env [-i] [name=value ...] "
"[utility [argument ...]]\n");
diff --git a/usr.bin/error/main.c b/usr.bin/error/main.c
index c5ff50f4eba..39c83776d92 100644
--- a/usr.bin/error/main.c
+++ b/usr.bin/error/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.9 2003/06/03 02:56:07 millert Exp $ */
+/* $OpenBSD: main.c,v 1.10 2003/06/10 22:20:46 deraadt Exp $ */
/* $NetBSD: main.c,v 1.3 1995/09/02 06:15:37 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: main.c,v 1.9 2003/06/03 02:56:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.10 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <signal.h>
@@ -116,9 +116,7 @@ void usage();
* Default: stdin
*/
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
char *ignorename = 0;
char **ed_argv; /* return from touchfiles */
@@ -227,9 +225,7 @@ main(argc, argv)
}
void
-forkvi(argc, argv)
- int argc;
- char **argv;
+forkvi(int argc, char **argv)
{
if (query) {
switch (inquire(terse ? "Edit? " :
@@ -254,10 +250,7 @@ forkvi(argc, argv)
}
void
-try(name, argc, argv)
- char *name;
- int argc;
- char **argv;
+try(char *name, int argc, char **argv)
{
argv[0] = name;
wordvprint(stdout, argc, argv);
@@ -274,8 +267,8 @@ try(name, argc, argv)
execvp(name, argv);
}
-int errorsort(epp1, epp2)
- Eptr *epp1, *epp2;
+int
+errorsort(Eptr *epp1, Eptr *epp2)
{
reg Eptr ep1, ep2;
int order;
@@ -307,7 +300,7 @@ int errorsort(epp1, epp2)
}
void
-usage()
+usage(void)
{
extern char *__progname;
diff --git a/usr.bin/error/pi.c b/usr.bin/error/pi.c
index 238c10d8765..05bd4db66f9 100644
--- a/usr.bin/error/pi.c
+++ b/usr.bin/error/pi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pi.c,v 1.5 2003/06/03 02:56:07 millert Exp $ */
+/* $OpenBSD: pi.c,v 1.6 2003/06/10 22:20:46 deraadt Exp $ */
/* $NetBSD: pi.c,v 1.3 1995/09/02 06:15:44 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pi.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: pi.c,v 1.5 2003/06/03 02:56:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: pi.c,v 1.6 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -204,7 +204,8 @@ boolean piptr(string)
extern int wordc;
extern char **wordv;
-Errorclass pi()
+Errorclass
+pi(void)
{
char **nwordv;
diff --git a/usr.bin/expand/expand.c b/usr.bin/expand/expand.c
index bf60304600c..b0e7ae9c68a 100644
--- a/usr.bin/expand/expand.c
+++ b/usr.bin/expand/expand.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expand.c,v 1.5 2003/06/03 02:56:07 millert Exp $ */
+/* $OpenBSD: expand.c,v 1.6 2003/06/10 22:20:46 deraadt Exp $ */
/* $NetBSD: expand.c,v 1.5 1995/09/02 06:19:46 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)expand.c 8.1 (Berkeley) 6/9/93";
#endif
-static char rcsid[] = "$OpenBSD: expand.c,v 1.5 2003/06/03 02:56:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: expand.c,v 1.6 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -58,9 +58,7 @@ static void getstops();
static void usage();
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int c, column;
int n;
@@ -108,7 +106,8 @@ main(argc, argv)
do {
putchar(' ');
column++;
- } while (((column - 1) % tabstops[0]) != (tabstops[0] - 1));
+ } while (((column - 1) %
+ tabstops[0]) != (tabstops[0] - 1));
continue;
}
for (n = 0; n < nstops; n++)
@@ -147,8 +146,7 @@ main(argc, argv)
}
static void
-getstops(cp)
- char *cp;
+getstops(char *cp)
{
int i;
@@ -174,7 +172,7 @@ bad:
}
static void
-usage()
+usage(void)
{
(void)fprintf (stderr, "usage: expand [-t tablist] [file ...]\n");
exit(1);
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index 659932b1f2e..b01a36a4480 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: function.c,v 1.26 2003/06/03 02:56:08 millert Exp $ */
+/* $OpenBSD: function.c,v 1.27 2003/06/10 22:20:46 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -34,7 +34,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)function.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: function.c,v 1.26 2003/06/03 02:56:08 millert Exp $";
+static char rcsid[] = "$OpenBSD: function.c,v 1.27 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -270,7 +270,7 @@ f_always_true(plan, entry)
}
PLAN *
-c_depth()
+c_depth(void)
{
isdepth = 1;
@@ -312,7 +312,7 @@ f_empty(plan, entry)
}
PLAN *
-c_empty()
+c_empty(void)
{
ftsoptions &= ~FTS_NOSTAT;
@@ -597,7 +597,7 @@ c_flags(flags_str)
* basis.
*/
PLAN *
-c_follow()
+c_follow(void)
{
ftsoptions &= ~FTS_PHYSICAL;
ftsoptions |= FTS_LOGICAL;
@@ -807,7 +807,7 @@ f_ls(plan, entry)
}
PLAN *
-c_ls()
+c_ls(void)
{
ftsoptions &= ~FTS_NOSTAT;
isoutput = 1;
@@ -1097,7 +1097,7 @@ f_nogroup(plan, entry)
}
PLAN *
-c_nogroup()
+c_nogroup(void)
{
ftsoptions &= ~FTS_NOSTAT;
@@ -1119,7 +1119,7 @@ f_nouser(plan, entry)
}
PLAN *
-c_nouser()
+c_nouser(void)
{
ftsoptions &= ~FTS_NOSTAT;
@@ -1225,7 +1225,7 @@ f_print0(plan, entry)
}
PLAN *
-c_print()
+c_print(void)
{
isoutput = 1;
@@ -1233,7 +1233,7 @@ c_print()
}
PLAN *
-c_print0()
+c_print0(void)
{
isoutput = 1;
@@ -1257,7 +1257,7 @@ f_prune(plan, entry)
}
PLAN *
-c_prune()
+c_prune(void)
{
return (palloc(N_PRUNE, f_prune));
}
@@ -1408,7 +1408,7 @@ c_user(username)
* different device ID (st_dev, see stat() S5.6.2 [POSIX.1])
*/
PLAN *
-c_xdev()
+c_xdev(void)
{
ftsoptions |= FTS_XDEV;
@@ -1439,13 +1439,13 @@ f_expr(plan, entry)
* to a N_EXPR node containing the expression and the ')' node is discarded.
*/
PLAN *
-c_openparen()
+c_openparen(void)
{
return (palloc(N_OPENPAREN, (int (*)())-1));
}
PLAN *
-c_closeparen()
+c_closeparen(void)
{
return (palloc(N_CLOSEPAREN, (int (*)())-1));
}
@@ -1469,7 +1469,7 @@ f_not(plan, entry)
}
PLAN *
-c_not()
+c_not(void)
{
return (palloc(N_NOT, f_not));
}
@@ -1500,7 +1500,7 @@ f_or(plan, entry)
}
PLAN *
-c_or()
+c_or(void)
{
return (palloc(N_OR, f_or));
}
diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c
index 3b2224a2075..df8de968628 100644
--- a/usr.bin/find/main.c
+++ b/usr.bin/find/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.15 2003/06/03 02:56:08 millert Exp $ */
+/* $OpenBSD: main.c,v 1.16 2003/06/10 22:20:46 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -31,7 +31,7 @@
#ifndef lint
/*static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: main.c,v 1.15 2003/06/03 02:56:08 millert Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.16 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -60,9 +60,7 @@ int isxargs; /* don't permit xargs delimiting chars */
static void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct sigaction sa;
char **p, **paths;
@@ -139,7 +137,7 @@ main(argc, argv)
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: find [-dHhLXxW] [-f file] file [...] [expression]\n");
diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c
index 978b4732175..66f100afa1b 100644
--- a/usr.bin/finger/finger.c
+++ b/usr.bin/finger/finger.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: finger.c,v 1.13 2003/06/03 02:56:08 millert Exp $ */
+/* $OpenBSD: finger.c,v 1.14 2003/06/10 22:20:46 deraadt Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -50,7 +50,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)finger.c 5.22 (Berkeley) 6/29/90";*/
-static char rcsid[] = "$OpenBSD: finger.c,v 1.13 2003/06/03 02:56:08 millert Exp $";
+static char rcsid[] = "$OpenBSD: finger.c,v 1.14 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
/*
@@ -84,9 +84,7 @@ int entries, lflag, sflag, mflag, oflag, pplan, Mflag;
char tbuf[1024];
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
extern int optind;
extern char *__progname;
@@ -170,7 +168,7 @@ main(argc, argv)
}
void
-loginlist()
+loginlist(void)
{
PERSON *pn;
struct passwd *pw;
@@ -196,9 +194,7 @@ loginlist()
}
void
-userlist(argc, argv)
- int argc;
- char **argv;
+userlist(int argc, char **argv)
{
int i;
PERSON *pn;
diff --git a/usr.bin/finger/lprint.c b/usr.bin/finger/lprint.c
index e7271b3f1e0..df8909aa320 100644
--- a/usr.bin/finger/lprint.c
+++ b/usr.bin/finger/lprint.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lprint.c,v 1.6 2003/06/03 02:56:08 millert Exp $ */
+/* $OpenBSD: lprint.c,v 1.7 2003/06/10 22:20:46 deraadt Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -34,7 +34,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)lprint.c 5.13 (Berkeley) 10/31/90";*/
-static char rcsid[] = "$OpenBSD: lprint.c,v 1.6 2003/06/03 02:56:08 millert Exp $";
+static char rcsid[] = "$OpenBSD: lprint.c,v 1.7 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -57,7 +57,7 @@ static char rcsid[] = "$OpenBSD: lprint.c,v 1.6 2003/06/03 02:56:08 millert Exp
#define _PATH_PROJECT ".project"
void
-lflag_print()
+lflag_print(void)
{
PERSON *pn;
@@ -75,8 +75,7 @@ lflag_print()
}
void
-lprint(pn)
- PERSON *pn;
+lprint(PERSON *pn)
{
struct tm *delta;
WHERE *w;
@@ -225,9 +224,7 @@ lprint(pn)
}
int
-demi_print(str, oddfield)
- char *str;
- int oddfield;
+demi_print(char *str, int oddfield)
{
static int lenlast;
int lenthis, maxlen;
@@ -265,8 +262,7 @@ demi_print(str, oddfield)
}
int
-show_text(directory, file_name, header)
- char *directory, *file_name, *header;
+show_text(char *directory, char *file_name, char *header)
{
int ch, lastc;
FILE *fp;
@@ -285,8 +281,7 @@ show_text(directory, file_name, header)
}
void
-vputc(ch)
- int ch;
+vputc(int ch)
{
char visout[5], *s2;
diff --git a/usr.bin/finger/sprint.c b/usr.bin/finger/sprint.c
index 9bc48c15fca..26428046f19 100644
--- a/usr.bin/finger/sprint.c
+++ b/usr.bin/finger/sprint.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sprint.c,v 1.7 2003/06/03 02:56:08 millert Exp $ */
+/* $OpenBSD: sprint.c,v 1.8 2003/06/10 22:20:46 deraadt Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -34,7 +34,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)sprint.c 5.8 (Berkeley) 12/4/90";*/
-static char rcsid[] = "$OpenBSD: sprint.c,v 1.7 2003/06/03 02:56:08 millert Exp $";
+static char rcsid[] = "$OpenBSD: sprint.c,v 1.8 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -47,7 +47,7 @@ static char rcsid[] = "$OpenBSD: sprint.c,v 1.7 2003/06/03 02:56:08 millert Exp
#include "extern.h"
void
-sflag_print()
+sflag_print(void)
{
PERSON *pn;
WHERE *w;
@@ -132,7 +132,7 @@ office:
}
PERSON **
-sort()
+sort(void)
{
PERSON *pn, **lp;
PERSON **list;
@@ -146,15 +146,13 @@ sort()
}
int
-psort(p, t)
- const void *p, *t;
+psort(const void *p, const void *t)
{
return(strcmp((*(PERSON **)p)->name, (*(PERSON **)t)->name));
}
void
-stimeprint(w)
- WHERE *w;
+stimeprint(WHERE *w)
{
struct tm *delta;
diff --git a/usr.bin/finger/util.c b/usr.bin/finger/util.c
index 40eb703ad55..aefbbaa4a08 100644
--- a/usr.bin/finger/util.c
+++ b/usr.bin/finger/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.16 2003/06/03 02:56:08 millert Exp $ */
+/* $OpenBSD: util.c,v 1.17 2003/06/10 22:20:46 deraadt Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -35,7 +35,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)util.c 5.14 (Berkeley) 1/17/91";*/
-static char rcsid[] = "$OpenBSD: util.c,v 1.16 2003/06/03 02:56:08 millert Exp $";
+static char rcsid[] = "$OpenBSD: util.c,v 1.17 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -59,8 +59,7 @@ static char rcsid[] = "$OpenBSD: util.c,v 1.16 2003/06/03 02:56:08 millert Exp $
char *estrdup(char *);
void
-find_idle_and_ttywrite(w)
- WHERE *w;
+find_idle_and_ttywrite(WHERE *w)
{
struct stat sb;
@@ -88,9 +87,7 @@ estrdup(char *s)
}
void
-userinfo(pn, pw)
- PERSON *pn;
- struct passwd *pw;
+userinfo(PERSON *pn, struct passwd *pw)
{
char *p;
char *bp, name[1024];
@@ -131,9 +128,7 @@ userinfo(pn, pw)
}
int
-match(pw, user)
- struct passwd *pw;
- char *user;
+match(struct passwd *pw, char *user)
{
char *p, *t;
char name[1024];
@@ -152,11 +147,7 @@ match(pw, user)
/* inspired by usr.sbin/sendmail/util.c::buildfname */
void
-expandusername(gecos, login, buf, buflen)
- char *gecos;
- char *login;
- char *buf;
- int buflen;
+expandusername(char *gecos, char *login, char *buf, int buflen)
{
char *p, *bp;
@@ -186,8 +177,7 @@ expandusername(gecos, login, buf, buflen)
}
void
-enter_lastlog(pn)
- PERSON *pn;
+enter_lastlog(PERSON *pn)
{
WHERE *w;
static int opened, fd;
@@ -236,9 +226,7 @@ enter_lastlog(pn)
}
void
-enter_where(ut, pn)
- struct utmp *ut;
- PERSON *pn;
+enter_where(struct utmp *ut, PERSON *pn)
{
WHERE *w = walloc(pn);
@@ -252,8 +240,7 @@ enter_where(ut, pn)
}
PERSON *
-enter_person(pw)
- struct passwd *pw;
+enter_person(struct passwd *pw)
{
PERSON *pn, **pp;
@@ -280,8 +267,7 @@ enter_person(pw)
}
PERSON *
-find_person(name)
- char *name;
+find_person(char *name)
{
PERSON *pn;
@@ -294,8 +280,7 @@ find_person(name)
}
int
-hash(name)
- char *name;
+hash(char *name)
{
int h, i;
@@ -307,7 +292,7 @@ hash(name)
}
PERSON *
-palloc()
+palloc(void)
{
PERSON *p;
@@ -317,8 +302,7 @@ palloc()
}
WHERE *
-walloc(pn)
- PERSON *pn;
+walloc(PERSON *pn)
{
WHERE *w;
@@ -335,8 +319,7 @@ walloc(pn)
}
char *
-prphone(num)
- char *num;
+prphone(char *num)
{
char *p;
int len;
@@ -390,8 +373,7 @@ prphone(num)
* The caller is responsible for free()'ing the returned string.
*/
char *
-vs(src)
- char *src;
+vs(char *src)
{
char *dst;
diff --git a/usr.bin/fold/fold.c b/usr.bin/fold/fold.c
index 0b6531911dc..b1a909a6ed2 100644
--- a/usr.bin/fold/fold.c
+++ b/usr.bin/fold/fold.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fold.c,v 1.7 2003/06/03 02:56:08 millert Exp $ */
+/* $OpenBSD: fold.c,v 1.8 2003/06/10 22:20:46 deraadt Exp $ */
/* $NetBSD: fold.c,v 1.6 1995/09/01 01:42:44 jtc Exp $ */
/*-
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)fold.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: fold.c,v 1.7 2003/06/03 02:56:08 millert Exp $";
+static char rcsid[] = "$OpenBSD: fold.c,v 1.8 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -60,9 +60,7 @@ int count_bytes = 0;
int split_words = 0;
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int ch;
int width;
@@ -125,8 +123,7 @@ main(argc, argv)
* returns embedded in the input stream.
*/
static void
-fold(width)
- int width;
+fold(int width)
{
static char *buf = NULL;
static int buf_max = 0;
@@ -193,9 +190,7 @@ fold(width)
* calculate the column position
*/
static int
-new_column_position(col, ch)
- int col;
- int ch;
+new_column_position(int col, int ch)
{
if (!count_bytes) {
switch (ch) {
diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c
index fbe3a07ea6a..16ba4f7cab7 100644
--- a/usr.bin/from/from.c
+++ b/usr.bin/from/from.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: from.c,v 1.9 2003/06/03 02:56:08 millert Exp $ */
+/* $OpenBSD: from.c,v 1.10 2003/06/10 22:20:46 deraadt Exp $ */
/* $NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)from.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: from.c,v 1.9 2003/06/03 02:56:08 millert Exp $";
+static char rcsid[] = "$OpenBSD: from.c,v 1.10 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -56,9 +56,7 @@ static char rcsid[] = "$OpenBSD: from.c,v 1.9 2003/06/03 02:56:08 millert Exp $"
int match(char *, char *);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
extern char *optarg;
extern int optind;
@@ -133,8 +131,7 @@ main(argc, argv)
}
int
-match(line, sender)
- char *line, *sender;
+match(char *line, char *sender)
{
char ch, pch, first, *p, *t;
diff --git a/usr.bin/fsplit/fsplit.c b/usr.bin/fsplit/fsplit.c
index a99b68e704e..6a12271c747 100644
--- a/usr.bin/fsplit/fsplit.c
+++ b/usr.bin/fsplit/fsplit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fsplit.c,v 1.12 2003/06/03 02:56:08 millert Exp $ */
+/* $OpenBSD: fsplit.c,v 1.13 2003/06/10 22:20:46 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -40,7 +40,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)fsplit.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: fsplit.c,v 1.12 2003/06/03 02:56:08 millert Exp $";
+static char rcsid[] = "$OpenBSD: fsplit.c,v 1.13 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -104,8 +104,7 @@ struct stat sbuf;
#define trim(p) while (*p == ' ' || *p == '\t') p++
int
-main(argc, argv)
- char **argv;
+main(int argc, char *argv[])
{
FILE *ofp; /* output file */
int rv; /* 1 if got card in output file, 0 otherwise */
@@ -218,15 +217,14 @@ main(argc, argv)
}
void
-badparms()
+badparms(void)
{
fprintf(stderr, "usage: fsplit [-e efile] ... [file]\n");
exit(1);
}
int
-saveit(name)
- char *name;
+saveit(char *name)
{
int i;
size_t n;
@@ -248,9 +246,7 @@ saveit(name)
}
void
-get_name(name, letters)
- char *name;
- int letters;
+get_name(char *name, int letters)
{
char *ptr;
@@ -267,7 +263,7 @@ get_name(name, letters)
}
int
-getline()
+getline(void)
{
int c;
char *ptr;
@@ -288,7 +284,7 @@ getline()
}
/* return 1 for 'end' alone on card (up to col. 72), 0 otherwise */
int
-lend()
+lend(void)
{
char *p;
@@ -316,9 +312,7 @@ lend()
name and put in arg string. invent name for unnamed
block datas and main programs. */
int
-lname(s, len)
- char *s;
- size_t len;
+lname(char *s, size_t len)
{
#define LINESIZE 80
char *ptr, *p;
@@ -376,8 +370,7 @@ lname(s, len)
}
int
-scan_name(s, ptr)
- char *s, *ptr;
+scan_name(char *s, char *ptr)
{
char *sptr;
@@ -400,8 +393,7 @@ scan_name(s, ptr)
}
char *
-functs(p)
- char *p;
+functs(char *p)
{
char *ptr;
@@ -428,8 +420,7 @@ functs(p)
if blanks and then tab, return ptr after tab,
else return 0 (labelled statement, comment or continuation */
char *
-skiplab(p)
- char *p;
+skiplab(char *p)
{
char *ptr;
@@ -447,8 +438,7 @@ skiplab(p)
/* return 0 if m doesn't match initial part of s;
otherwise return ptr to next char after m in s */
char *
-look(s, m)
- char *s, *m;
+look(char *s, char *m)
{
char *sp, *mp;
diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c
index 583bbe9aa01..1b9c7470c3d 100644
--- a/usr.bin/fstat/fstat.c
+++ b/usr.bin/fstat/fstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fstat.c,v 1.43 2003/06/03 02:56:08 millert Exp $ */
+/* $OpenBSD: fstat.c,v 1.44 2003/06/10 22:20:46 deraadt Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)fstat.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$OpenBSD: fstat.c,v 1.43 2003/06/03 02:56:08 millert Exp $";
+static char *rcsid = "$OpenBSD: fstat.c,v 1.44 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -616,9 +616,7 @@ nfs_filestat(struct vnode *vp, struct filestat *fsp)
}
int
-xfs_filestat(vp, fsp)
- struct vnode *vp;
- struct filestat *fsp;
+xfs_filestat(struct vnode *vp, struct filestat *fsp)
{
struct xfs_node xfs_node;
diff --git a/usr.bin/gencat/gencat.c b/usr.bin/gencat/gencat.c
index d4d8a17ac17..023ae413c74 100644
--- a/usr.bin/gencat/gencat.c
+++ b/usr.bin/gencat/gencat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gencat.c,v 1.7 2002/02/16 21:27:46 millert Exp $ */
+/* $OpenBSD: gencat.c,v 1.8 2003/06/10 22:20:46 deraadt Exp $ */
/* $NetBSD: gencat.c,v 1.9 1998/10/09 17:00:56 itohy Exp $ */
/*-
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
#ifndef lint
static char rcsid[] =
- "$OpenBSD: gencat.c,v 1.7 2002/02/16 21:27:46 millert Exp $";
+ "$OpenBSD: gencat.c,v 1.8 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
/***********************************************************
@@ -133,16 +133,14 @@ void usage(void);
void
-usage()
+usage(void)
{
fprintf(stderr, "Usage: %s catfile msgfile ...\n", __progname);
exit(1);
}
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ofd, ifd;
char *catfile = NULL;
@@ -179,9 +177,7 @@ main(argc, argv)
}
static void
-warning(cptr, msg)
- char *cptr;
- char *msg;
+warning(char *cptr, char *msg)
{
fprintf(stderr, "%s: %s on line %ld\n", __progname, msg, lineno);
fprintf(stderr, "%s\n", curline);
@@ -194,23 +190,20 @@ warning(cptr, msg)
}
static void
-error(cptr, msg)
- char *cptr;
- char *msg;
+error(char *cptr, char *msg)
{
warning(cptr, msg);
exit(1);
}
static void
-nomem()
+nomem(void)
{
error(NULL, "out of memory");
}
static void *
-xmalloc(len)
- size_t len;
+xmalloc(size_t len)
{
void *p;
@@ -220,9 +213,7 @@ xmalloc(len)
}
static void *
-xrealloc(ptr, size)
- void *ptr;
- size_t size;
+xrealloc(void *ptr, size_t size)
{
if ((ptr = realloc(ptr, size)) == NULL)
nomem();
@@ -230,8 +221,7 @@ xrealloc(ptr, size)
}
static char *
-xstrdup(str)
- const char *str;
+xstrdup(const char *str)
{
char *nstr;
@@ -241,8 +231,7 @@ xstrdup(str)
}
static char *
-getline(fd)
- int fd;
+getline(int fd)
{
static long curlen = BUFSIZ;
static char buf[BUFSIZ], *bptr = buf, *bend = buf;
@@ -285,8 +274,7 @@ getline(fd)
}
static char *
-wskip(cptr)
- char *cptr;
+wskip(char *cptr)
{
if (!*cptr || !ISSPACE(*cptr)) {
warning(cptr, "expected a space");
@@ -298,8 +286,7 @@ wskip(cptr)
}
static char *
-cskip(cptr)
- char *cptr;
+cskip(char *cptr)
{
if (!*cptr || ISSPACE(*cptr)) {
warning(cptr, "wasn't expecting a space");
@@ -311,10 +298,7 @@ cskip(cptr)
}
static char *
-getmsg(fd, cptr, quote)
- int fd;
- char *cptr;
- char quote;
+getmsg(int fd, char *cptr, char quote)
{
static char *msg = NULL;
static long msglen = 0;
@@ -428,8 +412,7 @@ getmsg(fd, cptr, quote)
}
void
-MCParse(fd)
- int fd;
+MCParse(int fd)
{
char *cptr, *str;
int setid, msgid = 0;
@@ -515,8 +498,7 @@ MCParse(fd)
* that would otherwise be required.
*/
void
-MCWriteCat(fd)
- int fd;
+MCWriteCat(int fd)
{
int nsets; /* number of sets */
int nmsgs; /* number of msgs */
@@ -621,8 +603,7 @@ MCWriteCat(fd)
}
void
-MCAddSet(setId)
- int setId;
+MCAddSet(int setId)
{
struct _setT *p, *q;
@@ -662,9 +643,7 @@ MCAddSet(setId)
}
void
-MCAddMsg(msgId, str)
- int msgId;
- const char *str;
+MCAddMsg(int msgId, const char *str)
{
struct _msgT *p, *q;
@@ -705,8 +684,7 @@ MCAddMsg(msgId, str)
}
void
-MCDelSet(setId)
- int setId;
+MCDelSet(int setId)
{
struct _setT *set;
struct _msgT *msg;
@@ -729,8 +707,7 @@ MCDelSet(setId)
}
void
-MCDelMsg(msgId)
- int msgId;
+MCDelMsg(int msgId)
{
struct _msgT *msg;
diff --git a/usr.bin/getconf/getconf.c b/usr.bin/getconf/getconf.c
index 56203ad9322..daadb246667 100644
--- a/usr.bin/getconf/getconf.c
+++ b/usr.bin/getconf/getconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getconf.c,v 1.7 2003/05/21 00:56:50 pjanzen Exp $ */
+/* $OpenBSD: getconf.c,v 1.8 2003/06/10 22:20:47 deraadt Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: getconf.c,v 1.7 2003/05/21 00:56:50 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: getconf.c,v 1.8 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -140,9 +140,7 @@ const struct conf_variable conf_table[] =
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int ch;
const struct conf_variable *cp;
@@ -232,7 +230,7 @@ main(argc, argv)
static void
-usage()
+usage(void)
{
extern char *__progname;
diff --git a/usr.bin/getopt/getopt.c b/usr.bin/getopt/getopt.c
index 7ec53acc066..d09d282a625 100644
--- a/usr.bin/getopt/getopt.c
+++ b/usr.bin/getopt/getopt.c
@@ -1,16 +1,14 @@
-/* $OpenBSD: getopt.c,v 1.4 2001/07/12 05:17:09 deraadt Exp $ */
+/* $OpenBSD: getopt.c,v 1.5 2003/06/10 22:20:47 deraadt Exp $ */
#ifndef lint
-static char rcsid[] = "$OpenBSD: getopt.c,v 1.4 2001/07/12 05:17:09 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: getopt.c,v 1.5 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
#include <unistd.h>
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
extern int optind;
extern char *optarg;
diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c
index 42c9f2569c6..1b9f564a0c6 100644
--- a/usr.bin/gprof/gprof.c
+++ b/usr.bin/gprof/gprof.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gprof.c,v 1.12 2003/06/03 02:56:08 millert Exp $ */
+/* $OpenBSD: gprof.c,v 1.13 2003/06/10 22:20:47 deraadt Exp $ */
/* $NetBSD: gprof.c,v 1.8 1995/04/19 07:15:59 cgd Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)gprof.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: gprof.c,v 1.12 2003/06/03 02:56:08 millert Exp $";
+static char rcsid[] = "$OpenBSD: gprof.c,v 1.13 2003/06/10 22:20:47 deraadt Exp $";
#endif
#endif /* not lint */
@@ -52,9 +52,7 @@ static struct gmonhdr gmonhdr;
extern char *__progname;
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
char **sp;
nltype **timesortnlp;
@@ -215,8 +213,7 @@ main(argc, argv)
* and the arcs.
*/
void
-getpfile(filename)
- char *filename;
+getpfile(char *filename)
{
FILE *pfile;
FILE *openpfile();
@@ -244,8 +241,7 @@ getpfile(filename)
}
FILE *
-openpfile(filename)
- char *filename;
+openpfile(char *filename)
{
struct gmonhdr tmp;
FILE *pfile;
@@ -296,8 +292,7 @@ openpfile(filename)
}
void
-tally( rawp )
- struct rawarc *rawp;
+tally(struct rawarc *rawp)
{
nltype *parentp;
nltype *childp;
@@ -325,8 +320,7 @@ tally( rawp )
* dump out the gmon.sum file
*/
void
-dumpsum( sumfile )
- char *sumfile;
+dumpsum(char *sumfile)
{
nltype *nlp;
arctype *arcp;
@@ -382,8 +376,7 @@ valcmp(const void *vp1, const void *vp2)
}
void
-readsamples(pfile)
- FILE *pfile;
+readsamples(FILE *pfile)
{
UNIT sample;
int i;
@@ -436,7 +429,7 @@ readsamples(pfile)
* have any overlap (the two end cases, above).
*/
void
-asgnsamples()
+asgnsamples(void)
{
int j;
UNIT ccnt;
@@ -502,8 +495,7 @@ asgnsamples()
unsigned long
-min(a, b)
- unsigned long a,b;
+min(unsigned long a, unsigned long b)
{
if (a<b)
return(a);
@@ -511,8 +503,7 @@ min(a, b)
}
unsigned long
-max(a, b)
- unsigned long a,b;
+max(unsigned long a, unsigned long b)
{
if (a>b)
return(a);
@@ -526,7 +517,7 @@ max(a, b)
* for a routine is in the next bucket.
*/
void
-alignentries()
+alignentries(void)
{
struct nl *nlp;
unsigned long bucket_of_entry;
diff --git a/usr.bin/head/head.c b/usr.bin/head/head.c
index cee22150bc9..d1eaffc040e 100644
--- a/usr.bin/head/head.c
+++ b/usr.bin/head/head.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: head.c,v 1.10 2003/06/03 02:56:09 millert Exp $ */
+/* $OpenBSD: head.c,v 1.11 2003/06/10 22:20:47 deraadt Exp $ */
/*
* Copyright (c) 1980, 1987 Regents of the University of California.
@@ -37,7 +37,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)head.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$OpenBSD: head.c,v 1.10 2003/06/03 02:56:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: head.c,v 1.11 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -57,9 +57,7 @@ static void usage(void);
*/
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
long cnt;
int ch, firsttime;
@@ -118,7 +116,7 @@ main(argc, argv)
static void
-usage ()
+usage(void)
{
fputs("usage: head [-n line_count] [file ...]\n", stderr);
exit(1);
diff --git a/usr.bin/hexdump/hexdump.c b/usr.bin/hexdump/hexdump.c
index 85baebb521b..4f8aac6282e 100644
--- a/usr.bin/hexdump/hexdump.c
+++ b/usr.bin/hexdump/hexdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hexdump.c,v 1.9 2003/06/03 02:56:09 millert Exp $ */
+/* $OpenBSD: hexdump.c,v 1.10 2003/06/10 22:20:47 deraadt Exp $ */
/* $NetBSD: hexdump.c,v 1.7 1997/10/19 02:34:06 lukem Exp $ */
/*
@@ -38,7 +38,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)hexdump.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$OpenBSD: hexdump.c,v 1.9 2003/06/03 02:56:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: hexdump.c,v 1.10 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -54,9 +54,7 @@ int length = -1; /* max bytes to read */
int main(int, char **);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
FS *tfs;
char *p;
diff --git a/usr.bin/id/id.c b/usr.bin/id/id.c
index d2854b2de6c..927b6d92516 100644
--- a/usr.bin/id/id.c
+++ b/usr.bin/id/id.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: id.c,v 1.12 2003/06/03 02:56:09 millert Exp $ */
+/* $OpenBSD: id.c,v 1.13 2003/06/10 22:20:47 deraadt Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "@(#)id.c 8.3 (Berkeley) 4/28/95";*/
-static char rcsid[] = "$OpenBSD: id.c,v 1.12 2003/06/03 02:56:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: id.c,v 1.13 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -60,9 +60,7 @@ struct passwd *
who(char *);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct group *gr;
struct passwd *pw;
@@ -145,8 +143,7 @@ main(argc, argv)
}
void
-pretty(pw)
- struct passwd *pw;
+pretty(struct passwd *pw)
{
struct group *gr;
uid_t eid, rid;
@@ -186,7 +183,7 @@ pretty(pw)
}
void
-current()
+current(void)
{
struct group *gr;
struct passwd *pw;
@@ -228,8 +225,7 @@ current()
}
void
-user(pw)
- struct passwd *pw;
+user(struct passwd *pw)
{
struct group *gr;
char *fmt;
@@ -256,9 +252,7 @@ user(pw)
}
void
-group(pw, nflag)
- struct passwd *pw;
- int nflag;
+group(struct passwd *pw, int nflag)
{
struct group *gr;
int cnt, id, lastid, ngroups;
@@ -293,8 +287,7 @@ group(pw, nflag)
}
struct passwd *
-who(u)
- char *u;
+who(char *u)
{
struct passwd *pw;
uid_t id;
@@ -314,7 +307,7 @@ who(u)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: id [user]\n"
" id -G [-n] [user]\n"
diff --git a/usr.bin/ipcrm/ipcrm.c b/usr.bin/ipcrm/ipcrm.c
index cdfead8ad8c..08d616344eb 100644
--- a/usr.bin/ipcrm/ipcrm.c
+++ b/usr.bin/ipcrm/ipcrm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipcrm.c,v 1.4 2002/02/16 21:27:47 millert Exp $*/
+/* $OpenBSD: ipcrm.c,v 1.5 2003/06/10 22:20:47 deraadt Exp $*/
/*
* Copyright (c) 1994 Adam Glass
@@ -57,7 +57,7 @@ int semrm(key_t, int);
void not_configured(int);
void
-usage()
+usage(void)
{
fprintf(stderr, "usage: ipcrm [ [-q msqid] [-m shmid] [-s semid]\n");
fprintf(stderr, " [-Q msgkey] [-M shmkey] [-S semkey] ...]\n");
@@ -65,9 +65,7 @@ usage()
}
int
-msgrm(key, id)
- key_t key;
- int id;
+msgrm(key_t key, int id)
{
if (key) {
id = msgget(key, 0);
@@ -78,9 +76,7 @@ msgrm(key, id)
}
int
-shmrm(key, id)
- key_t key;
- int id;
+shmrm(key_t key, int id)
{
if (key) {
id = shmget(key, 0, 0);
@@ -91,9 +87,7 @@ shmrm(key, id)
}
int
-semrm(key, id)
- key_t key;
- int id;
+semrm(key_t key, int id)
{
union semun arg;
@@ -106,16 +100,13 @@ semrm(key, id)
}
void
-not_configured(sig)
- int sig;
+not_configured(int signo)
{
signaled++;
}
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int c, result, errflg, target_id;
key_t target_key;
diff --git a/usr.bin/join/join.c b/usr.bin/join/join.c
index da69d935458..971d640be73 100644
--- a/usr.bin/join/join.c
+++ b/usr.bin/join/join.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: join.c,v 1.15 2003/06/03 02:56:09 millert Exp $ */
+/* $OpenBSD: join.c,v 1.16 2003/06/10 22:20:47 deraadt Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -41,7 +41,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "@(#)join.c 8.6 (Berkeley) 5/4/95"; */
-static char rcsid[] = "$OpenBSD: join.c,v 1.15 2003/06/03 02:56:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: join.c,v 1.16 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -111,9 +111,7 @@ void slurpit(INPUT *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
INPUT *F1, *F2;
int aflag, ch, cval, vflag;
@@ -283,8 +281,7 @@ main(argc, argv)
}
/* wrapper around slurpit() to keep track of what field we are on */
-void slurp(F)
- INPUT *F;
+void slurp(INPUT *F)
{
long fpos;
u_long cfieldc;
@@ -305,8 +302,7 @@ void slurp(F)
}
void
-slurpit(F)
- INPUT *F;
+slurpit(INPUT *F)
{
LINE *lp, *lastlp, tmp;
size_t len;
@@ -399,9 +395,7 @@ slurpit(F)
}
int
-cmp(lp1, fieldno1, lp2, fieldno2)
- LINE *lp1, *lp2;
- u_long fieldno1, fieldno2;
+cmp(LINE *lp1, u_long fieldno1, LINE *lp2, u_long fieldno2)
{
if (lp1->fieldcnt <= fieldno1)
return (-1);
@@ -411,8 +405,7 @@ cmp(lp1, fieldno1, lp2, fieldno2)
}
void
-joinlines(F1, F2)
- INPUT *F1, *F2;
+joinlines(INPUT *F1, INPUT *F2)
{
int cnt1, cnt2;
@@ -432,9 +425,7 @@ joinlines(F1, F2)
}
void
-outoneline(F, lp)
- INPUT *F;
- LINE *lp;
+outoneline(INPUT *F, LINE *lp)
{
int cnt;
@@ -460,9 +451,7 @@ outoneline(F, lp)
}
void
-outtwoline(F1, lp1, F2, lp2)
- INPUT *F1, *F2;
- LINE *lp1, *lp2;
+outtwoline(INPUT *F1, LINE *lp1, INPUT *F2, LINE *lp2)
{
int cnt;
@@ -493,10 +482,7 @@ outtwoline(F1, lp1, F2, lp2)
}
void
-outfield(lp, fieldno, out_empty)
- LINE *lp;
- u_long fieldno;
- int out_empty;
+outfield(LINE *lp, u_long fieldno, int out_empty)
{
if (needsep++)
putchar((int)*tabchar);
@@ -519,8 +505,7 @@ outfield(lp, fieldno, out_empty)
* fields.
*/
void
-fieldarg(option)
- char *option;
+fieldarg(char *option)
{
u_long fieldno;
char *end, *token;
@@ -548,8 +533,7 @@ fieldarg(option)
}
void
-obsolete(argv)
- char **argv;
+obsolete(char **argv)
{
int len;
char **p, *ap, *t;
@@ -628,7 +612,7 @@ jbad: errx(1, "illegal option -- %s", ap);
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "%s%s\n",
"usage: join [-a fileno | -v fileno ] [-e string] [-1 field] ",
diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c
index 1ab0cb21d54..8043ee4b81b 100644
--- a/usr.bin/jot/jot.c
+++ b/usr.bin/jot/jot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: jot.c,v 1.12 2003/06/03 02:56:09 millert Exp $ */
+/* $OpenBSD: jot.c,v 1.13 2003/06/10 22:20:47 deraadt Exp $ */
/* $NetBSD: jot.c,v 1.3 1994/12/02 20:29:43 pk Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)jot.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: jot.c,v 1.12 2003/06/03 02:56:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: jot.c,v 1.13 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
/*
@@ -85,9 +85,7 @@ void putdata(double, long);
static void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
double xd, yd;
long id;
@@ -290,9 +288,7 @@ main(argc, argv)
}
void
-putdata(x, notlast)
- double x;
- long notlast;
+putdata(double x, long notlast)
{
long d = x;
long *dp = &d;
@@ -316,8 +312,7 @@ usage(void)
}
int
-getprec(s)
- char *s;
+getprec(char *s)
{
char *p;
char *q;
@@ -334,7 +329,7 @@ getprec(s)
}
void
-getformat()
+getformat(void)
{
char *p;
size_t sz;
diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c
index 3249fe8c8dd..3c0f6e3874c 100644
--- a/usr.bin/ktrace/ktrace.c
+++ b/usr.bin/ktrace/ktrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ktrace.c,v 1.16 2003/06/03 02:56:09 millert Exp $ */
+/* $OpenBSD: ktrace.c,v 1.17 2003/06/10 22:20:47 deraadt Exp $ */
/* $NetBSD: ktrace.c,v 1.4 1995/08/31 23:01:44 jtc Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ktrace.c 8.2 (Berkeley) 4/28/95";
#endif
-static char *rcsid = "$OpenBSD: ktrace.c,v 1.16 2003/06/03 02:56:09 millert Exp $";
+static char *rcsid = "$OpenBSD: ktrace.c,v 1.17 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -65,9 +65,7 @@ static void no_ktrace(int);
static void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
enum { NOTSET, CLEAR, CLEARALL } clear;
int append, ch, fd, inherit, ops, pidset, trpoints;
@@ -171,8 +169,7 @@ main(argc, argv)
}
static int
-rpid(p)
- const char *p;
+rpid(const char *p)
{
static int first;
@@ -188,7 +185,7 @@ rpid(p)
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage:\tktrace [-aCcdi] [-f trfile] [-g pgid] [-p pid] [-t [ceinsw]]\n\tktrace [-adi] [-f trfile] [-t [ceinsw]] command\n");
@@ -196,8 +193,7 @@ usage()
}
static void
-no_ktrace(sig)
- int sig;
+no_ktrace(int signo)
{
char buf[8192];
diff --git a/usr.bin/lam/lam.c b/usr.bin/lam/lam.c
index 6979141fc18..38a1c97ff8d 100644
--- a/usr.bin/lam/lam.c
+++ b/usr.bin/lam/lam.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lam.c,v 1.8 2003/06/03 02:56:09 millert Exp $ */
+/* $OpenBSD: lam.c,v 1.9 2003/06/10 22:20:47 deraadt Exp $ */
/* $NetBSD: lam.c,v 1.2 1994/11/14 20:27:42 jtc Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)lam.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: lam.c,v 1.8 2003/06/03 02:56:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: lam.c,v 1.9 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
/*
@@ -75,9 +75,7 @@ void getargs(char *[]);
char *pad(struct openfile *);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct openfile *ip;
@@ -98,8 +96,7 @@ main(argc, argv)
}
void
-getargs(av)
- char *av[];
+getargs(char *av[])
{
struct openfile *ip = input;
char *p;
@@ -171,8 +168,7 @@ getargs(av)
}
char *
-pad(ip)
- struct openfile *ip;
+pad(struct openfile *ip)
{
size_t n;
char *lp = linep;
@@ -187,8 +183,7 @@ pad(ip)
}
char *
-gatherline(ip)
- struct openfile *ip;
+gatherline(struct openfile *ip)
{
size_t n;
char s[BUFSIZ];
@@ -218,8 +213,7 @@ gatherline(ip)
}
void
-error(msg, s)
- char *msg, *s;
+error(char *msg, char *s)
{
fprintf(stderr, "lam: ");
fprintf(stderr, msg, s);
diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c
index d0bf59a1651..870be3d61e2 100644
--- a/usr.bin/last/last.c
+++ b/usr.bin/last/last.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: last.c,v 1.26 2003/06/03 02:56:09 millert Exp $ */
+/* $OpenBSD: last.c,v 1.27 2003/06/10 22:20:47 deraadt Exp $ */
/* $NetBSD: last.c,v 1.6 1994/12/24 16:49:02 cgd Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)last.c 8.2 (Berkeley) 4/2/94";
#endif
-static char rcsid[] = "$OpenBSD: last.c,v 1.26 2003/06/03 02:56:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: last.c,v 1.27 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -107,9 +107,7 @@ void usage(void);
#define HOST_WIDTH 24
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
extern int optind;
extern char *optarg;
@@ -187,7 +185,7 @@ main(argc, argv)
*/
void
-checkargs()
+checkargs(void)
{
ARG *step;
int ttyflag = 0;
@@ -227,7 +225,7 @@ checkargs()
* read through the wtmp file
*/
void
-wtmp()
+wtmp(void)
{
struct utmp *bp; /* current structure */
TTY *T; /* tty list entry */
@@ -424,9 +422,7 @@ wtmp()
* see if want this entry
*/
int
-want(bp, check)
- struct utmp *bp;
- int check;
+want(struct utmp *bp, int check)
{
ARG *step;
@@ -472,9 +468,7 @@ want(bp, check)
* add an entry to a linked list of arguments
*/
void
-addarg(type, arg)
- int type;
- char *arg;
+addarg(int type, char *arg)
{
ARG *cur;
@@ -491,8 +485,7 @@ addarg(type, arg)
* add an entry to a linked list of ttys
*/
TTY *
-addtty(ttyname)
- char *ttyname;
+addtty(char *ttyname)
{
TTY *cur;
@@ -511,8 +504,7 @@ addtty(ttyname)
* off the domain suffix since that's what login(1) does.
*/
void
-hostconv(arg)
- char *arg;
+hostconv(char *arg)
{
static int first = 1;
static char *hostdot, name[MAXHOSTNAMELEN];
@@ -535,8 +527,7 @@ hostconv(arg)
* convert tty to correct name.
*/
char *
-ttyconv(arg)
- char *arg;
+ttyconv(char *arg)
{
char *mval;
size_t len = 8;
@@ -567,8 +558,7 @@ ttyconv(arg)
* Derived from atime_arg1() in usr.bin/touch/touch.c
*/
time_t
-dateconv(arg)
- char *arg;
+dateconv(char *arg)
{
time_t timet;
struct tm *t;
@@ -639,8 +629,7 @@ terr: errx(1,
* on interrupt, we inform the user how far we've gotten
*/
void
-onintr(signo)
- int signo;
+onintr(int signo)
{
char str[1024], *ct;
diff --git a/usr.bin/lastcomm/lastcomm.c b/usr.bin/lastcomm/lastcomm.c
index bb0e3fd83d9..f08fd738daf 100644
--- a/usr.bin/lastcomm/lastcomm.c
+++ b/usr.bin/lastcomm/lastcomm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lastcomm.c,v 1.11 2003/06/03 02:56:09 millert Exp $ */
+/* $OpenBSD: lastcomm.c,v 1.12 2003/06/10 22:20:47 deraadt Exp $ */
/* $NetBSD: lastcomm.c,v 1.9 1995/10/22 01:43:42 ghudson Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)lastcomm.c 8.2 (Berkeley) 4/29/95";
#endif
-static char rcsid[] = "$OpenBSD: lastcomm.c,v 1.11 2003/06/03 02:56:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: lastcomm.c,v 1.12 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -68,9 +68,7 @@ void usage(void);
char *user_from_uid();
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
char *p;
struct acct ab;
@@ -157,8 +155,7 @@ main(argc, argv)
}
time_t
-expand(t)
- u_int t;
+expand(u_int t)
{
time_t nt;
@@ -172,8 +169,7 @@ expand(t)
}
char *
-flagbits(f)
- int f;
+flagbits(int f)
{
static char flags[20] = "-";
char *p;
@@ -191,9 +187,7 @@ flagbits(f)
}
int
-requested(argv, acp)
- char *argv[];
- struct acct *acp;
+requested(char *argv[], struct acct *acp)
{
do {
if (!strcmp(user_from_uid(acp->ac_uid, 0), *argv))
@@ -207,8 +201,7 @@ requested(argv, acp)
}
char *
-getdev(dev)
- dev_t dev;
+getdev(dev_t dev)
{
static dev_t lastdev = (dev_t)-1;
static char *lastname;
@@ -224,7 +217,7 @@ getdev(dev)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"lastcomm [ -f file ] [command ...] [user ...] [tty ...]\n");
diff --git a/usr.bin/leave/leave.c b/usr.bin/leave/leave.c
index 7c68061be3b..3b26ae1229c 100644
--- a/usr.bin/leave/leave.c
+++ b/usr.bin/leave/leave.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: leave.c,v 1.9 2003/06/03 02:56:09 millert Exp $ */
+/* $OpenBSD: leave.c,v 1.10 2003/06/10 22:20:47 deraadt Exp $ */
/* $NetBSD: leave.c,v 1.4 1995/07/03 16:50:13 phil Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)leave.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: leave.c,v 1.9 2003/06/03 02:56:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: leave.c,v 1.10 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -61,9 +61,7 @@ void doalarm(u_int secs);
* It nags you like a mother hen.
*/
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
u_int secs;
int hours, minutes;
@@ -125,8 +123,7 @@ main(argc, argv)
}
void
-doalarm(secs)
- u_int secs;
+doalarm(u_int secs)
{
int bother;
time_t daytime;
@@ -175,7 +172,7 @@ doalarm(secs)
}
void
-usage()
+usage(void)
{
fprintf(stderr, "usage: leave [[+]hhmm]\n");
exit(1);
diff --git a/usr.bin/logger/logger.c b/usr.bin/logger/logger.c
index 50556eb3245..06de62207e4 100644
--- a/usr.bin/logger/logger.c
+++ b/usr.bin/logger/logger.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: logger.c,v 1.6 2003/06/03 02:56:10 millert Exp $ */
+/* $OpenBSD: logger.c,v 1.7 2003/06/10 22:20:47 deraadt Exp $ */
/* $NetBSD: logger.c,v 1.4 1994/12/22 06:27:00 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)logger.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: logger.c,v 1.6 2003/06/03 02:56:10 millert Exp $";
+static char rcsid[] = "$OpenBSD: logger.c,v 1.7 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
#include <errno.h>
@@ -64,9 +64,7 @@ void usage(void);
* log.
*/
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch, logflags, pri;
char *tag, buf[1024];
@@ -138,8 +136,7 @@ main(argc, argv)
* Decode a symbolic name to a numeric value
*/
int
-pencode(s)
- char *s;
+pencode(char *s)
{
char *save;
int fac, lev;
@@ -169,9 +166,7 @@ pencode(s)
}
int
-decode(name, codetab)
- char *name;
- CODE *codetab;
+decode(char *name, CODE *codetab)
{
CODE *c;
@@ -186,7 +181,7 @@ decode(name, codetab)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"logger: [-is] [-f file] [-p pri] [-t tag] [ message ... ]\n");
diff --git a/usr.bin/logname/logname.c b/usr.bin/logname/logname.c
index 7aa6c6c2cef..6f3052e34f7 100644
--- a/usr.bin/logname/logname.c
+++ b/usr.bin/logname/logname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: logname.c,v 1.5 2003/06/03 02:56:10 millert Exp $ */
+/* $OpenBSD: logname.c,v 1.6 2003/06/10 22:20:47 deraadt Exp $ */
/* $NetBSD: logname.c,v 1.6 1994/12/22 06:39:32 jtc Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)logname.c 8.2 (Berkeley) 4/3/94";
#endif
-static char rcsid[] = "$OpenBSD: logname.c,v 1.5 2003/06/03 02:56:10 millert Exp $";
+static char rcsid[] = "$OpenBSD: logname.c,v 1.6 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -52,9 +52,7 @@ static char rcsid[] = "$OpenBSD: logname.c,v 1.5 2003/06/03 02:56:10 millert Exp
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch;
char *p;
@@ -81,7 +79,7 @@ main(argc, argv)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: logname\n");
exit(1);
diff --git a/usr.bin/look/look.c b/usr.bin/look/look.c
index 6c5b0ea4508..c7dd177a0f7 100644
--- a/usr.bin/look/look.c
+++ b/usr.bin/look/look.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: look.c,v 1.9 2003/06/03 02:56:10 millert Exp $ */
+/* $OpenBSD: look.c,v 1.10 2003/06/10 22:20:47 deraadt Exp $ */
/* $NetBSD: look.c,v 1.7 1995/08/31 22:41:02 jtc Exp $ */
/*-
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)look.c 8.2 (Berkeley) 5/4/95";
#endif
-static char rcsid[] = "$OpenBSD: look.c,v 1.9 2003/06/03 02:56:10 millert Exp $";
+static char rcsid[] = "$OpenBSD: look.c,v 1.10 2003/06/10 22:20:47 deraadt Exp $";
#endif /* not lint */
/*
@@ -95,9 +95,7 @@ void print_from(char *, char *, char *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat sb;
int ch, fd, termchar;
@@ -151,8 +149,7 @@ main(argc, argv)
}
int
-look(string, front, back)
- char *string, *front, *back;
+look(char *string, char *front, char *back)
{
int ch;
char *readp, *writep;
@@ -219,8 +216,7 @@ look(string, front, back)
while (p < back && *p++ != '\n');
char *
-binary_search(string, front, back)
- char *string, *front, *back;
+binary_search(char *string, char *front, char *back)
{
char *p;
@@ -254,8 +250,7 @@ binary_search(string, front, back)
* o front is before or at the first line to be printed.
*/
char *
-linear_search(string, front, back)
- char *string, *front, *back;
+linear_search(char *string, char *front, char *back)
{
while (front < back) {
switch (compare(string, front, back)) {
@@ -277,8 +272,7 @@ linear_search(string, front, back)
* Print as many lines as match string, starting at front.
*/
void
-print_from(string, front, back)
- char *string, *front, *back;
+print_from(char *string, char *front, char *back)
{
for (; front < back && compare(string, front, back) == EQUAL; ++front) {
for (; front < back && *front != '\n'; ++front)
@@ -303,8 +297,7 @@ print_from(string, front, back)
* "back" terminated).
*/
int
-compare(s1, s2, back)
- char *s1, *s2, *back;
+compare(char *s1, char *s2, char *back)
{
int ch;
@@ -326,7 +319,7 @@ compare(s1, s2, back)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: look [-df] [-t char] string [file]\n");
exit(2);
diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c
index 6d9770469c9..93d2cd48227 100644
--- a/usr.bin/m4/main.c
+++ b/usr.bin/m4/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.55 2003/06/03 02:56:10 millert Exp $ */
+/* $OpenBSD: main.c,v 1.56 2003/06/10 22:20:48 deraadt Exp $ */
/* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */
/*-
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.55 2003/06/03 02:56:10 millert Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.56 2003/06/10 22:20:48 deraadt Exp $";
#endif
#endif /* not lint */
@@ -305,7 +305,7 @@ do_look_ahead(int t, const char *token)
* macro - the work horse..
*/
static void
-macro()
+macro(void)
{
char token[MAXTOK+1];
int t, l;
@@ -573,7 +573,7 @@ inspect(int c, char *tp)
* within keywrds block.
*/
static void
-initkwds()
+initkwds(void)
{
size_t i;
unsigned int h;
@@ -642,7 +642,7 @@ dump_stack(struct position *t, int lev)
static void
-enlarge_stack()
+enlarge_stack(void)
{
STACKMAX *= 2;
mstack = realloc(mstack, sizeof(stae) * STACKMAX);
diff --git a/usr.bin/man/man.c b/usr.bin/man/man.c
index 329cc50f00e..847dbf12338 100644
--- a/usr.bin/man/man.c
+++ b/usr.bin/man/man.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man.c,v 1.25 2003/06/03 02:56:12 millert Exp $ */
+/* $OpenBSD: man.c,v 1.26 2003/06/10 22:20:48 deraadt Exp $ */
/* $NetBSD: man.c,v 1.7 1995/09/28 06:05:34 tls Exp $ */
/*
@@ -40,7 +40,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.25 2003/06/03 02:56:12 millert Exp $";
+static char rcsid[] = "$OpenBSD: man.c,v 1.26 2003/06/10 22:20:48 deraadt Exp $";
#endif
#endif /* not lint */
@@ -406,10 +406,7 @@ main(int argc, char *argv[])
* Search the manuals for the pages.
*/
static int
-manual(page, tag, pg)
- char *page;
- TAG *tag;
- glob_t *pg;
+manual(char *page, TAG *tag, glob_t *pg)
{
ENTRY *ep, *e_sufp, *e_tag;
TAG *missp, *sufp;
diff --git a/usr.bin/mesg/mesg.c b/usr.bin/mesg/mesg.c
index c0dba79852c..5e21d81334d 100644
--- a/usr.bin/mesg/mesg.c
+++ b/usr.bin/mesg/mesg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mesg.c,v 1.5 2003/06/03 02:56:13 millert Exp $ */
+/* $OpenBSD: mesg.c,v 1.6 2003/06/10 22:20:48 deraadt Exp $ */
/* $NetBSD: mesg.c,v 1.4 1994/12/23 07:16:32 jtc Exp $ */
/*
@@ -45,7 +45,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mesg.c 8.2 (Berkeley) 1/21/94";
#endif
-static char rcsid[] = "$OpenBSD: mesg.c,v 1.5 2003/06/03 02:56:13 millert Exp $";
+static char rcsid[] = "$OpenBSD: mesg.c,v 1.6 2003/06/10 22:20:48 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -59,9 +59,7 @@ static char rcsid[] = "$OpenBSD: mesg.c,v 1.5 2003/06/03 02:56:13 millert Exp $"
#include <unistd.h>
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat sb;
char *tty;
diff --git a/usr.bin/mg/tty.c b/usr.bin/mg/tty.c
index 407751d5bad..e9861cce2e5 100644
--- a/usr.bin/mg/tty.c
+++ b/usr.bin/mg/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.19 2002/08/28 19:48:29 art Exp $ */
+/* $OpenBSD: tty.c,v 1.20 2003/06/10 22:20:48 deraadt Exp $ */
/*
* Terminfo display driver
@@ -220,7 +220,7 @@ tteeop(void)
* Make a noise.
*/
void
-ttbeep()
+ttbeep(void)
{
putpad(bell, 1);
ttflush();
@@ -360,7 +360,7 @@ ttwindow(top, bot)
* your terminal size.
*/
void
-ttnowindow()
+ttnowindow(void)
{
if (change_scroll_region) {
putpad(tgoto(change_scroll_region,
diff --git a/usr.bin/midiplay/midiplay.c b/usr.bin/midiplay/midiplay.c
index ecfe0a3d99e..2c9f3ce93cd 100644
--- a/usr.bin/midiplay/midiplay.c
+++ b/usr.bin/midiplay/midiplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: midiplay.c,v 1.3 2002/03/14 06:51:42 mpech Exp $ */
+/* $OpenBSD: midiplay.c,v 1.4 2003/06/10 22:20:48 deraadt Exp $ */
/* $NetBSD: midiplay.c,v 1.8 1998/11/25 22:17:07 augustss Exp $ */
/*
@@ -128,7 +128,7 @@ u_char sample[] = {
#define GET32(p) (((p)[0] << 24) | ((p)[1] << 16) | ((p)[2] << 8) | (p)[3])
void
-usage()
+usage(void)
{
printf("Usage: %s [-d unit] [-f file] [-l] [-m] [-q] [-t tempo] [-v] [-x] [file ...]\n",
__progname);
@@ -145,8 +145,7 @@ int play = 1;
int fd;
void
-send_event(ev)
- seq_event_rec *ev;
+send_event(seq_event_rec *ev)
{
/*
printf("%02x %02x %02x %02x %02x %02x %02x %02x\n",
@@ -158,8 +157,7 @@ send_event(ev)
}
u_long
-getvar(tp)
- struct track *tp;
+getvar(struct track *tp)
{
u_long r, c;
@@ -172,10 +170,7 @@ getvar(tp)
}
void
-dometa(meta, p, len)
- u_int meta;
- u_char *p;
- u_int len;
+dometa(u_int meta, u_char *p, u_int len)
{
switch (meta) {
case META_TEXT:
@@ -217,7 +212,7 @@ dometa(meta, p, len)
}
void
-midireset()
+midireset(void)
{
/* General MIDI reset sequence */
static u_char gm_reset[] = { 0x7e, 0x7f, 0x09, 0x01, 0xf7 };
@@ -227,9 +222,7 @@ midireset()
#define SYSEX_CHUNK 6
void
-send_sysex(p, l)
- u_char *p;
- u_int l;
+send_sysex(u_char *p, u_int l)
{
seq_event_rec event;
u_int n;
@@ -249,9 +242,7 @@ send_sysex(p, l)
}
void
-playfile(f, name)
- FILE *f;
- char *name;
+playfile(FILE *f, char *name)
{
u_char *buf;
u_int tot, n, size, nread;
@@ -285,10 +276,7 @@ playfile(f, name)
}
void
-playdata(buf, tot, name)
- u_char *buf;
- u_int tot;
- char *name;
+playdata(u_char *buf, u_int tot, char *name)
{
int format, ntrks, divfmt, ticks, t, besttrk = 0;
u_int len, mlen, status, chan;
@@ -487,9 +475,7 @@ playdata(buf, tot, name)
}
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
int ch;
int listdevs = 0;
diff --git a/usr.bin/mktemp/mktemp.c b/usr.bin/mktemp/mktemp.c
index bc0919c6a57..9ac3ce79305 100644
--- a/usr.bin/mktemp/mktemp.c
+++ b/usr.bin/mktemp/mktemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mktemp.c,v 1.11 2003/06/03 01:52:41 millert Exp $ */
+/* $OpenBSD: mktemp.c,v 1.12 2003/06/10 22:20:48 deraadt Exp $ */
/*
* Copyright (c) 1996, 1997, 2001 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: mktemp.c,v 1.11 2003/06/03 01:52:41 millert Exp $";
+static const char rcsid[] = "$OpenBSD: mktemp.c,v 1.12 2003/06/10 22:20:48 deraadt Exp $";
#endif /* not lint */
#include <paths.h>
@@ -30,9 +30,7 @@ static const char rcsid[] = "$OpenBSD: mktemp.c,v 1.11 2003/06/03 01:52:41 mille
__dead void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int ch, fd, uflag = 0, quiet = 0, tflag = 0, makedir = 0;
char *cp, *template, *tempfile, *prefix = _PATH_TMP;
@@ -126,7 +124,7 @@ main(argc, argv)
}
__dead void
-usage()
+usage(void)
{
extern char *__progname;
diff --git a/usr.bin/modstat/modstat.c b/usr.bin/modstat/modstat.c
index c42ac481071..d3934849f28 100644
--- a/usr.bin/modstat/modstat.c
+++ b/usr.bin/modstat/modstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modstat.c,v 1.20 2003/01/18 23:30:20 deraadt Exp $ */
+/* $OpenBSD: modstat.c,v 1.21 2003/06/10 22:20:48 deraadt Exp $ */
/*
* Copyright (c) 1993 Terrence R. Lambert.
@@ -108,9 +108,7 @@ dostat(int devfd, int modnum, char *modname)
}
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int c, modnum = -1;
char *modname = NULL;
diff --git a/usr.bin/msgs/msgs.c b/usr.bin/msgs/msgs.c
index f2832eaaea7..f855d050963 100644
--- a/usr.bin/msgs/msgs.c
+++ b/usr.bin/msgs/msgs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msgs.c,v 1.26 2003/06/03 02:56:13 millert Exp $ */
+/* $OpenBSD: msgs.c,v 1.27 2003/06/10 22:20:48 deraadt Exp $ */
/* $NetBSD: msgs.c,v 1.7 1995/09/28 06:57:40 tls Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)msgs.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: msgs.c,v 1.26 2003/06/03 02:56:13 millert Exp $";
+static char rcsid[] = "$OpenBSD: msgs.c,v 1.27 2003/06/10 22:20:48 deraadt Exp $";
#endif
#endif /* not lint */
@@ -158,9 +158,7 @@ bool lastcmd = NO;
jmp_buf tstpbuf;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
bool newrc, already;
int rcfirst = 0; /* first message to print (from .rc) */
@@ -634,8 +632,7 @@ cmnd:
}
void
-prmesg(length)
-int length;
+prmesg(int length)
{
FILE *outf;
char *env_pager;
@@ -682,8 +679,7 @@ int length;
}
void
-onintr(unused)
- int unused;
+onintr(int unused)
{
signal(SIGINT, onintr);
if (mailing)
@@ -708,8 +704,7 @@ onintr(unused)
* We have just gotten a susp. Suspend and prepare to resume.
*/
void
-onsusp(unused)
- int unused;
+onsusp(int unused)
{
sigset_t emptyset;
@@ -723,8 +718,7 @@ onsusp(unused)
}
int
-linecnt(f)
- FILE *f;
+linecnt(FILE *f)
{
off_t oldpos = ftell(f);
int l = 0;
@@ -738,9 +732,7 @@ linecnt(f)
}
int
-next(buf, len)
- char *buf;
- int len;
+next(char *buf, int len)
{
int i;
sscanf(buf, "%d", &i);
@@ -749,8 +741,7 @@ next(buf, len)
}
void
-ask(prompt)
- char *prompt;
+ask(char *prompt)
{
char inch;
int n, cmsg, fd;
@@ -837,8 +828,7 @@ ask(prompt)
}
void
-gfrsub(infile)
- FILE *infile;
+gfrsub(FILE *infile)
{
off_t frompos;
@@ -916,8 +906,7 @@ gfrsub(infile)
}
char *
-nxtfld(s)
- char *s;
+nxtfld(char *s)
{
if (*s) while (*s && *s > ' ') s++; /* skip over this field */
if (*s) while (*s && *s <= ' ') s++; /* find start of next field */
diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c
index 4ee75a93cbb..0f7f3e2cff7 100644
--- a/usr.bin/nc/netcat.c
+++ b/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.57 2002/12/30 18:00:18 stevesk Exp $ */
+/* $OpenBSD: netcat.c,v 1.58 2003/06/10 22:20:48 deraadt Exp $ */
/*
* Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
*
@@ -707,7 +707,7 @@ udptest(int s)
}
void
-help()
+help(void)
{
usage(0);
fprintf(stderr, "\tCommand Summary:\n\
diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c
index f8d08bc2ba9..5287d588615 100644
--- a/usr.bin/nfsstat/nfsstat.c
+++ b/usr.bin/nfsstat/nfsstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsstat.c,v 1.18 2003/06/03 02:56:13 millert Exp $ */
+/* $OpenBSD: nfsstat.c,v 1.19 2003/06/10 22:20:49 deraadt Exp $ */
/* $NetBSD: nfsstat.c,v 1.7 1996/03/03 17:21:30 thorpej Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
static char sccsid[] = "from: @(#)nfsstat.c 8.1 (Berkeley) 6/6/93";
static char *rcsid = "$NetBSD: nfsstat.c,v 1.7 1996/03/03 17:21:30 thorpej Exp $";
#else
-static char *rcsid = "$OpenBSD: nfsstat.c,v 1.18 2003/06/03 02:56:13 millert Exp $";
+static char *rcsid = "$OpenBSD: nfsstat.c,v 1.19 2003/06/10 22:20:49 deraadt Exp $";
#endif
#endif /* not lint */
@@ -88,9 +88,7 @@ void sidewaysintpr(u_int, u_int);
void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
extern int optind;
extern char *optarg;
@@ -185,8 +183,7 @@ main(argc, argv)
}
void
-getnfsstats(p)
- struct nfsstats *p;
+getnfsstats(struct nfsstats *p)
{
if (kd) {
if (kvm_read(kd, nl[N_NFSSTAT].n_value, p, sizeof(*p)) != sizeof(*p))
@@ -208,8 +205,7 @@ getnfsstats(p)
* Print a description of the nfs stats.
*/
void
-intpr(display)
- u_int display;
+intpr(u_int display)
{
struct nfsstats nfsstats;
@@ -346,9 +342,7 @@ intpr(display)
* First line printed at top of screen is always cumulative.
*/
void
-sidewaysintpr(interval, display)
- u_int interval;
- u_int display;
+sidewaysintpr(u_int interval, u_int display)
{
struct nfsstats nfsstats, lastst;
int hdrcnt;
@@ -402,7 +396,7 @@ sidewaysintpr(interval, display)
}
void
-printhdr()
+printhdr(void)
{
printf(" %8.8s %8.8s %8.8s %8.8s %8.8s %8.8s %8.8s %8.8s\n",
"Getattr", "Lookup", "Readlink", "Read", "Write", "Rename",
@@ -415,13 +409,13 @@ printhdr()
* Sets a flag to not wait for the alarm.
*/
void
-catchalarm()
+catchalarm(void)
{
signalled = 1;
}
void
-usage()
+usage(void)
{
extern char *__progname;
fprintf(stderr,
diff --git a/usr.bin/nice/nice.c b/usr.bin/nice/nice.c
index c68f9ba860e..1fcebb2079d 100644
--- a/usr.bin/nice/nice.c
+++ b/usr.bin/nice/nice.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nice.c,v 1.8 2003/06/03 02:56:13 millert Exp $ */
+/* $OpenBSD: nice.c,v 1.9 2003/06/10 22:20:49 deraadt Exp $ */
/* $NetBSD: nice.c,v 1.9 1995/08/31 23:30:58 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ char copyright[] =
#if 0
static char sccsid[] = "@(#)nice.c 5.4 (Berkeley) 6/1/90";
#endif
-static char rcsid[] = "$OpenBSD: nice.c,v 1.8 2003/06/03 02:56:13 millert Exp $";
+static char rcsid[] = "$OpenBSD: nice.c,v 1.9 2003/06/10 22:20:49 deraadt Exp $";
#endif /* not lint */
#include <sys/time.h>
@@ -59,9 +59,7 @@ int main(int, char **);
static void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int niceness = DEFNICE;
int c;
@@ -107,7 +105,7 @@ main(argc, argv)
}
static void
-usage()
+usage(void)
{
extern char *__progname;
fprintf(stderr, "usage: %s [ -n increment ] utility [ argument ...]\n",
diff --git a/usr.bin/nm/nm.c b/usr.bin/nm/nm.c
index 8a1ba72838f..cb69fc4c2fa 100644
--- a/usr.bin/nm/nm.c
+++ b/usr.bin/nm/nm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nm.c,v 1.18 2003/06/03 02:56:14 millert Exp $ */
+/* $OpenBSD: nm.c,v 1.19 2003/06/10 22:20:49 deraadt Exp $ */
/* $NetBSD: nm.c,v 1.7 1996/01/14 23:04:03 pk Exp $ */
/*
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)nm.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: nm.c,v 1.18 2003/06/03 02:56:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: nm.c,v 1.19 2003/06/10 22:20:49 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -98,9 +98,7 @@ void print_symbol(const char *, struct nlist *);
* parse command line, execute process_file() for each file
* specified on the command line.
*/
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
extern int optind;
int ch, errors;
@@ -170,8 +168,7 @@ main(argc, argv)
* show symbols in the file given as an argument. Accepts archive and
* object files as input.
*/
-process_file(fname)
- char *fname;
+process_file(char *fname)
{
struct exec exec_head;
FILE *fp;
@@ -216,9 +213,7 @@ process_file(fname)
* show_archive()
* show symbols in the given archive file
*/
-show_archive(fname, fp)
- char *fname;
- FILE *fp;
+show_archive(char *fname, FILE *fp)
{
struct ar_hdr ar_head;
struct exec exec_head;
@@ -332,9 +327,7 @@ skip: if (fseek(fp, last_ar_off + even(atol(ar_head.ar_size)),
* file pointer for fp is expected to be at the beginning of an a.out
* header.
*/
-show_objfile(objname, fp)
- char *objname;
- FILE *fp;
+show_objfile(char *objname, FILE *fp)
{
struct nlist *names, *np;
struct nlist **snames;
@@ -467,8 +460,7 @@ show_objfile(objname, fp)
}
char *
-symname(sym)
- struct nlist *sym;
+symname(struct nlist *sym)
{
if (demangle && sym->n_un.n_name[0] == '_')
return sym->n_un.n_name + 1;
@@ -481,9 +473,7 @@ symname(sym)
* show one symbol
*/
void
-print_symbol(objname, sym)
- const char *objname;
- struct nlist *sym;
+print_symbol(const char *objname, struct nlist *sym)
{
if (print_file_each_line)
(void)printf("%s:", objname);
@@ -520,8 +510,7 @@ print_symbol(objname, sym)
}
char *
-otherstring(sym)
- struct nlist *sym;
+otherstring(struct nlist *sym)
{
static char buf[3];
char *result;
@@ -543,8 +532,7 @@ otherstring(sym)
* return the a description string for an STAB entry
*/
char *
-typestring(type)
- unsigned int type;
+typestring(unsigned int type)
{
switch(type) {
case N_BCOMM:
@@ -598,8 +586,7 @@ typestring(type)
* external, lower case for internal symbols.
*/
char
-typeletter(type)
- unsigned int type;
+typeletter(unsigned int type)
{
switch(SYMBOL_TYPE(type)) {
case N_ABS:
@@ -629,8 +616,7 @@ typeletter(type)
}
int
-fname(a0, b0)
- const void *a0, *b0;
+fname(const void *a0, const void *b0)
{
struct nlist * const *a = a0, * const *b = b0;
@@ -638,8 +624,7 @@ fname(a0, b0)
}
int
-rname(a0, b0)
- const void *a0, *b0;
+rname(const void *a0, const void *b0)
{
struct nlist * const *a = a0, * const *b = b0;
@@ -647,8 +632,7 @@ rname(a0, b0)
}
int
-value(a0, b0)
- const void *a0, *b0;
+value(const void *a0, const void *b0)
{
struct nlist * const *a = a0, * const *b = b0;
@@ -671,8 +655,7 @@ value(a0, b0)
}
void *
-emalloc(size)
- size_t size;
+emalloc(size_t size)
{
char *p;
@@ -685,7 +668,7 @@ emalloc(size)
#define CPPFILT "/usr/bin/c++filt"
void
-pipe2cppfilt()
+pipe2cppfilt(void)
{
int pip[2];
char *argv[2];
@@ -712,7 +695,7 @@ pipe2cppfilt()
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: nm [-aCgnopruw] [file ...]\n");
exit(1);
diff --git a/usr.bin/paste/paste.c b/usr.bin/paste/paste.c
index 3e204930573..202ef138699 100644
--- a/usr.bin/paste/paste.c
+++ b/usr.bin/paste/paste.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: paste.c,v 1.11 2003/06/03 02:56:14 millert Exp $ */
+/* $OpenBSD: paste.c,v 1.12 2003/06/10 22:20:49 deraadt Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -40,7 +40,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)paste.c 5.7 (Berkeley) 10/30/90";*/
-static char rcsid[] = "$OpenBSD: paste.c,v 1.11 2003/06/03 02:56:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: paste.c,v 1.12 2003/06/10 22:20:49 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -60,9 +60,7 @@ void parallel(char **);
void sequential(char **);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
extern char *optarg;
extern int optind;
@@ -104,8 +102,7 @@ typedef struct _list {
} LIST;
void
-parallel(argv)
- char **argv;
+parallel(char **argv)
{
LIST *lp;
int cnt;
@@ -186,8 +183,7 @@ parallel(argv)
}
void
-sequential(argv)
- char **argv;
+sequential(char **argv)
{
FILE *fp;
int cnt;
@@ -235,8 +231,7 @@ sequential(argv)
}
int
-tr(arg)
- char *arg;
+tr(char *arg)
{
int cnt;
char ch, *p;
@@ -267,7 +262,7 @@ tr(arg)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "paste: [-s] [-d delimiters] file ...\n");
exit(1);
diff --git a/usr.bin/pctr/pctr.c b/usr.bin/pctr/pctr.c
index e22433caf51..fba54d6e94e 100644
--- a/usr.bin/pctr/pctr.c
+++ b/usr.bin/pctr/pctr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pctr.c,v 1.9 2002/12/15 13:16:12 henning Exp $ */
+/* $OpenBSD: pctr.c,v 1.10 2003/06/10 22:20:49 deraadt Exp $ */
/*
* Pentium performance counter control program for OpenBSD.
@@ -242,7 +242,7 @@ struct ctrfn p6fn[] = {
};
static void
-printdesc (char *desc)
+printdesc(char *desc)
{
char *p;
@@ -267,7 +267,7 @@ printdesc (char *desc)
/* Print all possible counter functions */
static void
-list (int fam)
+list(int fam)
{
struct ctrfn *cfnp;
@@ -298,7 +298,7 @@ list (int fam)
}
struct ctrfn *
-fn2cfnp (u_int family, u_int sel)
+fn2cfnp(u_int family, u_int sel)
{
struct ctrfn *cfnp;
@@ -316,7 +316,7 @@ fn2cfnp (u_int family, u_int sel)
}
static char *
-fn2str (int family, u_int sel)
+fn2str(int family, u_int sel)
{
static char buf[128];
char um[9] = "";
@@ -332,8 +332,7 @@ fn2str (int family, u_int sel)
sel & P5CTR_U ? 'u' : '-',
sel & P5CTR_K ? 'k' : '-',
fn, cfnp ? cfnp->name : "unknown function");
- }
- else if (family == 6) {
+ } else if (family == 6) {
fn = sel & 0xff;
cfnp = fn2cfnp (family, fn);
if (cfnp && cfnp->flags & CFL_MESI)
@@ -354,15 +353,14 @@ fn2str (int family, u_int sel)
sel & P6CTR_U ? 'u' : '-',
fn, cm, um, 7 - (strlen (cm) + strlen (um)), "",
cfnp ? cfnp->name : "unknown function");
- }
- else
+ } else
return (NULL);
return (buf);
}
/* Print status of counters */
static void
-readst (void)
+readst(void)
{
int fd, i;
struct pctrst st;
@@ -383,7 +381,7 @@ readst (void)
}
static void
-setctr (int ctr, u_int val)
+setctr(int ctr, u_int val)
{
int fd;
@@ -396,7 +394,7 @@ setctr (int ctr, u_int val)
}
static void
-usage (void)
+usage(void)
{
fprintf(stderr,
"usage:\n"
@@ -431,7 +429,7 @@ usage (void)
}
int
-main (int argc, char **argv)
+main(int argc, char **argv)
{
u_int ctr;
char *cp;
@@ -481,7 +479,7 @@ main (int argc, char **argv)
fl |= P6CTR_EN;
if (**ap == '-') {
cp = *ap;
- if (usep6ctr)
+ if (usep6ctr) {
while (*++cp)
switch (*cp) {
case 'i':
@@ -499,7 +497,7 @@ main (int argc, char **argv)
default:
usage ();
}
- else if(usep5ctr)
+ } else if(usep5ctr) {
while (*++cp)
switch (*cp) {
case 'c':
@@ -514,10 +512,10 @@ main (int argc, char **argv)
default:
usage ();
}
+ }
ap++;
ac--;
- }
- else {
+ } else {
if (usep6ctr)
fl |= P6CTR_U|P6CTR_K;
else if (usep5ctr)
@@ -540,7 +538,7 @@ main (int argc, char **argv)
}
cfnp = fn2cfnp (6, fl);
if (usep6ctr && cfnp && (cp = strchr (*ap, '/'))) {
- if (cfnp->flags & CFL_MESI)
+ if (cfnp->flags & CFL_MESI) {
while (*++cp)
switch (*cp) {
case 'm':
@@ -558,7 +556,7 @@ main (int argc, char **argv)
default:
usage ();
}
- else if (cfnp->flags & CFL_SA)
+ } else if (cfnp->flags & CFL_SA) {
while (*++cp)
switch (*cp) {
case 'a':
@@ -567,10 +565,9 @@ main (int argc, char **argv)
default:
usage ();
}
- else
+ } else
usage ();
- }
- else if (cfnp && (cfnp->flags & CFL_MESI))
+ } else if (cfnp && (cfnp->flags & CFL_MESI))
fl |= P6CTR_UM_MESI;
ap++;
ac--;
@@ -581,8 +578,7 @@ main (int argc, char **argv)
if (usep6ctr && ! (fl & 0xff))
fl = 0;
setctr (ctr, fl);
- }
- else
+ } else
usage ();
return 0;
diff --git a/usr.bin/pmdb/pmdb.c b/usr.bin/pmdb/pmdb.c
index f60a2b41938..3a4edf151fb 100644
--- a/usr.bin/pmdb/pmdb.c
+++ b/usr.bin/pmdb/pmdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmdb.c,v 1.16 2003/05/15 00:11:03 jfb Exp $ */
+/* $OpenBSD: pmdb.c,v 1.17 2003/06/10 22:20:49 deraadt Exp $ */
/*
* Copyright (c) 2002 Artur Grabowski <art@openbsd.org>
* All rights reserved.
@@ -80,7 +80,7 @@ struct clit cmds[] = {
#define NCMDS sizeof(cmds)/sizeof(cmds[0])
void
-usage()
+usage(void)
{
extern char *__progname;
diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c
index 2fd22532e9d..06514ec8897 100644
--- a/usr.bin/pr/pr.c
+++ b/usr.bin/pr/pr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pr.c,v 1.16 2003/06/03 02:56:14 millert Exp $ */
+/* $OpenBSD: pr.c,v 1.17 2003/06/10 22:20:49 deraadt Exp $ */
/*-
* Copyright (c) 1991 Keith Muller.
@@ -41,7 +41,7 @@ static char copyright[] =
#ifndef lint
/* from: static char sccsid[] = "@(#)pr.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$OpenBSD: pr.c,v 1.16 2003/06/03 02:56:14 millert Exp $";
+static char *rcsid = "$OpenBSD: pr.c,v 1.17 2003/06/10 22:20:49 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -146,9 +146,7 @@ int beheaded = 0; /* header / trailer link */
char digs[] = "0123456789"; /* page number translation map */
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ret_val;
diff --git a/usr.bin/printenv/printenv.c b/usr.bin/printenv/printenv.c
index f645533396d..044e5506445 100644
--- a/usr.bin/printenv/printenv.c
+++ b/usr.bin/printenv/printenv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printenv.c,v 1.4 2003/06/03 02:56:14 millert Exp $ */
+/* $OpenBSD: printenv.c,v 1.5 2003/06/10 22:20:49 deraadt Exp $ */
/*
* Copyright (c) 1987 Regents of the University of California.
@@ -37,7 +37,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)printenv.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$OpenBSD: printenv.c,v 1.4 2003/06/03 02:56:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: printenv.c,v 1.5 2003/06/10 22:20:49 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -51,9 +51,7 @@ static char rcsid[] = "$OpenBSD: printenv.c,v 1.4 2003/06/03 02:56:14 millert Ex
* February, 1979
*/
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
extern char **environ;
char *cp, **ep;
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c
index 26d9f9a1c1c..8829effeb77 100644
--- a/usr.bin/printf/printf.c
+++ b/usr.bin/printf/printf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printf.c,v 1.9 2003/06/03 02:56:14 millert Exp $ */
+/* $OpenBSD: printf.c,v 1.10 2003/06/10 22:20:49 deraadt Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)printf.c 5.9 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$OpenBSD: printf.c,v 1.9 2003/06/03 02:56:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: printf.c,v 1.10 2003/06/10 22:20:49 deraadt Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -105,12 +105,10 @@ warnx(const char *fmt, ...)
int
#ifdef BUILTIN
-progprintf(argc, argv)
+progprintf(int argc, char *argv[])
#else
-main(argc, argv)
+main(int argc, char *argv[])
#endif
- int argc;
- char **argv;
{
char *fmt, *start;
int fieldwidth, precision;
@@ -262,8 +260,7 @@ main(argc, argv)
* Halts processing string and returns 1 if a \c escape is encountered.
*/
static int
-print_escape_str(str)
- const char *str;
+print_escape_str(const char *str)
{
int value;
int c;
@@ -303,8 +300,7 @@ print_escape_str(str)
* Print "standard" escape characters
*/
static int
-print_escape(str)
- const char *str;
+print_escape(const char *str)
{
const char *start = str;
int value;
@@ -395,9 +391,7 @@ print_escape(str)
}
static char *
-mklong(str, ch)
- const char *str;
- char ch;
+mklong(const char *str, int ch)
{
static char *copy;
static int copysize;
@@ -425,7 +419,7 @@ mklong(str, ch)
}
static int
-getchr()
+getchr(void)
{
if (!*gargv)
return((int)'\0');
@@ -433,7 +427,7 @@ getchr()
}
static char *
-getstr()
+getstr(void)
{
if (!*gargv)
return("");
@@ -442,7 +436,7 @@ getstr()
static char *number = "+-.0123456789";
static int
-getint()
+getint(void)
{
if (!*gargv)
return(0);
@@ -454,7 +448,7 @@ getint()
}
static long
-getlong()
+getlong(void)
{
long val;
char *ep;
@@ -472,7 +466,7 @@ getlong()
}
static unsigned long
-getulong()
+getulong(void)
{
unsigned long val;
char *ep;
@@ -490,7 +484,7 @@ getulong()
}
static double
-getdouble()
+getdouble(void)
{
double val;
char *ep;
@@ -508,9 +502,7 @@ getdouble()
}
static void
-check_conversion(s, ep)
- const char *s;
- const char *ep;
+check_conversion(const char *s, const char *ep)
{
if (*ep) {
if (ep == s)
@@ -525,7 +517,7 @@ check_conversion(s, ep)
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: printf format [arg ...]\n");
}
diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c
index 5170f244a2d..e284ae6a727 100644
--- a/usr.bin/quota/quota.c
+++ b/usr.bin/quota/quota.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: quota.c,v 1.22 2003/06/03 02:56:14 millert Exp $ */
+/* $OpenBSD: quota.c,v 1.23 2003/06/10 22:20:49 deraadt Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@@ -41,7 +41,7 @@ static const char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)quota.c 8.1 (Berkeley) 6/6/93";*/
static const char rcsid[] =
-"$OpenBSD: quota.c,v 1.22 2003/06/03 02:56:14 millert Exp $";
+"$OpenBSD: quota.c,v 1.23 2003/06/10 22:20:49 deraadt Exp $";
#endif /* not lint */
/*
@@ -105,9 +105,7 @@ int qflag;
int vflag;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ngroups;
gid_t mygid, gidset[NGROUPS];
@@ -179,7 +177,7 @@ main(argc, argv)
}
void
-usage()
+usage(void)
{
fprintf(stderr, "%s\n%s\n%s\n",
@@ -193,8 +191,7 @@ usage()
* Print out quotas for a specified user identifier.
*/
void
-showuid(uid)
- uid_t uid;
+showuid(uid_t uid)
{
struct passwd *pwd = getpwuid(uid);
uid_t myuid;
@@ -216,8 +213,7 @@ showuid(uid)
* Print out quotas for a specified user name.
*/
void
-showusrname(name)
- const char *name;
+showusrname(const char *name)
{
struct passwd *pwd = getpwnam(name);
uid_t myuid;
@@ -239,8 +235,7 @@ showusrname(name)
* Print out quotas for a specified group identifier.
*/
void
-showgid(gid)
- gid_t gid;
+showgid(gid_t gid)
{
struct group *grp = getgrgid(gid);
int ngroups;
@@ -274,8 +269,7 @@ showgid(gid)
* Print out quotas for a specified group name.
*/
void
-showgrpname(name)
- const char *name;
+showgrpname(const char *name)
{
struct group *grp = getgrnam(name);
int ngroups;
@@ -306,10 +300,7 @@ showgrpname(name)
}
void
-showquotas(type, id, name)
- int type;
- u_long id;
- const char *name;
+showquotas(int type, u_long id, const char *name)
{
struct quotause *qup;
struct quotause *quplist;
@@ -396,10 +387,7 @@ showquotas(type, id, name)
}
void
-heading(type, id, name, tag)
- int type;
- u_long id;
- const char *name, *tag;
+heading(int type, u_long id, const char *name, const char *tag)
{
printf("Disk quotas for %s %s (%cid %ld): %s\n", qfextension[type],
@@ -422,8 +410,7 @@ heading(type, id, name, tag)
* Calculate the grace period and return a printable string for it.
*/
char *
-timeprt(seconds)
- time_t seconds;
+timeprt(time_t seconds)
{
time_t hours, minutes;
static char buf[20];
@@ -454,9 +441,7 @@ timeprt(seconds)
* Collect the requested quota information.
*/
struct quotause *
-getprivs(id, quotatype)
- long id;
- int quotatype;
+getprivs(long id, int quotatype)
{
struct quotause *qup, *quptail;
struct fstab *fs;
@@ -516,10 +501,7 @@ getprivs(id, quotatype)
* Check to see if a particular quota is to be enabled.
*/
int
-ufshasquota(fs, type, qfnamep)
- struct fstab *fs;
- int type;
- char **qfnamep;
+ufshasquota(struct fstab *fs, int type, char **qfnamep)
{
static char initname, usrname[100], grpname[100];
static char buf[BUFSIZ];
@@ -556,12 +538,8 @@ ufshasquota(fs, type, qfnamep)
}
int
-getufsquota(fst, fs, qup, id, quotatype)
- struct statfs *fst;
- struct fstab *fs;
- struct quotause *qup;
- long id;
- int quotatype;
+getufsquota(struct statfs *fst, struct fstab *fs, struct quotause *qup,
+ long id, int quotatype)
{
char *qfpathname;
int fd, qcmd;
@@ -597,12 +575,8 @@ getufsquota(fst, fs, qup, id, quotatype)
}
int
-getnfsquota(fst, fs, qup, id, quotatype)
- struct statfs *fst;
- struct fstab *fs;
- struct quotause *qup;
- long id;
- int quotatype;
+getnfsquota(struct statfs *fst, struct fstab *fs, struct quotause *qup,
+ long id, int quotatype)
{
struct getquota_args gq_args;
struct getquota_rslt gq_rslt;
@@ -684,13 +658,8 @@ getnfsquota(fst, fs, qup, id, quotatype)
}
int
-callaurpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
- char *host;
- int prognum, versnum, procnum;
- xdrproc_t inproc;
- void *in;
- xdrproc_t outproc;
- void *out;
+callaurpc(char *host, int prognum, int versnum, int procnum,
+ xdrproc_t inproc, void *in, xdrproc_t outproc, void *out)
{
struct sockaddr_in server_addr;
enum clnt_stat clnt_stat;
@@ -724,8 +693,7 @@ callaurpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
}
int
-alldigits(s)
- char *s;
+alldigits(char *s)
{
int c;
diff --git a/usr.bin/readlink/readlink.c b/usr.bin/readlink/readlink.c
index 5e2bfdbdd04..00b37d55a29 100644
--- a/usr.bin/readlink/readlink.c
+++ b/usr.bin/readlink/readlink.c
@@ -1,5 +1,5 @@
/*
- * $OpenBSD: readlink.c,v 1.18 1998/08/24 14:45:33 kstailey Exp $
+ * $OpenBSD: readlink.c,v 1.19 2003/06/10 22:20:50 deraadt Exp $
*
* Copyright (c) 1997
* Kenneth Stailey (hereinafter referred to as the author)
@@ -35,9 +35,7 @@
#include <unistd.h>
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
char buf[PATH_MAX];
int n, ch, nflag = 0, fflag = 0;
diff --git a/usr.bin/renice/renice.c b/usr.bin/renice/renice.c
index 7323460d7fc..b0c5c24b943 100644
--- a/usr.bin/renice/renice.c
+++ b/usr.bin/renice/renice.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: renice.c,v 1.9 2003/06/03 02:56:15 millert Exp $ */
+/* $OpenBSD: renice.c,v 1.10 2003/06/10 22:20:50 deraadt Exp $ */
/*
* Copyright (c) 1983, 1989, 1993
@@ -39,7 +39,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)renice.c 8.1 (Berkeley) 6/9/93";
#else
-static char rcsid[] = "$OpenBSD: renice.c,v 1.9 2003/06/03 02:56:15 millert Exp $";
+static char rcsid[] = "$OpenBSD: renice.c,v 1.10 2003/06/10 22:20:50 deraadt Exp $";
#endif
#endif /* not lint */
@@ -63,9 +63,7 @@ void usage(void);
* running.
*/
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int which = PRIO_PROCESS;
int errs = 0;
@@ -117,10 +115,7 @@ main(argc, argv)
}
int
-donice(which, who, prio)
- int which;
- uid_t who;
- int prio;
+donice(int which, uid_t who, int prio)
{
int oldprio;
@@ -138,7 +133,7 @@ donice(which, who, prio)
}
void
-usage()
+usage(void)
{
extern char *__progname;
diff --git a/usr.bin/rev/rev.c b/usr.bin/rev/rev.c
index 30c797dc344..420a916415b 100644
--- a/usr.bin/rev/rev.c
+++ b/usr.bin/rev/rev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rev.c,v 1.6 2003/06/03 02:56:15 millert Exp $ */
+/* $OpenBSD: rev.c,v 1.7 2003/06/10 22:20:50 deraadt Exp $ */
/* $NetBSD: rev.c,v 1.5 1995/09/28 08:49:40 tls Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)rev.c 8.3 (Berkeley) 5/4/95";
#else
-static char rcsid[] = "$OpenBSD: rev.c,v 1.6 2003/06/03 02:56:15 millert Exp $";
+static char rcsid[] = "$OpenBSD: rev.c,v 1.7 2003/06/10 22:20:50 deraadt Exp $";
#endif
#endif /* not lint */
@@ -56,9 +56,7 @@ static char rcsid[] = "$OpenBSD: rev.c,v 1.6 2003/06/03 02:56:15 millert Exp $";
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
char *filename, *p, *t;
FILE *fp;
@@ -106,7 +104,7 @@ main(argc, argv)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: rev [file ...]\n");
exit(1);
diff --git a/usr.bin/rpcinfo/rpcinfo.c b/usr.bin/rpcinfo/rpcinfo.c
index e901dfb6995..ddcaf19e6ac 100644
--- a/usr.bin/rpcinfo/rpcinfo.c
+++ b/usr.bin/rpcinfo/rpcinfo.c
@@ -1,9 +1,9 @@
-/* $OpenBSD: rpcinfo.c,v 1.8 2001/11/19 19:02:16 mpech Exp $ */
+/* $OpenBSD: rpcinfo.c,v 1.9 2003/06/10 22:20:50 deraadt Exp $ */
#ifndef lint
/*static char sccsid[] = "from: @(#)rpcinfo.c 1.22 87/08/12 SMI";*/
/*static char sccsid[] = "from: @(#)rpcinfo.c 2.2 88/08/11 4.0 RPCSRC";*/
-static char rcsid[] = "$OpenBSD: rpcinfo.c,v 1.8 2001/11/19 19:02:16 mpech Exp $";
+static char rcsid[] = "$OpenBSD: rpcinfo.c,v 1.9 2003/06/10 22:20:50 deraadt Exp $";
#endif
/*
@@ -88,9 +88,7 @@ void get_inet_address(struct sockaddr_in *addr, char *host);
#define SETS 6 /* set registration for the service */
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int c;
extern char *optarg;
@@ -201,10 +199,7 @@ main(argc, argv)
}
void
-udpping(portnum, argc, argv)
- u_short portnum;
- int argc;
- char **argv;
+udpping(u_short portnum, int argc, char **argv)
{
struct timeval to;
struct sockaddr_in addr;
@@ -340,10 +335,7 @@ udpping(portnum, argc, argv)
}
void
-tcpping(portnum, argc, argv)
- u_short portnum;
- int argc;
- char **argv;
+tcpping(u_short portnum, int argc, char **argv)
{
struct timeval to;
struct sockaddr_in addr;
@@ -473,10 +465,7 @@ tcpping(portnum, argc, argv)
* a good error message.
*/
int
-pstatus(client, prognum, vers)
- CLIENT *client;
- u_long prognum;
- u_long vers;
+pstatus(CLIENT *client, u_long prognum, u_long vers)
{
struct rpc_err rpcerr;
@@ -494,9 +483,7 @@ pstatus(client, prognum, vers)
}
void
-pmapdump(argc, argv)
- int argc;
- char **argv;
+pmapdump(int argc, char **argv)
{
struct sockaddr_in server_addr;
struct hostent *hp;
@@ -565,9 +552,7 @@ pmapdump(argc, argv)
*/
/*ARGSUSED*/
bool_t
-reply_proc(res, who)
- caddr_t res; /* Nothing comes back */
- struct sockaddr_in *who; /* Who sent us the reply */
+reply_proc(caddr_t res, struct sockaddr_in *who)
{
struct hostent *hp;
@@ -579,9 +564,7 @@ reply_proc(res, who)
}
void
-brdcst(argc, argv)
- int argc;
- char **argv;
+brdcst(int argc, char **argv)
{
enum clnt_stat rpc_stat;
u_long prognum, vers_num;
@@ -604,9 +587,7 @@ brdcst(argc, argv)
}
void
-deletereg(argc, argv)
- int argc;
- char **argv;
+deletereg(int argc, char **argv)
{
u_long prog_num, version_num;
@@ -626,9 +607,7 @@ deletereg(argc, argv)
}
void
-setreg(argc, argv)
- int argc;
- char **argv;
+setreg(int argc, char **argv)
{
u_long prog_num, version_num, port_num;
@@ -670,9 +649,7 @@ usage(char *msg)
}
int
-getprognum(arg, ulp)
- char *arg;
- u_long *ulp;
+getprognum(char *arg, u_long *ulp)
{
struct rpcent *rpc;
@@ -690,9 +667,7 @@ getprognum(arg, ulp)
}
int
-getul(arg, ulp)
- char *arg;
- u_long *ulp;
+getul(char *arg, u_long *ulp)
{
u_long ul;
int save_errno = errno;
@@ -713,9 +688,7 @@ fail:
}
void
-get_inet_address(addr, host)
- struct sockaddr_in *addr;
- char *host;
+get_inet_address(struct sockaddr_in *addr, char *host)
{
struct hostent *hp;
diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c
index b207de5c398..9dabaf515f9 100644
--- a/usr.bin/rs/rs.c
+++ b/usr.bin/rs/rs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rs.c,v 1.8 2003/06/03 02:56:15 millert Exp $ */
+/* $OpenBSD: rs.c,v 1.9 2003/06/10 22:20:50 deraadt Exp $ */
/*-
* Copyright (c) 1993
@@ -105,9 +105,7 @@ void putfile(void);
} while(0)
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
getargs(argc, argv);
getfile();
@@ -121,7 +119,7 @@ main(argc, argv)
}
void
-getfile()
+getfile(void)
{
char *p;
char *endp;
@@ -187,7 +185,7 @@ getfile()
}
void
-putfile()
+putfile(void)
{
char **ep;
int i, j, n;
@@ -212,9 +210,7 @@ putfile()
}
void
-prints(s, col)
- char *s;
- int col;
+prints(char *s, int col)
{
int n;
char *p = s;
@@ -232,8 +228,7 @@ prints(s, col)
}
void
-usage(msg, s)
- char *msg, *s;
+usage(char *msg, char *s)
{
warnx(msg, s);
fprintf(stderr,
@@ -242,7 +237,7 @@ usage(msg, s)
}
void
-prepfile()
+prepfile(void)
{
char **ep;
int i;
@@ -335,7 +330,7 @@ prepfile()
char ibuf[BSIZE]; /* two screenfuls should do */
int
-getline() /* get line; maintain curline, curlen; manage storage */
+getline(void) /* get line; maintain curline, curlen; manage storage */
{
static int putlength;
static char *endblock = ibuf + BSIZE;
@@ -368,8 +363,7 @@ getline() /* get line; maintain curline, curlen; manage storage */
}
char **
-getptrs(sp)
- char **sp;
+getptrs(char **sp)
{
char **p;
@@ -384,9 +378,7 @@ getptrs(sp)
}
void
-getargs(ac, av)
- int ac;
- char *av[];
+getargs(int ac, char *av[])
{
char *p;
@@ -495,9 +487,7 @@ getargs(ac, av)
}
char *
-getlist(list, p)
- short **list;
- char *p;
+getlist(short **list, char *p)
{
int count = 1;
char *t;
@@ -527,10 +517,10 @@ getlist(list, p)
return(t - 1);
}
+/* num = number p points to; if (strict) complain */
+/* returns pointer to end of num */
char *
-getnum(num, p, strict) /* num = number p points to; if (strict) complain */
- int *num, strict; /* returns pointer to end of num */
- char *p;
+getnum(int *num, char *p, int strict)
{
char *t = p;
diff --git a/usr.bin/rup/rup.c b/usr.bin/rup/rup.c
index 3a47cc1181c..5c900c0daa9 100644
--- a/usr.bin/rup/rup.c
+++ b/usr.bin/rup/rup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rup.c,v 1.16 2002/05/27 03:14:07 deraadt Exp $ */
+/* $OpenBSD: rup.c,v 1.17 2003/06/10 22:20:50 deraadt Exp $ */
/*-
* Copyright (c) 1993, John Brezak
@@ -34,7 +34,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: rup.c,v 1.16 2002/05/27 03:14:07 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rup.c,v 1.17 2003/06/10 22:20:50 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -66,8 +66,7 @@ void usage(void);
int print_rup_data(char *, statstime *host_stat);
int
-search_host(addr)
- struct in_addr addr;
+search_host(struct in_addr addr)
{
struct host_list *hp;
@@ -82,8 +81,7 @@ search_host(addr)
}
void
-remember_host(addr)
- struct in_addr addr;
+remember_host(struct in_addr addr)
{
struct host_list *hp;
@@ -97,7 +95,6 @@ remember_host(addr)
}
-
struct rup_data {
char *host;
struct statstime statstime;
@@ -106,7 +103,7 @@ struct rup_data *rup_data;
int rup_data_idx = 0;
int rup_data_max = 0;
-enum sort_type {
+enum sort_type {
SORT_NONE,
SORT_HOST,
SORT_LDAV,
@@ -115,10 +112,11 @@ enum sort_type {
enum sort_type sort_type;
int
-compare(d1, d2)
- struct rup_data *d1;
- struct rup_data *d2;
+compare(const void *v1, const void *v2)
{
+ const struct rup_data *d1 = v1;
+ const struct rup_data *d2 = v2;
+
switch(sort_type) {
case SORT_HOST:
return strcmp(d1->host, d2->host);
@@ -126,7 +124,7 @@ compare(d1, d2)
return d1->statstime.avenrun[0]
- d2->statstime.avenrun[0];
case SORT_UPTIME:
- return d1->statstime.boottime.tv_sec
+ return d1->statstime.boottime.tv_sec
- d2->statstime.boottime.tv_sec;
default:
/* something's really wrong here */
@@ -135,13 +133,11 @@ compare(d1, d2)
}
void
-remember_rup_data(host, st)
- char *host;
- struct statstime *st;
+remember_rup_data(char *host, struct statstime *st)
{
if (rup_data_idx >= rup_data_max) {
rup_data_max += 16;
- rup_data = realloc(rup_data,
+ rup_data = realloc(rup_data,
rup_data_max * sizeof(struct rup_data));
if (rup_data == NULL) {
err(1, NULL);
@@ -156,9 +152,7 @@ remember_rup_data(host, st)
int
-rstat_reply(replyp, raddrp)
- char *replyp;
- struct sockaddr_in *raddrp;
+rstat_reply(char *replyp, struct sockaddr_in *raddrp)
{
struct hostent *hp;
char *host;
@@ -185,9 +179,7 @@ rstat_reply(replyp, raddrp)
int
-print_rup_data(host, host_stat)
- char *host;
- statstime *host_stat;
+print_rup_data(char *host, statstime *host_stat)
{
unsigned int ups = 0, upm = 0, uph = 0, upd = 0;
struct tm *tmp_time, host_time;
@@ -244,8 +236,7 @@ print_rup_data(host, host_stat)
void
-onehost(host)
- char *host;
+onehost(char *host)
{
CLIENT *rstat_clnt;
statstime host_stat;
@@ -273,7 +264,7 @@ onehost(host)
}
void
-allhosts()
+allhosts(void)
{
statstime host_stat;
enum clnt_stat clnt_stat;
@@ -305,9 +296,7 @@ allhosts()
}
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch;
extern int optind;
@@ -346,7 +335,7 @@ main(argc, argv)
void
-usage()
+usage(void)
{
fprintf(stderr, "Usage: rup [-dhlt] [hosts ...]\n");
exit(1);
diff --git a/usr.bin/ruptime/ruptime.c b/usr.bin/ruptime/ruptime.c
index 18e78c08813..b26c5875ae2 100644
--- a/usr.bin/ruptime/ruptime.c
+++ b/usr.bin/ruptime/ruptime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ruptime.c,v 1.9 2003/06/03 02:56:15 millert Exp $ */
+/* $OpenBSD: ruptime.c,v 1.10 2003/06/10 22:20:50 deraadt Exp $ */
/*
* Copyright (c) 1983 The Regents of the University of California.
@@ -37,7 +37,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)ruptime.c 5.8 (Berkeley) 7/21/90";*/
-static char rcsid[] = "$OpenBSD: ruptime.c,v 1.9 2003/06/03 02:56:15 millert Exp $";
+static char rcsid[] = "$OpenBSD: ruptime.c,v 1.10 2003/06/10 22:20:50 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -67,9 +67,7 @@ int hscmp(), ucmp(), lcmp(), tcmp();
void morehosts(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
extern char *optarg;
extern int optind;
@@ -178,9 +176,7 @@ main(argc, argv)
}
char *
-interval(tval, updown)
- time_t tval;
- char *updown;
+interval(time_t tval, char *updown)
{
static char resbuf[32];
int days, hours, minutes;
@@ -203,8 +199,7 @@ interval(tval, updown)
/* alphabetical comparison */
int
-hscmp(a1, a2)
- void *a1, *a2;
+hscmp(void *a1, void *a2)
{
struct hs *h1 = a1, *h2 = a2;
@@ -213,8 +208,7 @@ hscmp(a1, a2)
/* load average comparison */
int
-lcmp(a1, a2)
- void *a1, *a2;
+lcmp(void *a1, void *a2)
{
struct hs *h1 = a1, *h2 = a2;
@@ -232,8 +226,7 @@ lcmp(a1, a2)
/* number of users comparison */
int
-ucmp(a1, a2)
- void *a1, *a2;
+ucmp(void *a1, void *a2)
{
struct hs *h1 = a1, *h2 = a2;
@@ -250,8 +243,7 @@ ucmp(a1, a2)
/* uptime comparison */
int
-tcmp(a1, a2)
- void *a1, *a2;
+tcmp(void *a1, void *a2)
{
struct hs *h1 = a1, *h2 = a2;
@@ -265,7 +257,7 @@ tcmp(a1, a2)
}
void
-morehosts()
+morehosts(void)
{
hs = realloc((char *)hs, (hspace *= 2) * sizeof(*hs));
if (hs == NULL) {
diff --git a/usr.bin/rusers/rusers.c b/usr.bin/rusers/rusers.c
index 148eebe3015..f977a54baf0 100644
--- a/usr.bin/rusers/rusers.c
+++ b/usr.bin/rusers/rusers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rusers.c,v 1.23 2003/06/04 17:37:16 deraadt Exp $ */
+/* $OpenBSD: rusers.c,v 1.24 2003/06/10 22:20:50 deraadt Exp $ */
/*
* Copyright (c) 2001, 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -44,7 +44,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: rusers.c,v 1.23 2003/06/04 17:37:16 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: rusers.c,v 1.24 2003/06/10 22:20:50 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -672,7 +672,7 @@ print_entry(struct host_info *entry, int longfmt)
}
void
-expandhosts()
+expandhosts(void)
{
struct host_info *new_hostinfo, *entry;
u_int count;
@@ -699,7 +699,7 @@ expandhosts()
}
void
-sorthosts()
+sorthosts(void)
{
int i;
int (*compar)(const void *, const void *);
diff --git a/usr.bin/rwall/rwall.c b/usr.bin/rwall/rwall.c
index e1b7e57a188..391f8bdafec 100644
--- a/usr.bin/rwall/rwall.c
+++ b/usr.bin/rwall/rwall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rwall.c,v 1.7 2003/06/03 02:56:15 millert Exp $ */
+/* $OpenBSD: rwall.c,v 1.8 2003/06/10 22:20:50 deraadt Exp $ */
/*
* Copyright (c) 1993 Christopher G. Demetriou
@@ -38,7 +38,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)wall.c 5.14 (Berkeley) 3/2/91";*/
-static char rcsid[] = "$OpenBSD: rwall.c,v 1.7 2003/06/03 02:56:15 millert Exp $";
+static char rcsid[] = "$OpenBSD: rwall.c,v 1.8 2003/06/10 22:20:50 deraadt Exp $";
#endif /* not lint */
/*
@@ -67,9 +67,7 @@ char *mbuf;
void makemsg ();
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
char *wallhost, res;
CLIENT *cl;
@@ -111,8 +109,7 @@ main(argc, argv)
}
void
-makemsg(fname)
- char *fname;
+makemsg(char *fname)
{
struct tm *lt;
struct passwd *pw;
diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c
index e94efad6029..38dd56fbfcd 100644
--- a/usr.bin/script/script.c
+++ b/usr.bin/script/script.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: script.c,v 1.18 2003/06/03 02:56:15 millert Exp $ */
+/* $OpenBSD: script.c,v 1.19 2003/06/10 22:20:50 deraadt Exp $ */
/* $NetBSD: script.c,v 1.3 1994/12/21 08:55:43 jtc Exp $ */
/*
@@ -65,7 +65,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: script.c,v 1.18 2003/06/03 02:56:15 millert Exp $";
+static char rcsid[] = "$OpenBSD: script.c,v 1.19 2003/06/10 22:20:50 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -108,9 +108,7 @@ void scriptflush(int);
void handlesigwinch(int);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct sigaction sa;
struct termios rtt;
@@ -198,8 +196,7 @@ main(argc, argv)
}
void
-finish(signo)
- int signo;
+finish(int signo)
{
int save_errno = errno;
int status, e = 1;
@@ -217,8 +214,7 @@ finish(signo)
}
void
-handlesigwinch(signo)
- int signo;
+handlesigwinch(int signo)
{
int save_errno = errno;
struct winsize win;
@@ -233,7 +229,7 @@ handlesigwinch(signo)
}
void
-dooutput()
+dooutput(void)
{
struct sigaction sa;
struct itimerval value;
@@ -281,14 +277,13 @@ dooutput()
}
void
-scriptflush(signo)
- int signo;
+scriptflush(int signo)
{
flush = 1;
}
void
-doshell()
+doshell(void)
{
char *shell;
@@ -305,7 +300,7 @@ doshell()
}
void
-fail()
+fail(void)
{
(void)kill(0, SIGTERM);
@@ -313,8 +308,7 @@ fail()
}
void
-done(eval)
- int eval;
+done(int eval)
{
time_t tvec;
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c
index c32191fb097..e8672d27e81 100644
--- a/usr.bin/sed/compile.c
+++ b/usr.bin/sed/compile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compile.c,v 1.14 2003/06/03 02:56:16 millert Exp $ */
+/* $OpenBSD: compile.c,v 1.15 2003/06/10 22:20:50 deraadt Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -35,7 +35,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)compile.c 8.2 (Berkeley) 4/28/95"; */
-static char *rcsid = "$OpenBSD: compile.c,v 1.14 2003/06/03 02:56:16 millert Exp $";
+static char *rcsid = "$OpenBSD: compile.c,v 1.15 2003/06/10 22:20:50 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -128,7 +128,7 @@ struct s_command *prog;
* Initialise appends.
*/
void
-compile()
+compile(void)
{
*compile_stream(&prog) = NULL;
fixuplabel(prog, NULL);
@@ -144,8 +144,7 @@ compile()
} while (0)
static struct s_command **
-compile_stream(link)
- struct s_command **link;
+compile_stream(struct s_command **link)
{
char *p;
static char lbuf[_POSIX2_LINE_MAX + 1]; /* To save stack */
@@ -335,8 +334,7 @@ nonsel: /* Now parse the command */
* with the processed string.
*/
static char *
-compile_delimited(p, d)
- char *p, *d;
+compile_delimited(char *p, char *d)
{
char c;
@@ -374,9 +372,7 @@ compile_delimited(p, d)
/* compile_ccl: expand a POSIX character class */
static char *
-compile_ccl(sp, t)
- char **sp;
- char *t;
+compile_ccl(char **sp, char *t)
{
int c, d;
char *s = *sp;
@@ -407,9 +403,7 @@ compile_ccl(sp, t)
* Cflags are passed to regcomp.
*/
static char *
-compile_re(p, repp)
- char *p;
- regex_t **repp;
+compile_re(char *p, regex_t **repp)
{
int eval;
char re[_POSIX2_LINE_MAX + 1];
@@ -433,9 +427,7 @@ compile_re(p, repp)
* expressions.
*/
static char *
-compile_subst(p, s)
- char *p;
- struct s_subst *s;
+compile_subst(char *p, struct s_subst *s)
{
static char lbuf[_POSIX2_LINE_MAX + 1];
int asize, ref, size;
@@ -493,9 +485,7 @@ compile_subst(p, s)
* Compile the flags of the s command
*/
static char *
-compile_flags(p, s)
- char *p;
- struct s_subst *s;
+compile_flags(char *p, struct s_subst *s)
{
int gn; /* True if we have seen g or n */
char wfile[_POSIX2_LINE_MAX + 1], *q;
@@ -568,9 +558,7 @@ compile_flags(p, s)
* Compile a translation set of strings into a lookup table.
*/
static char *
-compile_tr(p, transtab)
- char *p;
- char **transtab;
+compile_tr(char *p, char **transtab)
{
int i;
char *lt, *op, *np;
@@ -609,7 +597,7 @@ compile_tr(p, transtab)
* Compile the text following an a, c, or i command.
*/
static char *
-compile_text()
+compile_text(void)
{
int asize, esc_nl, size;
char *text, *p, *op, *s;
@@ -646,9 +634,7 @@ compile_text()
* it. Fill the structure pointed to according to the address.
*/
static char *
-compile_addr(p, a)
- char *p;
- struct s_addr *a;
+compile_addr(char *p, struct s_addr *a)
{
char *end;
@@ -683,9 +669,7 @@ compile_addr(p, a)
* Return a copy of all the characters up to \n or \0.
*/
static char *
-duptoeol(s, ctype)
- char *s;
- char *ctype;
+duptoeol(char *s, char *ctype)
{
size_t len;
int ws;
@@ -709,8 +693,7 @@ duptoeol(s, ctype)
* TODO: Remove } nodes
*/
static void
-fixuplabel(cp, end)
- struct s_command *cp, *end;
+fixuplabel(struct s_command *cp, struct s_command *end)
{
for (; cp != end; cp = cp->next)
@@ -741,8 +724,7 @@ fixuplabel(cp, end)
* Associate the given command label for later lookup.
*/
static void
-enterlabel(cp)
- struct s_command *cp;
+enterlabel(struct s_command *cp)
{
struct labhash **lhp, *lh;
u_char *p;
@@ -767,8 +749,7 @@ enterlabel(cp)
* list cp. L is excluded from the search. Return NULL if not found.
*/
static struct s_command *
-findlabel(name)
- char *name;
+findlabel(char *name)
{
struct labhash *lh;
u_char *p;
@@ -790,7 +771,7 @@ findlabel(name)
* table space.
*/
static void
-uselabel()
+uselabel(void)
{
struct labhash *lh, *next;
int i;
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 09bc212eba3..214d0a7acca 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.8 2003/06/03 02:56:16 millert Exp $ */
+/* $OpenBSD: main.c,v 1.9 2003/06/10 22:20:50 deraadt Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -41,7 +41,7 @@ static char copyright[] =
#ifndef lint
/* from: static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94"; */
-static char *rcsid = "$OpenBSD: main.c,v 1.8 2003/06/03 02:56:16 millert Exp $";
+static char *rcsid = "$OpenBSD: main.c,v 1.9 2003/06/10 22:20:50 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -102,9 +102,7 @@ static void add_compunit(enum e_cut, char *);
static void add_file(char *);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int c, fflag;
@@ -160,9 +158,7 @@ main(argc, argv)
* together. Empty strings and files are ignored.
*/
char *
-cu_fgets(buf, n)
- char *buf;
- int n;
+cu_fgets(char *buf, int n)
{
static enum {ST_EOF, ST_FILE, ST_STRING} state = ST_EOF;
static FILE *f; /* Current open file */
@@ -247,9 +243,7 @@ again:
* Set len to the length of the line.
*/
int
-mf_fgets(sp, spflag)
- SPACE *sp;
- enum e_spflag spflag;
+mf_fgets(SPACE *sp, enum e_spflag spflag)
{
static FILE *f; /* Current open file */
size_t len;
@@ -321,9 +315,7 @@ mf_fgets(sp, spflag)
* Add a compilation unit to the linked list
*/
static void
-add_compunit(type, s)
- enum e_cut type;
- char *s;
+add_compunit(enum e_cut type, char *s)
{
struct s_compunit *cu;
@@ -339,8 +331,7 @@ add_compunit(type, s)
* Add a file to the linked list
*/
static void
-add_file(s)
- char *s;
+add_file(char *s)
{
struct s_flist *fp;
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index c7c25a51626..622eb502883 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process.c,v 1.10 2003/06/03 02:56:16 millert Exp $ */
+/* $OpenBSD: process.c,v 1.11 2003/06/10 22:20:51 deraadt Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -35,7 +35,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)process.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$OpenBSD: process.c,v 1.10 2003/06/03 02:56:16 millert Exp $";
+static char *rcsid = "$OpenBSD: process.c,v 1.11 2003/06/10 22:20:51 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -84,7 +84,7 @@ regmatch_t *match;
#define OUT(s) { fwrite(s, sizeof(u_char), psl, stdout); }
void
-process()
+process(void)
{
struct s_command *cp;
SPACE tspace;
@@ -270,8 +270,7 @@ new: if (!nflag && !pd)
* flag to process ranges. Interprets the non-select (``!'') flag.
*/
static inline int
-applies(cp)
- struct s_command *cp;
+applies(struct s_command *cp)
{
int r;
@@ -312,8 +311,7 @@ applies(cp)
* and then swap them.
*/
static int
-substitute(cp)
- struct s_command *cp;
+substitute(struct s_command *cp)
{
SPACE tspace;
regex_t *re;
@@ -422,7 +420,7 @@ substitute(cp)
* therefore it also resets the substitution done (sdone) flag.
*/
static void
-flush_appends()
+flush_appends(void)
{
FILE *f;
int count, i;
@@ -456,8 +454,7 @@ flush_appends()
}
static void
-lputs(s)
- char *s;
+lputs(char *s)
{
int count;
char *escapes, *p;
@@ -500,11 +497,8 @@ lputs(s)
}
static inline int
-regexec_e(preg, string, eflags, nomatch, slen)
- regex_t *preg;
- const char *string;
- int eflags, nomatch;
- size_t slen;
+regexec_e(regex_t *preg, const char *string, int eflags,
+ int nomatch, size_t slen)
{
int eval;
@@ -537,9 +531,7 @@ regexec_e(preg, string, eflags, nomatch, slen)
* Based on a routine by Henry Spencer
*/
static void
-regsub(sp, string, src)
- SPACE *sp;
- char *string, *src;
+regsub(SPACE *sp, char *string, char *src)
{
int len, no;
char c, *dst;
@@ -583,11 +575,7 @@ regsub(sp, string, src)
* space as necessary.
*/
void
-cspace(sp, p, len, spflag)
- SPACE *sp;
- char *p;
- size_t len;
- enum e_spflag spflag;
+cspace(SPACE *sp, char *p, size_t len, enum e_spflag spflag)
{
size_t tlen;
@@ -610,8 +598,7 @@ cspace(sp, p, len, spflag)
* Close all cached opened files and report any errors
*/
void
-cfclose(cp, end)
- struct s_command *cp, *end;
+cfclose(struct s_command *cp, struct s_command *end)
{
for (; cp != end; cp = cp->next)
diff --git a/usr.bin/showmount/showmount.c b/usr.bin/showmount/showmount.c
index ffe984cea40..a0eb8ed2144 100644
--- a/usr.bin/showmount/showmount.c
+++ b/usr.bin/showmount/showmount.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: showmount.c,v 1.12 2003/06/03 02:56:16 millert Exp $ */
+/* $OpenBSD: showmount.c,v 1.13 2003/06/10 22:20:51 deraadt Exp $ */
/* $NetBSD: showmount.c,v 1.7 1996/05/01 18:14:10 cgd Exp $ */
/*
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)showmount.c 8.3 (Berkeley) 3/29/95";
#endif
-static char rcsid[] = "$OpenBSD: showmount.c,v 1.12 2003/06/03 02:56:16 millert Exp $";
+static char rcsid[] = "$OpenBSD: showmount.c,v 1.13 2003/06/10 22:20:51 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -105,9 +105,7 @@ int xdr_exports(XDR *, struct exportslist **);
* for detailed information on the protocol.
*/
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
struct exportslist *exp;
struct grouplist *grp;
@@ -241,9 +239,7 @@ main(argc, argv)
* Xdr routine for retrieving the mount dump list
*/
int
-xdr_mntdump(xdrsp, mlp)
- XDR *xdrsp;
- struct mountlist **mlp;
+xdr_mntdump(XDR *xdrsp, struct mountlist **mlp)
{
struct mountlist *mp, **otp = NULL, *tp;
int bool, val, val2;
@@ -320,9 +316,7 @@ next:
* Xdr routine to retrieve exports list
*/
int
-xdr_exports(xdrsp, exp)
- XDR *xdrsp;
- struct exportslist **exp;
+xdr_exports(XDR *xdrsp, struct exportslist **exp)
{
struct exportslist *ep;
struct grouplist *gp;
@@ -364,7 +358,7 @@ xdr_exports(xdrsp, exp)
}
void
-usage()
+usage(void)
{
fprintf(stderr, "usage: showmount [-ade3] host\n");
@@ -375,8 +369,7 @@ usage()
* Print the binary tree in inorder so that output is sorted.
*/
void
-print_dump(mp)
- struct mountlist *mp;
+print_dump(struct mountlist *mp)
{
char vn[(RPCMNT_NAMELEN+1)*4];
char vp[(RPCMNT_PATHLEN+1)*4];
diff --git a/usr.bin/size/size.c b/usr.bin/size/size.c
index be5505dadbf..be59e965de1 100644
--- a/usr.bin/size/size.c
+++ b/usr.bin/size/size.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: size.c,v 1.18 2003/06/03 02:56:16 millert Exp $ */
+/* $OpenBSD: size.c,v 1.19 2003/06/10 22:20:51 deraadt Exp $ */
/* $NetBSD: size.c,v 1.7 1996/01/14 23:07:12 pk Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)size.c 8.2 (Berkeley) 12/9/93";
#endif
-static char rcsid[] = "$OpenBSD: size.c,v 1.18 2003/06/03 02:56:16 millert Exp $";
+static char rcsid[] = "$OpenBSD: size.c,v 1.19 2003/06/10 22:20:51 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -71,9 +71,7 @@ int show_objfile(int, char *, FILE *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch, eval;
@@ -113,9 +111,7 @@ main(argc, argv)
* object files as input.
*/
int
-process_file(count, fname)
- int count;
- char *fname;
+process_file(int count, char *fname)
{
struct exec exec_head;
FILE *fp;
@@ -158,10 +154,7 @@ process_file(count, fname)
* show symbols in the given archive file
*/
int
-show_archive(count, fname, fp)
- int count;
- char *fname;
- FILE *fp;
+show_archive(int count, char *fname, FILE *fp)
{
struct ar_hdr ar_head;
struct exec exec_head;
@@ -270,10 +263,7 @@ skip: if (fseek(fp, last_ar_off + even(atol(ar_head.ar_size)),
}
int
-show_objfile(count, name, fp)
- int count;
- char *name;
- FILE *fp;
+show_objfile(int count, char *name, FILE *fp)
{
static int first = 1;
struct exec head;
@@ -311,7 +301,7 @@ show_objfile(count, name, fp)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: size [-tw] [file ...]\n");
exit(1);
diff --git a/usr.bin/skeyinfo/skeyinfo.c b/usr.bin/skeyinfo/skeyinfo.c
index d429d14941a..767dfd5048f 100644
--- a/usr.bin/skeyinfo/skeyinfo.c
+++ b/usr.bin/skeyinfo/skeyinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: skeyinfo.c,v 1.12 2003/06/03 01:52:41 millert Exp $ */
+/* $OpenBSD: skeyinfo.c,v 1.13 2003/06/10 22:20:51 deraadt Exp $ */
/*
* Copyright (c) 1997, 2001, 2002 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -89,7 +89,7 @@ main(int argc, char **argv)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s [-v] [user]\n", __progname);
exit(1);
diff --git a/usr.bin/soelim/soelim.c b/usr.bin/soelim/soelim.c
index 39d72ee9656..0320c93df87 100644
--- a/usr.bin/soelim/soelim.c
+++ b/usr.bin/soelim/soelim.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: soelim.c,v 1.6 2003/06/03 02:56:16 millert Exp $ */
+/* $OpenBSD: soelim.c,v 1.7 2003/06/10 22:20:51 deraadt Exp $ */
/* $NetBSD: soelim.c,v 1.3 1994/12/21 08:11:26 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)soelim.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: soelim.c,v 1.6 2003/06/03 02:56:16 millert Exp $";
+static char rcsid[] = "$OpenBSD: soelim.c,v 1.7 2003/06/10 22:20:51 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -65,9 +65,7 @@ static char rcsid[] = "$OpenBSD: soelim.c,v 1.6 2003/06/03 02:56:16 millert Exp
int process(char *file);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
argc--;
@@ -84,8 +82,8 @@ main(argc, argv)
exit(0);
}
-int process(file)
- char *file;
+int
+process(char *file)
{
char *cp;
int c;
diff --git a/usr.bin/sort/fields.c b/usr.bin/sort/fields.c
index 8bab1ef118b..ece7618fff1 100644
--- a/usr.bin/sort/fields.c
+++ b/usr.bin/sort/fields.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fields.c,v 1.7 2003/06/03 02:56:16 millert Exp $ */
+/* $OpenBSD: fields.c,v 1.8 2003/06/10 22:20:51 deraadt Exp $ */
/*-
* Copyright (c) 1993
@@ -36,7 +36,7 @@
#if 0
static char sccsid[] = "@(#)fields.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: fields.c,v 1.7 2003/06/03 02:56:16 millert Exp $";
+static char rcsid[] = "$OpenBSD: fields.c,v 1.8 2003/06/10 22:20:51 deraadt Exp $";
#endif
#endif /* not lint */
@@ -306,7 +306,7 @@ number(pos, bufend, line, lineend, Rflag)
* rnum over (0,254) -> (255,REC_D+1),(REC_D-1,0))
*/
void
-num_init()
+num_init(void)
{
int i;
TENS[0] = REC_D <=128 ? 130 - '0' : 2 - '0';
diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c
index 50a74325c84..b0151b713c9 100644
--- a/usr.bin/sort/sort.c
+++ b/usr.bin/sort/sort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sort.c,v 1.20 2003/06/03 02:56:16 millert Exp $ */
+/* $OpenBSD: sort.c,v 1.21 2003/06/10 22:20:51 deraadt Exp $ */
/*-
* Copyright (c) 1993
@@ -42,7 +42,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)sort.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: sort.c,v 1.20 2003/06/03 02:56:16 millert Exp $";
+static char rcsid[] = "$OpenBSD: sort.c,v 1.21 2003/06/10 22:20:51 deraadt Exp $";
#endif
#endif /* not lint */
@@ -103,9 +103,7 @@ static void usage(char *);
}
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int (*get)();
int ch, i, stdinflag = 0, tmp = 0;
@@ -310,8 +308,7 @@ main(argc, argv)
}
static void
-onsig(s)
- int s;
+onsig(int signo)
{
cleanup();
@@ -319,7 +316,7 @@ onsig(s)
}
static void
-cleanup()
+cleanup(void)
{
if (toutpath[0])
@@ -327,8 +324,7 @@ cleanup()
}
static void
-usage(msg)
- char *msg;
+usage(char *msg)
{
extern char *__progname;
diff --git a/usr.bin/sort/tmp.c b/usr.bin/sort/tmp.c
index fa581af1ab6..6e13b84ab80 100644
--- a/usr.bin/sort/tmp.c
+++ b/usr.bin/sort/tmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmp.c,v 1.5 2003/06/03 02:56:16 millert Exp $ */
+/* $OpenBSD: tmp.c,v 1.6 2003/06/10 22:20:51 deraadt Exp $ */
/*-
* Copyright (c) 1993
@@ -36,7 +36,7 @@
#if 0
static char sccsid[] = "@(#)tmp.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: tmp.c,v 1.5 2003/06/03 02:56:16 millert Exp $";
+static char rcsid[] = "$OpenBSD: tmp.c,v 1.6 2003/06/10 22:20:51 deraadt Exp $";
#endif
#endif /* not lint */
@@ -57,7 +57,7 @@ static char rcsid[] = "$OpenBSD: tmp.c,v 1.5 2003/06/03 02:56:16 millert Exp $";
#define _NAME_TMP "sort.XXXXXXXXXX"
FILE *
-ftmp()
+ftmp(void)
{
sigset_t set, oset;
FILE *fp;
diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c
index 41e428c622e..8726d6c9d34 100644
--- a/usr.bin/split/split.c
+++ b/usr.bin/split/split.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: split.c,v 1.8 2003/06/03 02:56:16 millert Exp $ */
+/* $OpenBSD: split.c,v 1.9 2003/06/10 22:20:51 deraadt Exp $ */
/* $NetBSD: split.c,v 1.5 1995/08/31 22:22:05 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)split.c 8.3 (Berkeley) 4/25/94";
#else
-static char rcsid[] = "$OpenBSD: split.c,v 1.8 2003/06/03 02:56:16 millert Exp $";
+static char rcsid[] = "$OpenBSD: split.c,v 1.9 2003/06/10 22:20:51 deraadt Exp $";
#endif
#endif /* not lint */
@@ -74,9 +74,7 @@ void split2(void);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch;
char *ep, *p;
@@ -171,7 +169,7 @@ main(argc, argv)
* Split the input by bytes.
*/
void
-split1()
+split1(void)
{
long bcnt;
int dist, len;
@@ -219,7 +217,7 @@ split1()
* Split the input by lines.
*/
void
-split2()
+split2(void)
{
long lcnt = 0;
FILE *infp;
@@ -271,7 +269,7 @@ writeit:
* Open a new output file.
*/
void
-newfile()
+newfile(void)
{
static long fnum;
static int defname;
@@ -308,7 +306,7 @@ newfile()
}
void
-usage()
+usage(void)
{
extern char *__progname;
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c
index dcb04f52512..3bf8adf1f7b 100644
--- a/usr.bin/ssh/packet.c
+++ b/usr.bin/ssh/packet.c
@@ -37,7 +37,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: packet.c,v 1.106 2003/04/08 20:21:29 itojun Exp $");
+RCSID("$OpenBSD: packet.c,v 1.107 2003/06/10 22:20:52 deraadt Exp $");
#include <sys/queue.h>
@@ -265,7 +265,7 @@ packet_set_iv(int mode, u_char *dat)
cipher_set_keyiv(cc, dat);
}
int
-packet_get_ssh1_cipher()
+packet_get_ssh1_cipher(void)
{
return (cipher_get_number(receive_context.cipher));
}
diff --git a/usr.bin/ssh/progressmeter.c b/usr.bin/ssh/progressmeter.c
index 7721a89a3ee..e4fd28f1643 100644
--- a/usr.bin/ssh/progressmeter.c
+++ b/usr.bin/ssh/progressmeter.c
@@ -64,7 +64,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: progressmeter.c,v 1.6 2003/04/07 21:58:05 millert Exp $");
+RCSID("$OpenBSD: progressmeter.c,v 1.7 2003/06/10 22:20:52 deraadt Exp $");
#include <libgen.h>
@@ -124,7 +124,7 @@ start_progress_meter(char *file, off_t filesize, off_t *counter)
}
void
-stop_progress_meter()
+stop_progress_meter(void)
{
alarm(0);
draw_progress_meter();
@@ -157,7 +157,7 @@ foregroundproc(void)
}
static void
-draw_progress_meter()
+draw_progress_meter(void)
{
static const char spaces[] = " "
" "
diff --git a/usr.bin/strings/strings.c b/usr.bin/strings/strings.c
index ee03275ef52..66c08eed545 100644
--- a/usr.bin/strings/strings.c
+++ b/usr.bin/strings/strings.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strings.c,v 1.10 2003/06/03 02:56:16 millert Exp $ */
+/* $OpenBSD: strings.c,v 1.11 2003/06/10 22:20:52 deraadt Exp $ */
/* $NetBSD: strings.c,v 1.7 1995/02/15 15:49:19 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)strings.c 8.2 (Berkeley) 1/28/94";
#endif
-static char rcsid[] = "$OpenBSD: strings.c,v 1.10 2003/06/03 02:56:16 millert Exp $";
+static char rcsid[] = "$OpenBSD: strings.c,v 1.11 2003/06/10 22:20:52 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -74,9 +74,7 @@ static void usage(void);
int getch(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
extern char *optarg;
extern int optind;
@@ -254,7 +252,7 @@ nextfile: ;
* get next character from wherever
*/
int
-getch()
+getch(void)
{
++foff;
if (head_len) {
@@ -268,7 +266,7 @@ getch()
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: strings [-afo] [-n length] [-t {o,d,x}] [file ... ]\n");
diff --git a/usr.bin/strip/strip.c b/usr.bin/strip/strip.c
index 7f0d8beae66..2652840cbba 100644
--- a/usr.bin/strip/strip.c
+++ b/usr.bin/strip/strip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strip.c,v 1.19 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: strip.c,v 1.20 2003/06/10 22:20:52 deraadt Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@@ -37,7 +37,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)strip.c 5.8 (Berkeley) 11/6/91";*/
-static char rcsid[] = "$OpenBSD: strip.c,v 1.19 2003/06/03 02:56:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: strip.c,v 1.20 2003/06/10 22:20:52 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -72,9 +72,7 @@ void usage(void);
int xflag = 0;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int fd;
EXEC *ep;
@@ -145,12 +143,7 @@ main(argc, argv)
}
int
-s_sym(fn, fd, ep, sp, sz)
- const char *fn;
- int fd;
- EXEC *ep;
- struct stat *sp;
- off_t *sz;
+s_sym(const char *fn, int fd, EXEC *ep, struct stat *sp, off_t *sz)
{
char *neweof;
#if 0
@@ -212,12 +205,7 @@ s_sym(fn, fd, ep, sp, sz)
}
int
-s_stab(fn, fd, ep, sp, sz)
- const char *fn;
- int fd;
- EXEC *ep;
- struct stat *sp;
- off_t *sz;
+s_stab(const char *fn, int fd, EXEC *ep, struct stat *sp, off_t *sz)
{
int cnt, len;
char *nstr, *nstrbase=0, *used=0, *p, *strbase;
@@ -384,7 +372,7 @@ end:
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: strip [-dx] file ...\n");
exit(1);
diff --git a/usr.bin/tail/misc.c b/usr.bin/tail/misc.c
index 0650d590cb8..fd9849a5e03 100644
--- a/usr.bin/tail/misc.c
+++ b/usr.bin/tail/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.5 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: misc.c,v 1.6 2003/06/10 22:20:52 deraadt Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
#if 0
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: misc.c,v 1.5 2003/06/03 02:56:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: misc.c,v 1.6 2003/06/10 22:20:52 deraadt Exp $";
#endif
#endif /* not lint */
@@ -51,7 +51,7 @@ static char rcsid[] = "$OpenBSD: misc.c,v 1.5 2003/06/03 02:56:17 millert Exp $"
#include "extern.h"
void
-ierr()
+ierr(void)
{
warn("%s", fname);
@@ -59,7 +59,7 @@ ierr()
}
void
-oerr()
+oerr(void)
{
err(1, "stdout");
diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c
index cbbe143e95b..333eddcf7a2 100644
--- a/usr.bin/tail/tail.c
+++ b/usr.bin/tail/tail.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tail.c,v 1.10 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: tail.c,v 1.11 2003/06/10 22:20:52 deraadt Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)tail.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tail.c,v 1.10 2003/06/03 02:56:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: tail.c,v 1.11 2003/06/10 22:20:52 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -65,9 +65,7 @@ static void obsolete(char **);
static void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat sb;
FILE *fp;
@@ -218,8 +216,7 @@ main(argc, argv)
* the option argument for a -b, -c or -n option gets converted.
*/
static void
-obsolete(argv)
- char *argv[];
+obsolete(char *argv[])
{
char *ap, *p, *t;
int len;
@@ -301,7 +298,7 @@ obsolete(argv)
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: tail [-f | -r] [-b # | -c # | -n #] [file ...]\n");
diff --git a/usr.bin/talk/ctl.c b/usr.bin/talk/ctl.c
index ec5c86253c5..08cc69e6f50 100644
--- a/usr.bin/talk/ctl.c
+++ b/usr.bin/talk/ctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctl.c,v 1.7 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: ctl.c,v 1.8 2003/06/10 22:20:52 deraadt Exp $ */
/* $NetBSD: ctl.c,v 1.3 1994/12/09 02:14:10 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)ctl.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: ctl.c,v 1.7 2003/06/03 02:56:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: ctl.c,v 1.8 2003/06/10 22:20:52 deraadt Exp $";
#endif /* not lint */
/*
@@ -64,7 +64,7 @@ int invitation_waiting = 0;
CTL_MSG msg;
void
-open_sockt()
+open_sockt(void)
{
int length;
@@ -82,7 +82,7 @@ open_sockt()
/* open the ctl socket */
void
-open_ctl()
+open_ctl(void)
{
int length;
@@ -102,8 +102,7 @@ open_ctl()
/* print_addr is a debug print routine */
void
-print_addr(addr)
- struct sockaddr_in addr;
+print_addr(struct sockaddr_in addr)
{
int i;
diff --git a/usr.bin/talk/init_disp.c b/usr.bin/talk/init_disp.c
index eecac9c8a8e..194ad0fba71 100644
--- a/usr.bin/talk/init_disp.c
+++ b/usr.bin/talk/init_disp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_disp.c,v 1.16 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: init_disp.c,v 1.17 2003/06/10 22:20:52 deraadt Exp $ */
/* $NetBSD: init_disp.c,v 1.6 1994/12/09 02:14:17 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)init_disp.c 8.2 (Berkeley) 2/16/94";
#endif
-static char rcsid[] = "$OpenBSD: init_disp.c,v 1.16 2003/06/03 02:56:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: init_disp.c,v 1.17 2003/06/10 22:20:52 deraadt Exp $";
#endif /* not lint */
/*
@@ -54,7 +54,7 @@ static char rcsid[] = "$OpenBSD: init_disp.c,v 1.16 2003/06/03 02:56:17 millert
* and build the various windows.
*/
void
-init_display()
+init_display(void)
{
struct sigaction sa;
@@ -102,7 +102,7 @@ init_display()
* connection are the three edit characters.
*/
void
-set_edit_chars()
+set_edit_chars(void)
{
u_char buf[3];
int cc;
@@ -127,16 +127,14 @@ set_edit_chars()
}
void
-sig_sent(dummy)
- int dummy;
+sig_sent(int dummy)
{
quit("Connection closing. Exiting", 0);
}
void
-sig_winch(dummy)
- int dummy;
+sig_winch(int dummy)
{
gotwinch = 1;
@@ -146,9 +144,7 @@ sig_winch(dummy)
* All done talking...hang up the phone and reset terminal thingy's
*/
void
-quit(warning, do_perror)
- char *warning;
- int do_perror;
+quit(char *warning, int do_perror)
{
if (curses_initialized) {
@@ -172,7 +168,7 @@ quit(warning, do_perror)
* If we get SIGWINCH, recompute both window sizes and refresh things.
*/
void
-resize_display()
+resize_display(void)
{
struct winsize ws;
diff --git a/usr.bin/talk/invite.c b/usr.bin/talk/invite.c
index c6c927789bd..4a7960c9b22 100644
--- a/usr.bin/talk/invite.c
+++ b/usr.bin/talk/invite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: invite.c,v 1.9 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: invite.c,v 1.10 2003/06/10 22:20:52 deraadt Exp $ */
/* $NetBSD: invite.c,v 1.3 1994/12/09 02:14:18 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)invite.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: invite.c,v 1.9 2003/06/03 02:56:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: invite.c,v 1.10 2003/06/10 22:20:52 deraadt Exp $";
#endif /* not lint */
#include "talk.h"
@@ -64,7 +64,7 @@ int local_id, remote_id;
jmp_buf invitebuf;
void
-invite_remote()
+invite_remote(void)
{
int new_sockt;
struct itimerval itimer;
@@ -143,8 +143,7 @@ invite_remote()
* Routine called on interupt to re-invite the callee
*/
void
-re_invite(dummy)
- int dummy;
+re_invite(int dummy)
{
message("Ringing your party again");
/* force a re-announce */
@@ -170,7 +169,7 @@ static char *answers[] = {
* Transmit the invitation and process the response
*/
void
-announce_invite()
+announce_invite(void)
{
CTL_RESPONSE response;
@@ -188,7 +187,7 @@ announce_invite()
* Tell the daemon to remove your invitation
*/
void
-send_delete()
+send_delete(void)
{
msg.type = DELETE;
diff --git a/usr.bin/talk/io.c b/usr.bin/talk/io.c
index a36a80854e9..d90b77d2705 100644
--- a/usr.bin/talk/io.c
+++ b/usr.bin/talk/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.12 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: io.c,v 1.13 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: io.c,v 1.4 1994/12/09 02:14:20 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: io.c,v 1.12 2003/06/03 02:56:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: io.c,v 1.13 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
/*
@@ -58,7 +58,7 @@ volatile sig_atomic_t gotwinch = 0;
* The routine to do the actual talking
*/
void
-talk()
+talk(void)
{
fd_set read_template, read_set;
int nb;
@@ -129,8 +129,7 @@ talk()
* Display string in the standard location
*/
void
-message(string)
- char *string;
+message(char *string)
{
wmove(my_win.x_win, current_line % my_win.x_nlines, 0);
wprintw(my_win.x_win, "[%s]", string);
diff --git a/usr.bin/talk/look_up.c b/usr.bin/talk/look_up.c
index fa9b4d838ef..2174907ab89 100644
--- a/usr.bin/talk/look_up.c
+++ b/usr.bin/talk/look_up.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: look_up.c,v 1.8 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: look_up.c,v 1.9 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: look_up.c,v 1.3 1994/12/09 02:14:21 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)look_up.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: look_up.c,v 1.8 2003/06/03 02:56:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: look_up.c,v 1.9 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
#include "talk.h"
@@ -46,7 +46,7 @@ static char rcsid[] = "$OpenBSD: look_up.c,v 1.8 2003/06/03 02:56:17 millert Exp
* See if the local daemon has an invitation for us.
*/
int
-check_local()
+check_local(void)
{
CTL_RESPONSE response;
@@ -95,8 +95,7 @@ check_local()
* Look for an invitation on 'machine'
*/
int
-look_for_invite(rp)
- CTL_RESPONSE *rp;
+look_for_invite(CTL_RESPONSE *rp)
{
current_state = "Checking for invitation on caller's machine";
ctl_transact(his_machine_addr, msg, LOOK_UP, rp);
diff --git a/usr.bin/talk/msgs.c b/usr.bin/talk/msgs.c
index 9dcad94cfaf..897da974c54 100644
--- a/usr.bin/talk/msgs.c
+++ b/usr.bin/talk/msgs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msgs.c,v 1.6 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: msgs.c,v 1.7 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: msgs.c,v 1.3 1994/12/09 02:14:22 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)msgs.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: msgs.c,v 1.6 2003/06/03 02:56:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: msgs.c,v 1.7 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
/*
@@ -59,7 +59,7 @@ disp_msg(dummy)
}
void
-start_msgs()
+start_msgs(void)
{
struct itimerval itimer;
@@ -71,7 +71,7 @@ start_msgs()
}
void
-end_msgs()
+end_msgs(void)
{
struct itimerval itimer;
diff --git a/usr.bin/talk/talk.c b/usr.bin/talk/talk.c
index dd652e41a1d..e21df863f16 100644
--- a/usr.bin/talk/talk.c
+++ b/usr.bin/talk/talk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: talk.c,v 1.6 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: talk.c,v 1.7 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: talk.c,v 1.3 1994/12/09 02:14:25 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)talk.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: talk.c,v 1.6 2003/06/03 02:56:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: talk.c,v 1.7 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
#include "talk.h"
@@ -60,9 +60,7 @@ static char rcsid[] = "$OpenBSD: talk.c,v 1.6 2003/06/03 02:56:17 millert Exp $"
*/
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
get_names(argc, argv);
init_display();
diff --git a/usr.bin/tcopy/tcopy.c b/usr.bin/tcopy/tcopy.c
index 49f7cc2274e..4771768d28e 100644
--- a/usr.bin/tcopy/tcopy.c
+++ b/usr.bin/tcopy/tcopy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcopy.c,v 1.8 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: tcopy.c,v 1.9 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: tcopy.c,v 1.5 1997/04/15 07:23:08 lukem Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)tcopy.c 8.3 (Berkeley) 1/23/95";
#endif
-static char rcsid[] = "$OpenBSD: tcopy.c,v 1.8 2003/06/03 02:56:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: tcopy.c,v 1.9 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -73,9 +73,7 @@ void verify(int, int, char *);
void writeop(int, int);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch, needeof, nw, inp, outp;
ssize_t lastnread, nread;
@@ -230,9 +228,7 @@ r1: guesslen = 0;
}
void
-verify(inp, outp, outb)
- int inp, outp;
- char *outb;
+verify(int inp, int outp, char *outb)
{
int eot, inmaxblk, inn, outmaxblk, outn;
char *inb;
@@ -286,8 +282,7 @@ r2: if (inn != outn) {
}
void
-intr(signo)
- int signo;
+intr(int signo)
{
if (record) {
if (record - lastrec > 1)
@@ -301,8 +296,7 @@ intr(signo)
}
void *
-getspace(blk)
- int blk;
+getspace(int blk)
{
void *bp;
@@ -313,8 +307,7 @@ getspace(blk)
}
void
-writeop(fd, type)
- int fd, type;
+writeop(int fd, int type)
{
struct mtop op;
@@ -325,7 +318,7 @@ writeop(fd, type)
}
void
-usage()
+usage(void)
{
fprintf(stderr, "usage: tcopy [-cvx] [-s maxblk] src [dest]\n");
diff --git a/usr.bin/tee/tee.c b/usr.bin/tee/tee.c
index 68d898c0f88..18e47e5aca8 100644
--- a/usr.bin/tee/tee.c
+++ b/usr.bin/tee/tee.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tee.c,v 1.5 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: tee.c,v 1.6 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: tee.c,v 1.5 1994/12/09 01:43:39 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)tee.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tee.c,v 1.5 2003/06/03 02:56:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: tee.c,v 1.6 2003/06/10 22:20:53 deraadt Exp $";
#endif
#include <sys/types.h>
@@ -65,9 +65,7 @@ LIST *head;
void add(int, char *);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
LIST *p;
int n, fd, rval, wval;
@@ -137,9 +135,7 @@ main(argc, argv)
}
void
-add(fd, name)
- int fd;
- char *name;
+add(int fd, char *name)
{
LIST *p;
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index 3903421d323..ce787e63e25 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.13 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: main.c,v 1.14 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: main.c,v 1.6 1995/05/21 16:54:10 mycroft Exp $ */
/*
@@ -40,7 +40,7 @@ static const char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: main.c,v 1.13 2003/06/03 02:56:18 millert Exp $";
+static const char rcsid[] = "$OpenBSD: main.c,v 1.14 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
/* Many bug fixes are from Jim Guyton <guyton@rand-unix> */
@@ -148,13 +148,11 @@ struct cmd cmdtab[] = {
{ NULL, NULL, NULL }
};
-struct cmd *getcmd();
-char *tail();
+struct cmd *getcmd(char *);
+char *tail(char *);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct sockaddr_in s_in;
@@ -184,9 +182,7 @@ main(argc, argv)
char hostname[MAXHOSTNAMELEN];
void
-setpeer(argc, argv)
- int argc;
- char *argv[];
+setpeer(int argc, char *argv[])
{
struct hostent *host;
@@ -245,9 +241,7 @@ struct modes {
};
void
-modecmd(argc, argv)
- int argc;
- char *argv[];
+modecmd(int argc, char *argv[])
{
struct modes *p;
char *sep;
@@ -280,26 +274,21 @@ modecmd(argc, argv)
}
void
-setbinary(argc, argv)
- int argc;
- char *argv[];
+setbinary(int argc, char *argv[])
{
settftpmode("octet");
}
void
-setascii(argc, argv)
- int argc;
- char *argv[];
+setascii(int argc, char *argv[])
{
settftpmode("netascii");
}
static void
-settftpmode(newmode)
- char *newmode;
+settftpmode(char *newmode)
{
strlcpy(mode, newmode, sizeof mode);
if (verbose)
@@ -311,9 +300,7 @@ settftpmode(newmode)
* Send file(s).
*/
void
-put(argc, argv)
- int argc;
- char *argv[];
+put(int argc, char *argv[])
{
int fd;
int n;
@@ -393,8 +380,7 @@ put(argc, argv)
}
static void
-putusage(s)
- char *s;
+putusage(char *s)
{
printf("usage: %s file ... host:target, or\n", s);
printf(" %s file ... target (when already connected)\n", s);
@@ -404,9 +390,7 @@ putusage(s)
* Receive file(s).
*/
void
-get(argc, argv)
- int argc;
- char *argv[];
+get(int argc, char *argv[])
{
int fd;
int n;
@@ -491,9 +475,7 @@ getusage(s)
int rexmtval = TIMEOUT;
void
-setrexmt(argc, argv)
- int argc;
- char *argv[];
+setrexmt(int argc, char *argv[])
{
int t;
@@ -520,9 +502,7 @@ setrexmt(argc, argv)
int maxtimeout = 5 * TIMEOUT;
void
-settimeout(argc, argv)
- int argc;
- char *argv[];
+settimeout(int argc, char *argv[])
{
int t;
@@ -547,9 +527,7 @@ settimeout(argc, argv)
}
void
-status(argc, argv)
- int argc;
- char *argv[];
+status(int argc, char *argv[])
{
if (connected)
printf("Connected to %s.\n", hostname);
@@ -562,7 +540,7 @@ status(argc, argv)
}
void
-intr()
+intr(void)
{
signal(SIGALRM, SIG_IGN);
@@ -571,8 +549,7 @@ intr()
}
char *
-tail(filename)
- char *filename;
+tail(char *filename)
{
char *s;
@@ -591,7 +568,7 @@ tail(filename)
* Command parser.
*/
static __dead void
-command()
+command(void)
{
struct cmd *c;
@@ -624,8 +601,7 @@ command()
}
struct cmd *
-getcmd(name)
- char *name;
+getcmd(char *name)
{
char *p, *q;
struct cmd *c, *found;
@@ -656,7 +632,7 @@ getcmd(name)
* Slice a string up into argc/argv.
*/
static int
-makeargv()
+makeargv(void)
{
char *cp;
char **argp = margv;
@@ -686,9 +662,7 @@ makeargv()
}
void
-quit(argc, argv)
- int argc;
- char *argv[];
+quit(int argc, char *argv[])
{
exit(0);
@@ -698,9 +672,7 @@ quit(argc, argv)
* Help command.
*/
void
-help(argc, argv)
- int argc;
- char *argv[];
+help(int argc, char *argv[])
{
struct cmd *c;
@@ -724,18 +696,14 @@ help(argc, argv)
}
void
-settrace(argc, argv)
- int argc;
- char **argv;
+settrace(int argc, char *argv[])
{
trace = !trace;
printf("Packet tracing %s.\n", trace ? "on" : "off");
}
void
-setverbose(argc, argv)
- int argc;
- char **argv;
+setverbose(int argc, char *argv[])
{
verbose = !verbose;
printf("Verbose mode %s.\n", verbose ? "on" : "off");
diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c
index 4d5368f929c..10d1dc7e4d4 100644
--- a/usr.bin/tftp/tftp.c
+++ b/usr.bin/tftp/tftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftp.c,v 1.12 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: tftp.c,v 1.13 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: tftp.c,v 1.5 1995/04/29 05:55:25 cgd Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)tftp.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: tftp.c,v 1.12 2003/06/03 02:56:18 millert Exp $";
+static const char rcsid[] = "$OpenBSD: tftp.c,v 1.13 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
/* Many bug fixes are from Jim Guyton <guyton@rand-unix> */
@@ -409,14 +409,14 @@ struct timeval tstart;
struct timeval tstop;
static void
-startclock()
+startclock(void)
{
(void)gettimeofday(&tstart, NULL);
}
static void
-stopclock()
+stopclock(void)
{
(void)gettimeofday(&tstop, NULL);
diff --git a/usr.bin/time/time.c b/usr.bin/time/time.c
index 8c4220342b1..d4067da629b 100644
--- a/usr.bin/time/time.c
+++ b/usr.bin/time/time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: time.c,v 1.14 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: time.c,v 1.15 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: time.c,v 1.7 1995/06/27 00:34:00 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)time.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: time.c,v 1.14 2003/06/03 02:56:18 millert Exp $";
+static char rcsid[] = "$OpenBSD: time.c,v 1.15 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -62,9 +62,7 @@ int portableflag;
__dead void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
pid_t pid;
int ch, status;
@@ -194,7 +192,7 @@ main(argc, argv)
}
__dead void
-usage()
+usage(void)
{
extern char *__progname;
diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c
index 67dcda028d3..1ba5036ae9b 100644
--- a/usr.bin/touch/touch.c
+++ b/usr.bin/touch/touch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: touch.c,v 1.9 2003/06/03 02:56:20 millert Exp $ */
+/* $OpenBSD: touch.c,v 1.10 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: touch.c,v 1.11 1995/08/31 22:10:06 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)touch.c 8.2 (Berkeley) 4/28/95";
#endif
-static char rcsid[] = "$OpenBSD: touch.c,v 1.9 2003/06/03 02:56:20 millert Exp $";
+static char rcsid[] = "$OpenBSD: touch.c,v 1.10 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -65,9 +65,7 @@ void stime_file(char *, struct timeval *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat sb;
struct timeval tv[2];
@@ -187,9 +185,7 @@ main(argc, argv)
#define ATOI2(s) ((s) += 2, ((s)[-2] - '0') * 10 + ((s)[-1] - '0'))
void
-stime_arg1(arg, tvp)
- char *arg;
- struct timeval *tvp;
+stime_arg1(char *arg, struct timeval *tvp)
{
struct tm *t;
time_t tmptime;
@@ -248,10 +244,7 @@ terr: errx(1,
}
void
-stime_arg2(arg, year, tvp)
- char *arg;
- int year;
- struct timeval *tvp;
+stime_arg2(char *arg, int year, struct timeval *tvp)
{
struct tm *t;
time_t tmptime;
@@ -284,9 +277,7 @@ stime_arg2(arg, year, tvp)
}
void
-stime_file(fname, tvp)
- char *fname;
- struct timeval *tvp;
+stime_file(char *fname, struct timeval *tvp)
{
struct stat sb;
@@ -297,10 +288,7 @@ stime_file(fname, tvp)
}
int
-rw(fname, sbp, force)
- char *fname;
- struct stat *sbp;
- int force;
+rw(char *fname, struct stat *sbp, int force)
{
int fd, needed_chmod, rval;
u_char byte;
@@ -349,7 +337,7 @@ err: rval = 1;
}
__dead void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: touch [-acfm] [-r file] [-t time] file ...\n");
diff --git a/usr.bin/tput/tput.c b/usr.bin/tput/tput.c
index 2b0035d68f0..9f622b16a8e 100644
--- a/usr.bin/tput/tput.c
+++ b/usr.bin/tput/tput.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tput.c,v 1.13 2003/06/03 01:52:41 millert Exp $ */
+/* $OpenBSD: tput.c,v 1.14 2003/06/10 22:20:53 deraadt Exp $ */
/*
* Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -54,7 +54,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)tput.c 8.3 (Berkeley) 4/28/95";
#endif
-static char rcsid[] = "$OpenBSD: tput.c,v 1.13 2003/06/03 01:52:41 millert Exp $";
+static char rcsid[] = "$OpenBSD: tput.c,v 1.14 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -80,9 +80,7 @@ static void usage(void);
extern char *__progname;
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int ch, exitval, n, Sflag;
size_t len;
@@ -200,8 +198,7 @@ main(argc, argv)
}
static char **
-process(cap, str, argv)
- char *cap, *str, **argv;
+process(char *cap, char *str, char **argv)
{
char *cp, *s, *nargv[9];
int arg_need, popcount, i;
@@ -272,7 +269,7 @@ process(cap, str, argv)
}
static void
-init()
+init(void)
{
FILE *ifile;
size_t len;
@@ -328,7 +325,7 @@ init()
}
static void
-reset()
+reset(void)
{
FILE *rfile;
size_t len;
@@ -354,7 +351,7 @@ reset()
}
static void
-set_margins()
+set_margins(void)
{
/*
@@ -388,7 +385,7 @@ set_margins()
}
static void
-usage()
+usage(void)
{
if (strcmp(__progname, "clear") == 0)
diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c
index 697e2a13445..ca1dad185c8 100644
--- a/usr.bin/tr/tr.c
+++ b/usr.bin/tr/tr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tr.c,v 1.9 2003/06/03 02:56:20 millert Exp $ */
+/* $OpenBSD: tr.c,v 1.10 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: tr.c,v 1.5 1995/08/31 22:13:48 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)tr.c 8.2 (Berkeley) 5/4/95";
#endif
-static char rcsid[] = "$OpenBSD: tr.c,v 1.9 2003/06/03 02:56:20 millert Exp $";
+static char rcsid[] = "$OpenBSD: tr.c,v 1.10 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -95,9 +95,7 @@ static void setup(int *, char *, STR *, int);
static void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int ch, cnt, lastch, *p;
int cflag, dflag, sflag, isstring2;
@@ -237,11 +235,7 @@ main(argc, argv)
}
static void
-setup(string, arg, str, cflag)
- int *string;
- char *arg;
- STR *str;
- int cflag;
+setup(int *string, char *arg, STR *str, int cflag)
{
int cnt, *p;
@@ -255,7 +249,7 @@ setup(string, arg, str, cflag)
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: tr [-cs] string1 string2\n");
(void)fprintf(stderr, " tr [-c] -d string1\n");
diff --git a/usr.bin/tsort/tsort.c b/usr.bin/tsort/tsort.c
index 2ac8861bf02..9cbd325ac94 100644
--- a/usr.bin/tsort/tsort.c
+++ b/usr.bin/tsort/tsort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tsort.c,v 1.15 2002/07/17 11:21:43 espie Exp $ */
+/* $OpenBSD: tsort.c,v 1.16 2003/06/10 22:20:53 deraadt Exp $ */
/* ex:ts=8 sw=4:
*/
@@ -978,7 +978,7 @@ main(int argc, char *argv[])
extern char *__progname;
static void
-usage()
+usage(void)
{
fprintf(stderr, "Usage: %s [-h file] [-flqrvw] [file]\n", __progname);
exit(EX_USAGE);
diff --git a/usr.bin/tty/tty.c b/usr.bin/tty/tty.c
index 1bda56010ed..aa90ea9186b 100644
--- a/usr.bin/tty/tty.c
+++ b/usr.bin/tty/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.4 2003/06/03 02:56:20 millert Exp $ */
+/* $OpenBSD: tty.c,v 1.5 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: tty.c,v 1.4 1994/12/07 00:46:57 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tty.c,v 1.4 2003/06/03 02:56:20 millert Exp $";
+static char rcsid[] = "$OpenBSD: tty.c,v 1.5 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -50,9 +50,7 @@ static char rcsid[] = "$OpenBSD: tty.c,v 1.4 2003/06/03 02:56:20 millert Exp $";
static void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int ch, sflag;
char *t;
@@ -78,7 +76,7 @@ main(argc, argv)
static void
-usage ()
+usage(void)
{
fprintf(stderr, "usage: tty [-s]\n");
exit(2);
diff --git a/usr.bin/ul/ul.c b/usr.bin/ul/ul.c
index e20e5692f41..1c06b18732d 100644
--- a/usr.bin/ul/ul.c
+++ b/usr.bin/ul/ul.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ul.c,v 1.9 2003/06/03 02:56:20 millert Exp $ */
+/* $OpenBSD: ul.c,v 1.10 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: ul.c,v 1.3 1994/12/07 00:28:24 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ul.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: ul.c,v 1.9 2003/06/03 02:56:20 millert Exp $";
+static char rcsid[] = "$OpenBSD: ul.c,v 1.10 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -102,9 +102,7 @@ void iattr(void);
} while (0)
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
extern int optind;
extern char *optarg;
@@ -170,8 +168,7 @@ main(argc, argv)
}
void
-mfilter(f)
- FILE *f;
+mfilter(FILE *f)
{
int c;
@@ -284,7 +281,7 @@ mfilter(f)
}
void
-flushln()
+flushln(void)
{
int lastmode, i;
int hadmodes = 0;
@@ -323,7 +320,7 @@ flushln()
* We don't do anything with halfline ups and downs, or Greek.
*/
void
-overstrike()
+overstrike(void)
{
int i;
char lbuf[256];
@@ -361,7 +358,7 @@ overstrike()
}
void
-iattr()
+iattr(void)
{
int i;
char lbuf[256];
@@ -385,7 +382,7 @@ iattr()
}
void
-initbuf()
+initbuf(void)
{
bzero((char *)obuf, sizeof (obuf)); /* depends on NORMAL == 0 */
@@ -395,7 +392,7 @@ initbuf()
}
void
-fwd()
+fwd(void)
{
int oldcol, oldmax;
@@ -407,7 +404,7 @@ fwd()
}
void
-reverse()
+reverse(void)
{
upln++;
fwd();
@@ -417,7 +414,7 @@ reverse()
}
void
-initcap()
+initcap(void)
{
static char tcapbuf[512];
char *bp = tcapbuf;
@@ -471,8 +468,7 @@ initcap()
}
int
-outchar(c)
- int c;
+outchar(int c)
{
putchar(c & 0177);
return (0);
@@ -481,8 +477,7 @@ outchar(c)
static int curmode = 0;
void
-outc(c)
- int c;
+outc(int c)
{
putchar(c);
if (must_use_uc && (curmode&UNDERL)) {
@@ -492,8 +487,7 @@ outc(c)
}
void
-msetmode(newmode)
- int newmode;
+msetmode(int newmode)
{
if (!iflag) {
if (curmode != NORMAL && newmode != NORMAL)
diff --git a/usr.bin/unexpand/unexpand.c b/usr.bin/unexpand/unexpand.c
index fd0626050a1..fbd15dbcedb 100644
--- a/usr.bin/unexpand/unexpand.c
+++ b/usr.bin/unexpand/unexpand.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unexpand.c,v 1.7 2003/06/03 02:56:20 millert Exp $ */
+/* $OpenBSD: unexpand.c,v 1.8 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: unexpand.c,v 1.5 1994/12/24 17:08:05 cgd Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)unexpand.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: unexpand.c,v 1.7 2003/06/03 02:56:20 millert Exp $";
+static char rcsid[] = "$OpenBSD: unexpand.c,v 1.8 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
/*
@@ -56,9 +56,7 @@ int all;
void tabify(char);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
char *cp;
@@ -92,8 +90,7 @@ main(argc, argv)
}
void
-tabify(c)
- char c;
+tabify(char c)
{
char *cp, *dp;
int dcol;
diff --git a/usr.bin/units/units.c b/usr.bin/units/units.c
index 3a2c708722c..b1dbd99e165 100644
--- a/usr.bin/units/units.c
+++ b/usr.bin/units/units.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: units.c,v 1.7 2001/01/17 19:29:49 deraadt Exp $ */
+/* $OpenBSD: units.c,v 1.8 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: units.c,v 1.6 1996/04/06 06:01:03 thorpej Exp $ */
/*
@@ -273,7 +273,7 @@ showunit(struct unittype * theunit)
void
-zeroerror()
+zeroerror(void)
{
fprintf(stderr, "Unit reduces to zero\n");
}
@@ -615,7 +615,7 @@ showanswer(struct unittype * have, struct unittype * want)
void
-usage()
+usage(void)
{
fprintf(stderr, "units [-f unitsfile] [-q] [-v] [from-unit to-unit]\n");
fprintf(stderr, " -f specify units file\n");
diff --git a/usr.bin/unvis/unvis.c b/usr.bin/unvis/unvis.c
index 3bf4963d04d..8db4b9a20b4 100644
--- a/usr.bin/unvis/unvis.c
+++ b/usr.bin/unvis/unvis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unvis.c,v 1.6 2003/06/03 02:56:21 millert Exp $ */
+/* $OpenBSD: unvis.c,v 1.7 2003/06/10 22:20:53 deraadt Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: unvis.c,v 1.6 2003/06/03 02:56:21 millert Exp $";
+static char rcsid[] = "$OpenBSD: unvis.c,v 1.7 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -50,9 +50,7 @@ static char rcsid[] = "$OpenBSD: unvis.c,v 1.6 2003/06/03 02:56:21 millert Exp $
void process(FILE *fp, const char *filename);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
FILE *fp;
int ch;
@@ -81,9 +79,7 @@ main(argc, argv)
}
void
-process(fp, filename)
- FILE *fp;
- const char *filename;
+process(FILE *fp, const char *filename)
{
int offset = 0, c, ret;
int state = 0;
diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c
index edc194fbe36..a1ece266f25 100644
--- a/usr.bin/uudecode/uudecode.c
+++ b/usr.bin/uudecode/uudecode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uudecode.c,v 1.10 2003/06/03 02:56:21 millert Exp $ */
+/* $OpenBSD: uudecode.c,v 1.11 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: uudecode.c,v 1.6 1994/11/17 07:40:43 jtc Exp $ */
/*-
@@ -38,7 +38,7 @@ char copyright[] =
#if 0
static char sccsid[] = "@(#)uudecode.c 8.2 (Berkeley) 4/2/94";
#endif
-static char rcsid[] = "$OpenBSD: uudecode.c,v 1.10 2003/06/03 02:56:21 millert Exp $";
+static char rcsid[] = "$OpenBSD: uudecode.c,v 1.11 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
/*
@@ -61,13 +61,11 @@ static char rcsid[] = "$OpenBSD: uudecode.c,v 1.10 2003/06/03 02:56:21 millert E
#include <unistd.h>
static int decode(int);
-static void usage();
+static void usage(void);
char *filename;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int rval;
int ch;
@@ -206,7 +204,7 @@ decode(int tostdout)
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: uudecode [-p] [file ...]\n");
exit(1);
diff --git a/usr.bin/uuencode/uuencode.c b/usr.bin/uuencode/uuencode.c
index 7f53eb3a2c9..1579708b367 100644
--- a/usr.bin/uuencode/uuencode.c
+++ b/usr.bin/uuencode/uuencode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uuencode.c,v 1.5 2003/06/03 02:56:21 millert Exp $ */
+/* $OpenBSD: uuencode.c,v 1.6 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: uuencode.c,v 1.7 1994/11/17 07:41:15 jtc Exp $ */
/*-
@@ -38,7 +38,7 @@ char copyright[] =
#if 0
static char sccsid[] = "@(#)uuencode.c 8.2 (Berkeley) 4/2/94";
#endif
-static char rcsid[] = "$OpenBSD: uuencode.c,v 1.5 2003/06/03 02:56:21 millert Exp $";
+static char rcsid[] = "$OpenBSD: uuencode.c,v 1.6 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
/*
@@ -55,13 +55,11 @@ static char rcsid[] = "$OpenBSD: uuencode.c,v 1.5 2003/06/03 02:56:21 millert Ex
#include <sys/stat.h>
#include <unistd.h>
-static void encode();
-static __dead void usage();
+static void encode(void);
+static __dead void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat sb;
int mode;
@@ -110,7 +108,7 @@ main(argc, argv)
* copy from in to out, encoding as you go along.
*/
static void
-encode()
+encode(void)
{
int ch, n;
char *p;
@@ -151,7 +149,7 @@ encode()
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,"usage: uuencode [infile] remotefile\n");
exit(1);
diff --git a/usr.bin/vacation/vacation.c b/usr.bin/vacation/vacation.c
index 25dec9e4141..3afc2fb0541 100644
--- a/usr.bin/vacation/vacation.c
+++ b/usr.bin/vacation/vacation.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vacation.c,v 1.19 2003/06/03 02:56:21 millert Exp $ */
+/* $OpenBSD: vacation.c,v 1.20 2003/06/10 22:20:53 deraadt Exp $ */
/* $NetBSD: vacation.c,v 1.7 1995/04/29 05:58:27 cgd Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)vacation.c 8.2 (Berkeley) 1/26/94";
#endif
-static char rcsid[] = "$OpenBSD: vacation.c,v 1.19 2003/06/03 02:56:21 millert Exp $";
+static char rcsid[] = "$OpenBSD: vacation.c,v 1.20 2003/06/10 22:20:53 deraadt Exp $";
#endif /* not lint */
/*
@@ -98,9 +98,7 @@ void setreply(void);
void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
struct passwd *pw;
struct stat sb;
@@ -203,7 +201,7 @@ main(argc, argv)
* read mail headers
*/
void
-readheaders()
+readheaders(void)
{
ALIAS *cur;
char *p;
@@ -313,8 +311,7 @@ findme: for (cur = names; !tome && cur; cur = cur->next)
* do a nice, slow, search of a string for a substring.
*/
int
-nsearch(name, str)
- char *name, *str;
+nsearch(char *name, char *str)
{
int len;
@@ -329,7 +326,7 @@ nsearch(name, str)
* read the header and return if automagic/junk/bulk/list mail
*/
int
-junkmail()
+junkmail(void)
{
static struct ignore {
char *name;
@@ -379,7 +376,7 @@ junkmail()
* use bcopy for machines with alignment restrictions
*/
int
-recent()
+recent(void)
{
DBT key, data;
time_t then, next;
@@ -409,8 +406,7 @@ recent()
* store the reply interval
*/
void
-setinterval(interval)
- time_t interval;
+setinterval(time_t interval)
{
DBT key, data;
@@ -426,7 +422,7 @@ setinterval(interval)
* store that this user knows about the vacation.
*/
void
-setreply()
+setreply(void)
{
DBT key, data;
time_t now;
@@ -444,8 +440,7 @@ setreply()
* exec sendmail to send the vacation file to sender
*/
void
-sendmessage(myname)
- char *myname;
+sendmessage(char *myname)
{
FILE *mfp, *sfp;
int i;
@@ -495,7 +490,7 @@ sendmessage(myname)
}
void
-usage()
+usage(void)
{
syslog(LOG_NOTICE, "uid %u: usage: vacation [-i] [-a alias] login",
getuid());
diff --git a/usr.bin/vis/vis.c b/usr.bin/vis/vis.c
index 42ca4d594f2..9b742564476 100644
--- a/usr.bin/vis/vis.c
+++ b/usr.bin/vis/vis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vis.c,v 1.6 2003/06/03 02:56:22 millert Exp $ */
+/* $OpenBSD: vis.c,v 1.7 2003/06/10 22:20:54 deraadt Exp $ */
/* $NetBSD: vis.c,v 1.4 1994/12/20 16:13:03 jtc Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)vis.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: vis.c,v 1.6 2003/06/03 02:56:22 millert Exp $";
+static char rcsid[] = "$OpenBSD: vis.c,v 1.7 2003/06/10 22:20:54 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -56,9 +56,7 @@ int foldit(char *, int, int);
void process(FILE *, char *);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
FILE *fp;
int ch;
@@ -106,7 +104,7 @@ main(argc, argv)
case '?':
default:
fprintf(stderr,
- "usage: vis [-nwctsobf] [-F foldwidth]\n");
+ "usage: vis [-nwctsobf] [-F foldwidth]\n");
exit(1);
}
argc -= optind;
@@ -126,9 +124,7 @@ main(argc, argv)
}
void
-process(fp, filename)
- FILE *fp;
- char *filename;
+process(FILE *fp, char *filename)
{
static int col = 0;
char *cp = "\0"+1; /* so *(cp-1) starts out != '\n' */
diff --git a/usr.bin/what/what.c b/usr.bin/what/what.c
index 54e408ab1ad..f2c624f29bf 100644
--- a/usr.bin/what/what.c
+++ b/usr.bin/what/what.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: what.c,v 1.9 2003/06/03 02:56:22 millert Exp $ */
+/* $OpenBSD: what.c,v 1.10 2003/06/10 22:20:54 deraadt Exp $ */
/* $NetBSD: what.c,v 1.4 1994/12/20 16:01:03 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)what.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: what.c,v 1.9 2003/06/03 02:56:22 millert Exp $";
+static char rcsid[] = "$OpenBSD: what.c,v 1.10 2003/06/10 22:20:54 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -64,9 +64,7 @@ extern char *__progname;
*/
/* ARGSUSED */
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
struct utsname utsn;
char match[256];
@@ -103,8 +101,7 @@ main(argc, argv)
}
static void
-search(match)
- char *match;
+search(char *match)
{
int c;
int i;
@@ -143,7 +140,7 @@ loop: if (c == '$') {
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s [-s] file ...\n", __progname);
diff --git a/usr.bin/whatis/whatis.c b/usr.bin/whatis/whatis.c
index dc063447787..b0f18de11ec 100644
--- a/usr.bin/whatis/whatis.c
+++ b/usr.bin/whatis/whatis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: whatis.c,v 1.8 2003/06/03 02:56:22 millert Exp $ */
+/* $OpenBSD: whatis.c,v 1.9 2003/06/10 22:20:54 deraadt Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -62,9 +62,7 @@ void usage(void);
void whatis(char **, char *, int);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
ENTRY *ep;
TAG *tp;
@@ -129,9 +127,7 @@ main(argc, argv)
}
void
-whatis(argv, path, buildpath)
- char **argv, *path;
- int buildpath;
+whatis(char **argv, char *path, int buildpath)
{
char *end, *name, **p;
char buf[MAXLINELEN + 1], wbuf[MAXLINELEN + 1];
@@ -175,8 +171,7 @@ whatis(argv, path, buildpath)
* match a full word or a full string
*/
int
-match(bp, str)
- char *bp, *str;
+match(char *bp, char *str)
{
int len;
char *start;
@@ -213,8 +208,7 @@ match(bp, str)
* truncate a string at " - "
*/
void
-dashtrunc(from, to)
- char *from, *to;
+dashtrunc(char *from, char *to)
{
int ch;
@@ -229,7 +223,7 @@ dashtrunc(from, to)
* print usage message and die
*/
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
diff --git a/usr.bin/which/which.c b/usr.bin/which/which.c
index bd3af218b2e..bd09600fc5e 100644
--- a/usr.bin/which/which.c
+++ b/usr.bin/which/which.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: which.c,v 1.9 2003/06/03 01:52:41 millert Exp $ */
+/* $OpenBSD: which.c,v 1.10 2003/06/10 22:20:54 deraadt Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: which.c,v 1.9 2003/06/03 01:52:41 millert Exp $";
+static const char rcsid[] = "$OpenBSD: which.c,v 1.10 2003/06/10 22:20:54 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -51,7 +51,7 @@ void usage(void);
*/
int
-main(int argc, char **argv)
+main(int argc, char *argv[])
{
char *path;
size_t n;
diff --git a/usr.bin/who/who.c b/usr.bin/who/who.c
index 24979c106ab..32cce5c7470 100644
--- a/usr.bin/who/who.c
+++ b/usr.bin/who/who.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: who.c,v 1.15 2003/06/03 02:56:23 millert Exp $ */
+/* $OpenBSD: who.c,v 1.16 2003/06/10 22:20:54 deraadt Exp $ */
/* $NetBSD: who.c,v 1.4 1994/12/07 04:28:49 jtc Exp $ */
/*
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: who.c,v 1.15 2003/06/03 02:56:23 millert Exp $";
+static char rcsid[] = "$OpenBSD: who.c,v 1.16 2003/06/10 22:20:54 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -75,9 +75,7 @@ int show_quick; /* quick, names only */
#define HOST_WIDTH 32
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
struct utmp usr;
FILE *ufp;
@@ -183,8 +181,7 @@ main(argc, argv)
}
void
-who_am_i(ufp)
- FILE *ufp;
+who_am_i(FILE *ufp)
{
struct utmp usr;
struct passwd *pw;
@@ -214,8 +211,7 @@ who_am_i(ufp)
}
void
-output(up)
- struct utmp *up;
+output(struct utmp *up)
{
struct stat sb;
char line[sizeof(_PATH_DEV) + sizeof (up->ut_line)];
@@ -267,7 +263,7 @@ output(up)
}
void
-output_labels()
+output_labels(void)
{
(void)printf("%-*.*s ", NAME_WIDTH, UT_NAMESIZE, "USER");
@@ -286,8 +282,7 @@ output_labels()
}
FILE *
-file(name)
- char *name;
+file(char *name)
{
FILE *ufp;
@@ -299,7 +294,7 @@ file(name)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: who [-mqTuH] [ file ]\n who am i\n");
exit(1);
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c
index a46327f6930..bdec7611854 100644
--- a/usr.bin/whois/whois.c
+++ b/usr.bin/whois/whois.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: whois.c,v 1.26 2003/06/03 02:56:23 millert Exp $ */
+/* $OpenBSD: whois.c,v 1.27 2003/06/10 22:20:54 deraadt Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)whois.c 8.1 (Berkeley) 6/6/93";
#else
-static const char rcsid[] = "$OpenBSD: whois.c,v 1.26 2003/06/03 02:56:23 millert Exp $";
+static const char rcsid[] = "$OpenBSD: whois.c,v 1.27 2003/06/10 22:20:54 deraadt Exp $";
#endif
#endif /* not lint */
@@ -86,7 +86,7 @@ static int whois(const char *, const char *, const char *, int);
static char *choose_server(const char *, const char *);
int
-main(int argc, char **argv)
+main(int argc, char *argv[])
{
int ch, flags, rval;
char *host, *name, *country, *server;
diff --git a/usr.bin/window/main.c b/usr.bin/window/main.c
index 61696f9eb7e..2487f2f1c17 100644
--- a/usr.bin/window/main.c
+++ b/usr.bin/window/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.8 2003/06/03 02:56:23 millert Exp $ */
+/* $OpenBSD: main.c,v 1.9 2003/06/10 22:20:54 deraadt Exp $ */
/* $NetBSD: main.c,v 1.6 1996/02/08 20:45:01 mycroft Exp $ */
/*
@@ -43,7 +43,7 @@ char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.8 2003/06/03 02:56:23 millert Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.9 2003/06/10 22:20:54 deraadt Exp $";
#endif
#endif /* not lint */
@@ -59,8 +59,7 @@ static char rcsid[] = "$OpenBSD: main.c,v 1.8 2003/06/03 02:56:23 millert Exp $"
#define next(a) (*++*(a) ? *(a) : (*++(a) ? *(a) : (char *)(long)usage()))
/*ARGSUSED*/
-main(argc, argv)
-char **argv;
+main(int argc, char *argv[])
{
char *p;
char fflag = 0;
@@ -198,9 +197,9 @@ bad:
return 0;
}
-usage()
+usage(void)
{
- (void) fprintf(stderr, "Usage: window [-e escape-char] [-c command] [-t] [-f] [-d]\n");
+ fprintf(stderr, "Usage: window [-e escape-char] [-c command] [-t] [-f] [-d]\n");
exit(1);
return 0; /* for lint */
}
diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c
index 8cef99ff759..1a116913590 100644
--- a/usr.bin/write/write.c
+++ b/usr.bin/write/write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: write.c,v 1.20 2003/06/03 02:56:24 millert Exp $ */
+/* $OpenBSD: write.c,v 1.21 2003/06/10 22:20:54 deraadt Exp $ */
/* $NetBSD: write.c,v 1.5 1995/08/31 21:48:32 jtc Exp $ */
/*
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)write.c 8.2 (Berkeley) 4/27/95";
#endif
-static char *rcsid = "$OpenBSD: write.c,v 1.20 2003/06/03 02:56:24 millert Exp $";
+static char *rcsid = "$OpenBSD: write.c,v 1.21 2003/06/10 22:20:54 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -69,7 +69,7 @@ int term_chk(char *, int *, time_t *, int);
int utmp_chk(char *, char *);
int
-main(int argc, char **argv)
+main(int argc, char *argv[])
{
char tty[MAXPATHLEN], *mytty, *cp;
int msgsok, myttyfd;
diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
index 01d972f9595..8db095a67b4 100644
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xargs.c,v 1.12 2003/06/03 02:56:24 millert Exp $ */
+/* $OpenBSD: xargs.c,v 1.13 2003/06/10 22:20:54 deraadt Exp $ */
/* $NetBSD: xargs.c,v 1.7 1994/11/14 06:51:41 jtc Exp $ */
/*-
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)xargs.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: xargs.c,v 1.12 2003/06/03 02:56:24 millert Exp $";
+static char rcsid[] = "$OpenBSD: xargs.c,v 1.13 2003/06/10 22:20:54 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -66,9 +66,7 @@ void run(char **);
void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int ch;
char *p, *bbp, *ebp, **bxp, **exp, **xp;
@@ -268,8 +266,7 @@ addch: if (p < ebp) {
}
void
-run(argv)
- char **argv;
+run(char **argv)
{
volatile int noinvoke;
char **p;
@@ -331,9 +328,10 @@ run(argv)
}
void
-usage()
+usage(void)
{
- (void)fprintf(stderr,
-"usage: xargs [-0] [-t] [-n number [-x]] [-s size] [utility [argument ...]]\n");
+ fprintf(stderr,
+ "usage: xargs [-0] [-t] [-n number [-x]] [-s size] "
+ "[utility [argument ...]]\n");
exit(1);
}
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index b38fb8676f1..61fe0cb9096 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xinstall.c,v 1.34 2003/06/03 02:56:24 millert Exp $ */
+/* $OpenBSD: xinstall.c,v 1.35 2003/06/10 22:20:54 deraadt Exp $ */
/* $NetBSD: xinstall.c,v 1.9 1995/12/20 10:25:17 jonathan Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93";
#endif
-static char rcsid[] = "$OpenBSD: xinstall.c,v 1.34 2003/06/03 02:56:24 millert Exp $";
+static char rcsid[] = "$OpenBSD: xinstall.c,v 1.35 2003/06/10 22:20:54 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -90,9 +90,7 @@ int file_write(int, char *, size_t, int *, int *, int);
void file_flush(int, int);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat from_sb, to_sb;
mode_t *set;
@@ -211,10 +209,7 @@ main(argc, argv)
* build a path name and install the file
*/
void
-install(from_name, to_name, fset, flags)
- char *from_name, *to_name;
- u_long fset;
- u_int flags;
+install(char *from_name, char *to_name, u_long fset, u_int flags)
{
struct stat from_sb, to_sb;
struct utimbuf utb;
@@ -416,11 +411,8 @@ install(from_name, to_name, fset, flags)
* copy from one file to another
*/
void
-copy(from_fd, from_name, to_fd, to_name, size, sparse)
- int from_fd, to_fd;
- char *from_name, *to_name;
- off_t size;
- int sparse;
+copy(int from_fd, char *from_name, int to_fd, char *to_name, off_t size,
+ int sparse)
{
ssize_t nr, nw;
int serrno;
@@ -495,13 +487,8 @@ copy(from_fd, from_name, to_fd, to_name, size, sparse)
* compare two files; non-zero means files differ
*/
int
-compare(from_fd, from_name, from_len, to_fd, to_name, to_len)
- int from_fd;
- const char *from_name;
- size_t from_len;
- int to_fd;
- const char *to_name;
- size_t to_len;
+compare(int from_fd, const char *from_name, size_t from_len, int to_fd,
+ const char *to_name, size_t to_len)
{
caddr_t p1, p2;
size_t length, remainder;
@@ -546,8 +533,7 @@ compare(from_fd, from_name, from_len, to_fd, to_name, to_len)
* use strip(1) to strip the target file
*/
void
-strip(to_name)
- char *to_name;
+strip(char *to_name)
{
int serrno, status;
char * volatile path_strip;
@@ -575,8 +561,7 @@ strip(to_name)
* build directory heirarchy
*/
void
-install_dir(path)
- char *path;
+install_dir(char *path)
{
char *p;
struct stat sb;
@@ -607,7 +592,7 @@ install_dir(path)
* print a usage message and die
*/
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "\
usage: install [-bCcpSs] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner] file1 file2\n\
@@ -622,10 +607,7 @@ usage: install [-bCcpSs] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner]
* create a temporary file based on path and open it
*/
int
-create_tempfile(path, temp, tsize)
- char *path;
- char *temp;
- size_t tsize;
+create_tempfile(char *path, char *temp, size_t tsize)
{
char *p;
@@ -646,9 +628,7 @@ create_tempfile(path, temp, tsize)
* create a new file, overwriting an existing one if necessary
*/
int
-create_newfile(path, sbp)
- char *path;
- struct stat *sbp;
+create_newfile(char *path, struct stat *sbp)
{
char backup[MAXPATHLEN];
@@ -720,13 +700,7 @@ create_newfile(path, sbp)
*/
int
-file_write(fd, str, cnt, rem, isempt, sz)
- int fd;
- char *str;
- size_t cnt;
- int *rem;
- int *isempt;
- int sz;
+file_write(int fd, char *str, size_t cnt, int *rem, int *isempt, int sz)
{
char *pt;
char *end;
@@ -803,7 +777,6 @@ file_write(fd, str, cnt, rem, isempt, sz)
* let us create a hole at the end. To get the last block with zeros, we
* write the last BYTE with a zero (back up one byte and write a zero).
*/
-
void
file_flush(int fd, int isempt)
{