diff options
author | 2003-06-11 23:42:12 +0000 | |
---|---|---|
committer | 2003-06-11 23:42:12 +0000 | |
commit | 28416801cb5e430679f26d39e520dd1dbc51ea61 (patch) | |
tree | 8a0a4da7d4a929c7ddd3f5cab5227318e15045b5 | |
parent | some ansification, some de-register (diff) | |
download | wireguard-openbsd-28416801cb5e430679f26d39e520dd1dbc51ea61.tar.xz wireguard-openbsd-28416801cb5e430679f26d39e520dd1dbc51ea61.zip |
ansification, art ok
-rw-r--r-- | bin/dd/args.c | 55 | ||||
-rw-r--r-- | bin/dd/conv.c | 16 | ||||
-rw-r--r-- | bin/dd/dd.c | 20 | ||||
-rw-r--r-- | bin/dd/misc.c | 12 | ||||
-rw-r--r-- | bin/dd/position.c | 8 | ||||
-rw-r--r-- | bin/ed/buf.c | 37 | ||||
-rw-r--r-- | bin/ed/cbc.c | 41 | ||||
-rw-r--r-- | bin/ed/glbl.c | 21 | ||||
-rw-r--r-- | bin/ed/io.c | 46 | ||||
-rw-r--r-- | bin/ed/main.c | 84 | ||||
-rw-r--r-- | bin/ed/re.c | 12 | ||||
-rw-r--r-- | bin/ed/sub.c | 27 | ||||
-rw-r--r-- | bin/ed/undo.c | 13 | ||||
-rw-r--r-- | bin/expr/expr.c | 4 | ||||
-rw-r--r-- | bin/ls/cmp.c | 34 | ||||
-rw-r--r-- | bin/ls/ls.c | 18 | ||||
-rw-r--r-- | bin/ls/main.c | 6 | ||||
-rw-r--r-- | bin/ls/print.c | 36 | ||||
-rw-r--r-- | bin/ls/util.c | 9 | ||||
-rw-r--r-- | bin/md5/md5.c | 5 | ||||
-rw-r--r-- | bin/mt/mtrmt.c | 33 | ||||
-rw-r--r-- | bin/ps/keyword.c | 15 | ||||
-rw-r--r-- | bin/ps/nlist.c | 12 | ||||
-rw-r--r-- | bin/ps/print.c | 143 | ||||
-rw-r--r-- | bin/ps/ps.c | 21 | ||||
-rw-r--r-- | bin/stty/cchar.c | 11 | ||||
-rw-r--r-- | bin/stty/gfmt.c | 16 | ||||
-rw-r--r-- | bin/stty/key.c | 68 | ||||
-rw-r--r-- | bin/stty/modes.c | 8 | ||||
-rw-r--r-- | bin/stty/print.c | 20 | ||||
-rw-r--r-- | bin/stty/stty.c | 10 |
31 files changed, 292 insertions, 569 deletions
diff --git a/bin/dd/args.c b/bin/dd/args.c index 641348c361b..be83c90ec4d 100644 --- a/bin/dd/args.c +++ b/bin/dd/args.c @@ -1,4 +1,4 @@ -/* $OpenBSD: args.c,v 1.13 2003/06/02 23:32:07 millert Exp $ */ +/* $OpenBSD: args.c,v 1.14 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: args.c,v 1.7 1996/03/01 01:18:58 jtc Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)args.c 8.3 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: args.c,v 1.13 2003/06/02 23:32:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: args.c,v 1.14 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -95,8 +95,7 @@ static char *oper; * args -- parse JCL syntax of dd. */ void -jcl(argv) - char **argv; +jcl(char **argv) { struct arg *ap, tmp; char *arg; @@ -179,32 +178,28 @@ jcl(argv) } static int -c_arg(a, b) - const void *a, *b; +c_arg(const void *a, const void *b) { return (strcmp(((struct arg *)a)->name, ((struct arg *)b)->name)); } static void -f_bs(arg) - char *arg; +f_bs(char *arg) { in.dbsz = out.dbsz = get_bsz(arg); } static void -f_cbs(arg) - char *arg; +f_cbs(char *arg) { cbsz = get_bsz(arg); } static void -f_count(arg) - char *arg; +f_count(char *arg) { if ((cpy_cnt = get_bsz(arg)) == 0) @@ -212,16 +207,14 @@ f_count(arg) } static void -f_files(arg) - char *arg; +f_files(char *arg) { files_cnt = get_bsz(arg); } static void -f_ibs(arg) - char *arg; +f_ibs(char *arg) { if (!(ddflags & C_BS)) @@ -229,16 +222,14 @@ f_ibs(arg) } static void -f_if(arg) - char *arg; +f_if(char *arg) { in.name = arg; } static void -f_obs(arg) - char *arg; +f_obs(char *arg) { if (!(ddflags & C_BS)) @@ -246,24 +237,21 @@ f_obs(arg) } static void -f_of(arg) - char *arg; +f_of(char *arg) { out.name = arg; } static void -f_seek(arg) - char *arg; +f_seek(char *arg) { out.offset = get_off(arg); } static void -f_skip(arg) - char *arg; +f_skip(char *arg) { in.offset = get_off(arg); @@ -272,8 +260,7 @@ f_skip(arg) #ifdef NO_CONV /* Build a small version (i.e. for a ramdisk root) */ static void -f_conv(arg) - char *arg; +f_conv(char *arg) { errx(1, "conv option disabled"); } @@ -302,8 +289,7 @@ static const struct conv { }; static void -f_conv(arg) - char *arg; +f_conv(char *arg) { struct conv *cp, tmp; @@ -322,8 +308,7 @@ f_conv(arg) } static int -c_conv(a, b) - const void *a, *b; +c_conv(const void *a, const void *b) { return (strcmp(((struct conv *)a)->name, ((struct conv *)b)->name)); @@ -343,8 +328,7 @@ c_conv(a, b) * the product of the indicated values. */ static size_t -get_bsz(val) - char *val; +get_bsz(char *val) { size_t num, t; char *expr; @@ -414,8 +398,7 @@ erange: errx(1, "%s: %s", oper, strerror(ERANGE)); * the product of the indicated values. */ static off_t -get_off(val) - char *val; +get_off(char *val) { off_t num, t; char *expr; diff --git a/bin/dd/conv.c b/bin/dd/conv.c index 9688d9b46c3..ee5e1ecc9fc 100644 --- a/bin/dd/conv.c +++ b/bin/dd/conv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conv.c,v 1.9 2003/06/02 23:32:07 millert Exp $ */ +/* $OpenBSD: conv.c,v 1.10 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: conv.c,v 1.6 1996/02/20 19:29:02 jtc Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)conv.c 8.3 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: conv.c,v 1.9 2003/06/02 23:32:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: conv.c,v 1.10 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -58,7 +58,7 @@ static char rcsid[] = "$OpenBSD: conv.c,v 1.9 2003/06/02 23:32:07 millert Exp $" * Worst case buffer calculation is (ibs + obs - 1). */ void -def() +def(void) { size_t cnt; u_char *inp; @@ -87,7 +87,7 @@ def() } void -def_close() +def_close(void) { /* Just update the count, everything is already in the buffer. */ if (in.dbcnt) @@ -112,7 +112,7 @@ void unblock_close() { errx(1, "%s", no_block); } * max out buffer: obs + cbsz */ void -block() +block(void) { static int intrunc; int ch = -1; @@ -197,7 +197,7 @@ block() } void -block_close() +block_close(void) { /* * Copy any remaining data into the output buffer and pad to a record. @@ -224,7 +224,7 @@ block_close() * max out buffer: obs + cbsz */ void -unblock() +unblock(void) { size_t cnt; u_char *inp; @@ -258,7 +258,7 @@ unblock() } void -unblock_close() +unblock_close(void) { size_t cnt; u_char *t; diff --git a/bin/dd/dd.c b/bin/dd/dd.c index 5d9afb3a993..08bf99a65fc 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dd.c,v 1.13 2003/06/02 23:32:07 millert Exp $ */ +/* $OpenBSD: dd.c,v 1.14 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: dd.c,v 1.6 1996/02/20 19:29:06 jtc Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: dd.c,v 1.13 2003/06/02 23:32:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: dd.c,v 1.14 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -81,9 +81,7 @@ size_t files_cnt = 1; /* # of files to copy */ const u_char *ctab; /* conversion table */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { jcl(argv); setup(); @@ -103,7 +101,7 @@ main(argc, argv) } static void -setup() +setup(void) { u_int cnt; @@ -209,8 +207,7 @@ setup() } static void -getfdtype(io) - IO *io; +getfdtype(IO *io) { struct mtget mt; struct stat sb; @@ -224,7 +221,7 @@ getfdtype(io) } static void -dd_in() +dd_in(void) { ssize_t n; @@ -323,7 +320,7 @@ dd_in() * is truncated. */ static void -dd_close() +dd_close(void) { if (cfunc == def) def_close(); @@ -343,8 +340,7 @@ dd_close() } void -dd_out(force) - int force; +dd_out(int force) { static int warned; size_t cnt, n; diff --git a/bin/dd/misc.c b/bin/dd/misc.c index bd648d83c05..31111d06492 100644 --- a/bin/dd/misc.c +++ b/bin/dd/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.12 2003/06/02 23:32:07 millert Exp $ */ +/* $OpenBSD: misc.c,v 1.13 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: misc.c,v 1.4 1995/03/21 09:04:10 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: misc.c,v 1.12 2003/06/02 23:32:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: misc.c,v 1.13 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -57,7 +57,7 @@ static char rcsid[] = "$OpenBSD: misc.c,v 1.12 2003/06/02 23:32:07 millert Exp $ #include "extern.h" void -summary() +summary(void) { struct timeval nowtv; char buf[4][100]; @@ -105,8 +105,7 @@ summary() /* ARGSUSED */ void -summaryx(notused) - int notused; +summaryx(int notused) { int save_errno = errno; @@ -116,8 +115,7 @@ summaryx(notused) /* ARGSUSED */ void -terminate(notused) - int notused; +terminate(int notused) { summary(); diff --git a/bin/dd/position.c b/bin/dd/position.c index 715f0444b29..e146c2b2261 100644 --- a/bin/dd/position.c +++ b/bin/dd/position.c @@ -1,4 +1,4 @@ -/* $OpenBSD: position.c,v 1.6 2003/06/02 23:32:07 millert Exp $ */ +/* $OpenBSD: position.c,v 1.7 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: position.c,v 1.4 1995/03/21 09:04:12 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)position.c 8.3 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: position.c,v 1.6 2003/06/02 23:32:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: position.c,v 1.7 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -63,7 +63,7 @@ static char rcsid[] = "$OpenBSD: position.c,v 1.6 2003/06/02 23:32:07 millert Ex * output. */ void -pos_in() +pos_in(void) { size_t bcnt; ssize_t nr; @@ -120,7 +120,7 @@ pos_in() } void -pos_out() +pos_out(void) { struct mtop t_op; off_t cnt; diff --git a/bin/ed/buf.c b/bin/ed/buf.c index bd2e14553c5..22127697a42 100644 --- a/bin/ed/buf.c +++ b/bin/ed/buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.13 2002/06/09 05:47:27 todd Exp $ */ +/* $OpenBSD: buf.c,v 1.14 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: buf.c,v 1.15 1995/04/23 10:07:28 cgd Exp $ */ /* buf.c: This file contains the scratch-file buffer rountines for the @@ -33,7 +33,7 @@ #if 0 static char *rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp"; #else -static char rcsid[] = "$OpenBSD: buf.c,v 1.13 2002/06/09 05:47:27 todd Exp $"; +static char rcsid[] = "$OpenBSD: buf.c,v 1.14 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -51,8 +51,7 @@ line_t buffer_head; /* incore buffer */ /* get_sbuf_line: get a line of text from the scratch file; return pointer to the text */ char * -get_sbuf_line(lp) - line_t *lp; +get_sbuf_line(line_t *lp) { static char *sfbuf = NULL; /* buffer */ static int sfbufsz = 0; /* buffer size */ @@ -87,8 +86,7 @@ get_sbuf_line(lp) /* put_sbuf_line: write a line of text to the scratch file and add a line node to the editor buffer; return a pointer to the end of the text */ char * -put_sbuf_line(cs) - char *cs; +put_sbuf_line(char *cs) { line_t *lp; int len, ct; @@ -134,12 +132,12 @@ put_sbuf_line(cs) /* add_line_node: add a line node in the editor buffer after the current line */ void -add_line_node(lp) - line_t *lp; +add_line_node(line_t *lp) { line_t *cp; - cp = get_addressed_line_node(current_addr); /* this get_addressed_line_node last! */ + /* this get_addressed_line_node last! */ + cp = get_addressed_line_node(current_addr); INSQUE(lp, cp); addr_last++; current_addr++; @@ -148,8 +146,7 @@ add_line_node(lp) /* get_line_node_addr: return line number of pointer */ int -get_line_node_addr(lp) - line_t *lp; +get_line_node_addr(line_t *lp) { line_t *cp = &buffer_head; int n = 0; @@ -166,8 +163,7 @@ get_line_node_addr(lp) /* get_addressed_line_node: return pointer to a line node in the editor buffer */ line_t * -get_addressed_line_node(n) - int n; +get_addressed_line_node(int n) { static line_t *lp = &buffer_head; static int on = 0; @@ -204,7 +200,7 @@ char sfn[sizeof(SCRATCH_TEMPLATE)+1] = ""; /* scratch file name */ /* open_sbuf: open scratch file */ int -open_sbuf() +open_sbuf(void) { int fd = -1; @@ -224,7 +220,7 @@ open_sbuf() /* close_sbuf: close scratch file */ int -close_sbuf() +close_sbuf(void) { if (sfp) { if (fclose(sfp) < 0) { @@ -242,8 +238,7 @@ close_sbuf() /* quit: remove_lines scratch file and exit */ void -quit(n) - int n; +quit(int n) { if (sfp) { fclose(sfp); @@ -257,7 +252,7 @@ unsigned char ctab[256]; /* character translation table */ /* init_buffers: open scratch buffer; initialize line queue */ void -init_buffers() +init_buffers(void) { int i = 0; @@ -278,11 +273,7 @@ init_buffers() /* translit_text: translate characters in a string */ char * -translit_text(s, len, from, to) - char *s; - int len; - int from; - int to; +translit_text(char *s, int len, int from, int to) { static int i = 0; diff --git a/bin/ed/cbc.c b/bin/ed/cbc.c index 9cec7f44bac..026f2be34fd 100644 --- a/bin/ed/cbc.c +++ b/bin/ed/cbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cbc.c,v 1.10 2003/06/02 23:32:08 millert Exp $ */ +/* $OpenBSD: cbc.c,v 1.11 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: cbc.c,v 1.9 1995/03/21 09:04:36 cgd Exp $ */ /* cbc.c: This file contains the encryption routines for the ed line editor */ @@ -40,7 +40,7 @@ #if 0 static char *rcsid = "@(#)cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp"; #else -static char rcsid[] = "$OpenBSD: cbc.c,v 1.10 2003/06/02 23:32:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: cbc.c,v 1.11 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -110,7 +110,7 @@ int des_n = 0; /* index for put_des_char/get_des_char */ /* init_des_cipher: initialize DES */ void -init_des_cipher() +init_des_cipher(void) { #ifdef DES int i; @@ -130,8 +130,7 @@ init_des_cipher() /* get_des_char: return next char in an encrypted file */ int -get_des_char(fp) - FILE *fp; +get_des_char(FILE *fp) { #ifdef DES if (des_n >= des_ct) { @@ -145,9 +144,7 @@ get_des_char(fp) /* put_des_char: write a char to an encrypted file; return char written */ int -put_des_char(c, fp) - int c; - FILE *fp; +put_des_char(int c, FILE *fp) { #ifdef DES if (des_n == sizeof des_buf) { @@ -161,8 +158,7 @@ put_des_char(c, fp) /* flush_des_file: flush an encrypted file's output; return status */ int -flush_des_file(fp) - FILE *fp; +flush_des_file(FILE *fp) { #ifdef DES if (des_n == sizeof des_buf) { @@ -178,7 +174,7 @@ flush_des_file(fp) * get keyword from tty or stdin */ int -get_keyword() +get_keyword(void) { char *p; /* used to obtain the key */ Desbuf msgbuf; /* I/O buffer */ @@ -205,8 +201,7 @@ get_keyword() * print a warning message and, possibly, terminate */ void -des_error(s) - char *s; /* the message */ +des_error(char *s) { seterrmsg(s ? s : strerror(errno)); } @@ -215,9 +210,7 @@ des_error(s) * map a hex character to an integer */ int -hex_to_binary(c, radix) - int c; /* char to be converted */ - int radix; /* base (2 to 16) */ +hex_to_binary(int c, int radix) { switch(c) { case '0': return(0x0); @@ -247,9 +240,7 @@ hex_to_binary(c, radix) * convert the key to a bit pattern */ void -expand_des_key(obuf, ibuf) - char *obuf; /* bit pattern */ - char *ibuf; /* the key itself */ +expand_des_key(char *obuf, char *ibuf) { int i, j; /* counter in a for loop */ int nbuf[64]; /* used for hex/key translation */ @@ -315,8 +306,7 @@ expand_des_key(obuf, ibuf) * DES ignores the low order bit of each character. */ void -set_des_key(buf) - Desbuf buf; /* key block */ +set_des_key(Desbuf buf) { int i, j; /* counter in a for loop */ int par; /* parity counter */ @@ -345,10 +335,7 @@ set_des_key(buf) * This encrypts using the Cipher Block Chaining mode of DES */ int -cbc_encode(msgbuf, n, fp) - char *msgbuf; - int n; - FILE *fp; +cbc_encode(char *msgbuf, int n, FILE *fp) { int inverse = 0; /* 0 to encrypt, 1 to decrypt */ @@ -384,9 +371,7 @@ cbc_encode(msgbuf, n, fp) * This decrypts using the Cipher Block Chaining mode of DES */ int -cbc_decode(msgbuf, fp) - char *msgbuf; /* I/O buffer */ - FILE *fp; /* input file descriptor */ +cbc_decode(char *msgbuf, FILE *fp) { Desbuf ibuf; /* temp buffer for initialization vector */ int n; /* number of bytes actually read */ diff --git a/bin/ed/glbl.c b/bin/ed/glbl.c index 383ad45289a..8e9a5ea5734 100644 --- a/bin/ed/glbl.c +++ b/bin/ed/glbl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: glbl.c,v 1.9 2002/03/24 22:17:04 millert Exp $ */ +/* $OpenBSD: glbl.c,v 1.10 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: glbl.c,v 1.2 1995/03/21 09:04:41 cgd Exp $ */ /* glob.c: This file contains the global command routines for the ed line @@ -33,7 +33,7 @@ #if 0 static char *rcsid = "@(#)glob.c,v 1.1 1994/02/01 00:34:40 alm Exp"; #else -static char rcsid[] = "$OpenBSD: glbl.c,v 1.9 2002/03/24 22:17:04 millert Exp $"; +static char rcsid[] = "$OpenBSD: glbl.c,v 1.10 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -45,8 +45,7 @@ static char rcsid[] = "$OpenBSD: glbl.c,v 1.9 2002/03/24 22:17:04 millert Exp $" /* build_active_list: add line matching a pattern to the global-active list */ int -build_active_list(isgcmd) - int isgcmd; +build_active_list(int isgcmd) { pattern_t *pat; line_t *lp; @@ -79,9 +78,7 @@ build_active_list(isgcmd) /* exec_global: apply command list in the command buffer to the active lines in a range; return command status */ int -exec_global(interact, gflag) - int interact; - int gflag; +exec_global(int interact, int gflag) { static char *ocmd = NULL; static int ocmdsz = 0; @@ -154,8 +151,7 @@ int active_ndx; /* active_list index (modulo active_last) */ /* set_active_node: add a line node to the global-active list */ int -set_active_node(lp) - line_t *lp; +set_active_node(line_t *lp) { if (active_last + 1 > active_size) { int ti = active_size; @@ -193,8 +189,7 @@ set_active_node(lp) /* unset_active_nodes: remove a range of lines from the global-active list */ void -unset_active_nodes(np, mp) - line_t *np, *mp; +unset_active_nodes(line_t *np, line_t *mp) { line_t *lp; int i; @@ -211,7 +206,7 @@ unset_active_nodes(np, mp) /* next_active_node: return the next global-active line node */ line_t * -next_active_node() +next_active_node(void) { while (active_ptr < active_last && active_list[active_ptr] == NULL) active_ptr++; @@ -221,7 +216,7 @@ next_active_node() /* clear_active_list: clear the global-active list */ void -clear_active_list() +clear_active_list(void) { SPL1(); active_size = active_last = active_ptr = active_ndx = 0; diff --git a/bin/ed/io.c b/bin/ed/io.c index ef013cca87b..fd9215c2885 100644 --- a/bin/ed/io.c +++ b/bin/ed/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.10 2002/03/24 22:17:04 millert Exp $ */ +/* $OpenBSD: io.c,v 1.11 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: io.c,v 1.2 1995/03/21 09:04:43 cgd Exp $ */ /* io.c: This file contains the i/o routines for the ed line editor */ @@ -32,7 +32,7 @@ #if 0 static char *rcsid = "@(#)io.c,v 1.1 1994/02/01 00:34:41 alm Exp"; #else -static char rcsid[] = "$OpenBSD: io.c,v 1.10 2002/03/24 22:17:04 millert Exp $"; +static char rcsid[] = "$OpenBSD: io.c,v 1.11 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -43,9 +43,7 @@ extern int scripted; /* read_file: read a named file/pipe into the buffer; return line count */ int -read_file(fn, n) - char *fn; - int n; +read_file(char *fn, int n) { FILE *fp; int size; @@ -76,9 +74,7 @@ int newline_added; /* if set, newline appended to input file */ /* read_stream: read a stream into the editor buffer; return status */ int -read_stream(fp, n) - FILE *fp; - int n; +read_stream(FILE *fp, int n) { line_t *lp = get_addressed_line_node(n); undo_t *up = NULL; @@ -127,8 +123,7 @@ read_stream(fp, n) /* get_stream_line: read a line of text from a stream; return line length */ int -get_stream_line(fp) - FILE *fp; +get_stream_line(FILE *fp) { int c; int i = 0; @@ -157,11 +152,7 @@ get_stream_line(fp) /* write_file: write a range of lines to a named file/pipe; return line count */ int -write_file(fn, mode, n, m) - char *fn; - char *mode; - int n; - int m; +write_file(char *fn, char *mode, int n, int m) { FILE *fp; int size; @@ -185,10 +176,7 @@ write_file(fn, mode, n, m) /* write_stream: write a range of lines to a stream; return status */ int -write_stream(fp, n, m) - FILE *fp; - int n; - int m; +write_stream(FILE *fp, int n, int m) { line_t *lp = get_addressed_line_node(n); unsigned int size = 0; @@ -217,10 +205,7 @@ write_stream(fp, n, m) /* put_stream_line: write a line of text to a stream; return status */ int -put_stream_line(fp, s, len) - FILE *fp; - char *s; - int len; +put_stream_line(FILE *fp, char *s, int len) { while (len--) if ((des ? put_des_char(*s++, fp) : fputc(*s++, fp)) < 0) { @@ -233,9 +218,7 @@ put_stream_line(fp, s, len) /* get_extended_line: get a an extended line from stdin */ char * -get_extended_line(sizep, nonl) - int *sizep; - int nonl; +get_extended_line(int *sizep, int nonl) { static char *cvbuf = NULL; /* buffer */ static int cvbufsz = 0; /* buffer size */ @@ -253,7 +236,8 @@ get_extended_line(sizep, nonl) REALLOC(cvbuf, cvbufsz, l, NULL); memcpy(cvbuf, ibufp, l); *(cvbuf + --l - 1) = '\n'; /* strip trailing esc */ - if (nonl) l--; /* strip newline */ + if (nonl) + l--; /* strip newline */ for (;;) { if ((n = get_tty_line()) < 0) return NULL; @@ -278,7 +262,7 @@ get_extended_line(sizep, nonl) /* get_tty_line: read a line of text from stdin; return line length */ int -get_tty_line() +get_tty_line(void) { int oi = 0; int i = 0; @@ -326,11 +310,7 @@ extern int cols; /* put_tty_line: print text to stdout */ int -put_tty_line(s, l, n, gflag) - char *s; - int l; - int n; - int gflag; +put_tty_line(char *s, int l, int n, int gflag) { int col = 0; #ifndef BACKWARDS diff --git a/bin/ed/main.c b/bin/ed/main.c index 0469fd1c1b5..0ab46ac1feb 100644 --- a/bin/ed/main.c +++ b/bin/ed/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.27 2002/06/09 05:47:27 todd Exp $ */ +/* $OpenBSD: main.c,v 1.28 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: main.c,v 1.3 1995/03/21 09:04:44 cgd Exp $ */ /* main.c: This file contains the main control and user-interface routines @@ -39,7 +39,7 @@ char *copyright = #if 0 static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.27 2002/06/09 05:47:27 todd Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.28 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -117,9 +117,7 @@ seterrmsg(char *s) /* ed: line editor */ int -main(argc, argv) - volatile int argc; - char ** volatile argv; +main(volatile int argc, char ** volatile argv) { int c, n; int status = 0; @@ -288,7 +286,7 @@ int first_addr, second_addr, addr_cnt; /* extract_addr_range: get line addresses from the command buffer until an illegal address is seen; return status */ int -extract_addr_range() +extract_addr_range(void) { int addr; @@ -326,7 +324,7 @@ extract_addr_range() /* next_addr: return the next line address in the command buffer */ int -next_addr() +next_addr(void) { char *hd; int addr = current_addr; @@ -486,7 +484,7 @@ volatile sig_atomic_t cols = 72; /* wrap column */ /* exec_command: execute the next command in command buffer; return print request, if any */ int -exec_command() +exec_command(void) { extern int u_current_addr; extern int u_addr_last; @@ -930,8 +928,7 @@ exec_command() /* check_addr_range: return status of address range check */ int -check_addr_range(n, m) - int n, m; +check_addr_range(int n, int m) { if (addr_cnt == 0) { first_addr = n; @@ -950,9 +947,7 @@ check_addr_range(n, m) pattern in a given direction. wrap around begin/end of editor buffer if necessary */ int -get_matching_node_addr(pat, dir) - pattern_t *pat; - int dir; +get_matching_node_addr(pattern_t *pat, int dir) { char *s; int n = current_addr; @@ -977,7 +972,7 @@ get_matching_node_addr(pat, dir) /* get_filename: return pointer to copy of filename in the command buffer */ char * -get_filename() +get_filename(void) { static char *file = NULL; static int filesz = 0; @@ -1018,7 +1013,7 @@ get_filename() /* get_shell_command: read a shell command from stdin; return substitution status */ int -get_shell_command() +get_shell_command(void) { static char *buf = NULL; static int n = 0; @@ -1084,8 +1079,7 @@ get_shell_command() /* append_lines: insert text from stdin to after line n; stop when either a single period is read or EOF; return status */ int -append_lines(n) - int n; +append_lines(int n) { int l; char *lp = ibuf; @@ -1134,9 +1128,7 @@ append_lines(n) /* join_lines: replace a range of lines with the joined text of those lines */ int -join_lines(from, to) - int from; - int to; +join_lines(int from, int to) { static char *buf = NULL; static int n; @@ -1173,8 +1165,7 @@ join_lines(from, to) /* move_lines: move a range of lines */ int -move_lines(addr) - int addr; +move_lines(int addr) { line_t *b1, *a1, *b2, *a2; int n = INC_MOD(second_addr, addr_last); @@ -1218,8 +1209,7 @@ move_lines(addr) /* copy_lines: copy a range of lines; return status */ int -copy_lines(addr) - int addr; +copy_lines(int addr) { line_t *lp, *np = get_addressed_line_node(first_addr); undo_t *up = NULL; @@ -1255,8 +1245,7 @@ copy_lines(addr) /* delete_lines: delete a range of lines */ int -delete_lines(from, to) - int from, to; +delete_lines(int from, int to) { line_t *n, *p; @@ -1281,10 +1270,7 @@ delete_lines(from, to) /* display_lines: print a range of lines to stdout */ int -display_lines(from, to, gflag) - int from; - int to; - int gflag; +display_lines(int from, int to, int gflag) { line_t *bp; line_t *ep; @@ -1313,9 +1299,7 @@ int markno; /* line marker count */ /* mark_line_node: set a line node mark */ int -mark_line_node(lp, n) - line_t *lp; - int n; +mark_line_node(line_t *lp, int n) { if (!islower(n)) { seterrmsg("invalid mark character"); @@ -1329,8 +1313,7 @@ mark_line_node(lp, n) /* get_marked_node_addr: return address of a marked line */ int -get_marked_node_addr(n) - int n; +get_marked_node_addr(int n) { if (!islower(n)) { seterrmsg("invalid mark character"); @@ -1342,8 +1325,7 @@ get_marked_node_addr(n) /* unmark_line_node: clear line node mark */ void -unmark_line_node(lp) - line_t *lp; +unmark_line_node(line_t *lp) { int i; @@ -1357,8 +1339,7 @@ unmark_line_node(lp) /* dup_line_node: return a pointer to a copy of a line node */ line_t * -dup_line_node(lp) - line_t *lp; +dup_line_node(line_t *lp) { line_t *np; @@ -1376,9 +1357,7 @@ dup_line_node(lp) /* has_trailing_escape: return the parity of escapes preceding a character in a string */ int -has_trailing_escape(s, t) - char *s; - char *t; +has_trailing_escape(char *s, char *t) { return (s == t || *(t - 1) != '\\') ? 0 : !has_trailing_escape(s, t - 1); } @@ -1386,8 +1365,7 @@ has_trailing_escape(s, t) /* strip_escapes: return copy of escaped string of at most length MAXPATHLEN */ char * -strip_escapes(s) - char *s; +strip_escapes(char *s) { static char *file = NULL; static int filesz = 0; @@ -1405,8 +1383,7 @@ strip_escapes(s) void -signal_hup(signo) - int signo; +signal_hup(int signo) { int save_errno = errno; @@ -1419,8 +1396,7 @@ signal_hup(signo) void -signal_int(signo) - int signo; +signal_int(int signo) { int save_errno = errno; @@ -1433,8 +1409,7 @@ signal_int(signo) void -handle_hup(signo) - int signo; +handle_hup(int signo) { char path[MAXPATHLEN]; char *hup = NULL; /* hup filename */ @@ -1454,8 +1429,7 @@ handle_hup(signo) void -handle_int(signo) - int signo; +handle_int(int signo) { if (!sigactive) _exit(1); @@ -1469,8 +1443,7 @@ handle_int(signo) void -handle_winch(signo) - int signo; +handle_winch(int signo) { int save_errno = errno; struct winsize ws; /* window size structure */ @@ -1488,8 +1461,7 @@ handle_winch(signo) /* is_legal_filename: return a legal filename */ int -is_legal_filename(s) - char *s; +is_legal_filename(char *s) { if (red && (*s == '!' || !strcmp(s, "..") || strchr(s, '/'))) { seterrmsg("shell access restricted"); diff --git a/bin/ed/re.c b/bin/ed/re.c index c12b3935214..b1626192529 100644 --- a/bin/ed/re.c +++ b/bin/ed/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.9 2002/06/09 05:47:27 todd Exp $ */ +/* $OpenBSD: re.c,v 1.10 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: re.c,v 1.14 1995/03/21 09:04:48 cgd Exp $ */ /* re.c: This file contains the regular expression interface routines for @@ -33,7 +33,7 @@ #if 0 static char *rcsid = "@(#)re.c,v 1.6 1994/02/01 00:34:43 alm Exp"; #else -static char rcsid[] = "$OpenBSD: re.c,v 1.9 2002/06/09 05:47:27 todd Exp $"; +static char rcsid[] = "$OpenBSD: re.c,v 1.10 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -47,7 +47,7 @@ char errmsg[MAXPATHLEN + 40] = ""; /* get_compiled_pattern: return pointer to compiled pattern from command buffer */ pattern_t * -get_compiled_pattern() +get_compiled_pattern(void) { static pattern_t *exp = NULL; @@ -85,8 +85,7 @@ get_compiled_pattern() /* extract_pattern: copy a pattern string from the command buffer; return pointer to the copy */ char * -extract_pattern(delimiter) - int delimiter; +extract_pattern(int delimiter) { static char *lhbuf = NULL; /* buffer */ static int lhbufsz = 0; /* buffer size */ @@ -122,8 +121,7 @@ extract_pattern(delimiter) /* parse_char_class: expand a POSIX character class */ char * -parse_char_class(s) - char *s; +parse_char_class(char *s) { int c, d; diff --git a/bin/ed/sub.c b/bin/ed/sub.c index 33767fb1620..5aaca73d392 100644 --- a/bin/ed/sub.c +++ b/bin/ed/sub.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sub.c,v 1.9 2002/06/09 05:47:27 todd Exp $ */ +/* $OpenBSD: sub.c,v 1.10 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: sub.c,v 1.4 1995/03/21 09:04:50 cgd Exp $ */ /* sub.c: This file contains the substitution routines for the ed @@ -33,7 +33,7 @@ #if 0 static char *rcsid = "@(#)sub.c,v 1.1 1994/02/01 00:34:44 alm Exp"; #else -static char rcsid[] = "$OpenBSD: sub.c,v 1.9 2002/06/09 05:47:27 todd Exp $"; +static char rcsid[] = "$OpenBSD: sub.c,v 1.10 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -46,9 +46,7 @@ int rhbufi; /* rhs substitution buffer index */ /* extract_subst_tail: extract substitution tail from the command buffer */ int -extract_subst_tail(flagp, np) - int *flagp; - int *np; +extract_subst_tail(int *flagp, int *np) { char delimiter; @@ -79,7 +77,7 @@ extract_subst_tail(flagp, np) /* extract_subst_template: return pointer to copy of substitution template in the command buffer */ char * -extract_subst_template() +extract_subst_template(void) { int n = 0; int i = 0; @@ -121,10 +119,7 @@ int rbufsz; /* substitute_matching_text buffer size */ /* search_and_replace: for each line in a range, change text matching a pattern according to a substitution template; return status */ int -search_and_replace(pat, gflag, kth) - pattern_t *pat; - int gflag; - int kth; +search_and_replace(pattern_t *pat, int gflag, int kth) { undo_t *up; char *txt; @@ -178,11 +173,7 @@ search_and_replace(pat, gflag, kth) /* substitute_matching_text: replace text matched by a pattern according to a substitution template; return pointer to the modified text */ int -substitute_matching_text(pat, lp, gflag, kth) - pattern_t *pat; - line_t *lp; - int gflag; - int kth; +substitute_matching_text(pattern_t *pat, line_t *lp, int gflag, int kth) { int off = 0; int changed = 0; @@ -239,11 +230,7 @@ substitute_matching_text(pat, lp, gflag, kth) /* apply_subst_template: modify text according to a substitution template; return offset to end of modified text */ int -apply_subst_template(boln, rm, off, re_nsub) - char *boln; - regmatch_t *rm; - int off; - int re_nsub; +apply_subst_template(char *boln, regmatch_t *rm, int off, int re_nsub) { int j = 0; int k = 0; diff --git a/bin/ed/undo.c b/bin/ed/undo.c index 76708f0191e..473dd41e404 100644 --- a/bin/ed/undo.c +++ b/bin/ed/undo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: undo.c,v 1.7 2003/02/18 13:14:43 jmc Exp $ */ +/* $OpenBSD: undo.c,v 1.8 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: undo.c,v 1.2 1995/03/21 09:04:52 cgd Exp $ */ /* undo.c: This file contains the undo routines for the ed line editor */ @@ -32,7 +32,7 @@ #if 0 static char *rcsid = "@(#)undo.c,v 1.1 1994/02/01 00:34:44 alm Exp"; #else -static char rcsid[] = "$OpenBSD: undo.c,v 1.7 2003/02/18 13:14:43 jmc Exp $"; +static char rcsid[] = "$OpenBSD: undo.c,v 1.8 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -46,10 +46,7 @@ int u_p = 0; /* undo stack pointer */ /* push_undo_stack: return pointer to initialized undo node */ undo_t * -push_undo_stack(type, from, to) - int type; - int from; - int to; +push_undo_stack(int type, int from, int to) { undo_t *t; @@ -93,7 +90,7 @@ int u_addr_last = -1; /* if >= 0, undo enabled */ /* pop_undo_stack: undo last change to the editor buffer */ int -pop_undo_stack() +pop_undo_stack(void) { int n; int o_current_addr = current_addr; @@ -142,7 +139,7 @@ pop_undo_stack() /* clear_undo_stack: clear the undo stack */ void -clear_undo_stack() +clear_undo_stack(void) { line_t *lp, *ep, *tl; diff --git a/bin/expr/expr.c b/bin/expr/expr.c index 27f67653a34..83bf979c3c9 100644 --- a/bin/expr/expr.c +++ b/bin/expr/expr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: expr.c,v 1.14 2003/05/14 01:15:01 jsyn Exp $ */ +/* $OpenBSD: expr.c,v 1.15 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: expr.c,v 1.3.6.1 1996/06/04 20:41:47 cgd Exp $ */ /* @@ -224,7 +224,7 @@ nexttoken(int pat) } __dead void -error() +error(void) { errx(2, "syntax error"); /* NOTREACHED */ diff --git a/bin/ls/cmp.c b/bin/ls/cmp.c index 128d383a6e4..1b8ba0f70a0 100644 --- a/bin/ls/cmp.c +++ b/bin/ls/cmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmp.c,v 1.4 2003/06/02 23:32:08 millert Exp $ */ +/* $OpenBSD: cmp.c,v 1.5 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: cmp.c,v 1.10 1996/07/08 10:32:01 mycroft Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)cmp.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: cmp.c,v 1.4 2003/06/02 23:32:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: cmp.c,v 1.5 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -51,22 +51,19 @@ static char rcsid[] = "$OpenBSD: cmp.c,v 1.4 2003/06/02 23:32:08 millert Exp $"; #include "extern.h" int -namecmp(a, b) - const FTSENT *a, *b; +namecmp(const FTSENT *a, const FTSENT *b) { return (strcmp(a->fts_name, b->fts_name)); } int -revnamecmp(a, b) - const FTSENT *a, *b; +revnamecmp(const FTSENT *a, const FTSENT *b) { return (strcmp(b->fts_name, a->fts_name)); } int -modcmp(a, b) - const FTSENT *a, *b; +modcmp(const FTSENT *a, const FTSENT *b) { if (b->fts_statp->st_mtime > a->fts_statp->st_mtime) return (1); @@ -81,8 +78,7 @@ modcmp(a, b) } int -revmodcmp(a, b) - const FTSENT *a, *b; +revmodcmp(const FTSENT *a, const FTSENT *b) { if (b->fts_statp->st_mtime > a->fts_statp->st_mtime) return (-1); @@ -97,8 +93,7 @@ revmodcmp(a, b) } int -acccmp(a, b) - const FTSENT *a, *b; +acccmp(const FTSENT *a, const FTSENT *b) { if (b->fts_statp->st_atime > a->fts_statp->st_atime) return (1); @@ -113,8 +108,7 @@ acccmp(a, b) } int -revacccmp(a, b) - const FTSENT *a, *b; +revacccmp(const FTSENT *a, const FTSENT *b) { if (b->fts_statp->st_atime > a->fts_statp->st_atime) return (-1); @@ -129,8 +123,7 @@ revacccmp(a, b) } int -statcmp(a, b) - const FTSENT *a, *b; +statcmp(const FTSENT *a, const FTSENT *b) { if (b->fts_statp->st_ctime > a->fts_statp->st_ctime) return (1); @@ -145,8 +138,7 @@ statcmp(a, b) } int -revstatcmp(a, b) - const FTSENT *a, *b; +revstatcmp(const FTSENT *a, const FTSENT *b) { if (b->fts_statp->st_ctime > a->fts_statp->st_ctime) return (-1); @@ -161,8 +153,7 @@ revstatcmp(a, b) } int -sizecmp(a, b) - const FTSENT *a, *b; +sizecmp(const FTSENT *a, const FTSENT *b) { if (b->fts_statp->st_size > a->fts_statp->st_size) return (1); @@ -173,8 +164,7 @@ sizecmp(a, b) } int -revsizecmp(a, b) - const FTSENT *a, *b; +revsizecmp(const FTSENT *a, const FTSENT *b) { if (b->fts_statp->st_size > a->fts_statp->st_size) return (-1); diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 17eb81dec44..0e3ce3c9682 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ls.c,v 1.19 2003/06/02 23:32:08 millert Exp $ */ +/* $OpenBSD: ls.c,v 1.20 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: ls.c,v 1.18 1996/07/09 09:16:29 mycroft Exp $ */ /* @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ls.c 8.7 (Berkeley) 8/5/94"; #else -static char rcsid[] = "$OpenBSD: ls.c,v 1.19 2003/06/02 23:32:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: ls.c,v 1.20 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -108,9 +108,7 @@ int f_whiteout; /* show whiteout entries */ int rval; int -ls_main(argc, argv) - int argc; - char *argv[]; +ls_main(int argc, char *argv[]) { static char dot[] = ".", *dotav[] = { dot, NULL }; struct winsize win; @@ -338,9 +336,7 @@ static int output; /* If anything output. */ * a superset (may be exact set) of the files to be displayed. */ static void -traverse(argc, argv, options) - int argc, options; - char *argv[]; +traverse(int argc, char *argv[], int options) { FTS *ftsp; FTSENT *p, *chp; @@ -404,8 +400,7 @@ traverse(argc, argv, options) * points to the parent directory of the display list. */ static void -display(p, list) - FTSENT *p, *list; +display(FTSENT *p, FTSENT *list) { struct stat *sp; DISPLAY d; @@ -560,8 +555,7 @@ display(p, list) * All other levels use the sort function. Error entries remain unsorted. */ static int -mastercmp(a, b) - const FTSENT **a, **b; +mastercmp(const FTSENT **a, const FTSENT **b) { int a_info, b_info; diff --git a/bin/ls/main.c b/bin/ls/main.c index 544659b5978..3a851919ae5 100644 --- a/bin/ls/main.c +++ b/bin/ls/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.2 2002/02/16 21:27:07 millert Exp $ */ +/* $OpenBSD: main.c,v 1.3 2003/06/11 23:42:12 deraadt Exp $ */ /* * Public domain - no warranty. @@ -9,9 +9,7 @@ int ls_main(int argc, char **argv); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { return ls_main(argc, argv); } diff --git a/bin/ls/print.c b/bin/ls/print.c index 5736dd541b2..90b65f751a8 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.18 2003/06/02 23:32:08 millert Exp $ */ +/* $OpenBSD: print.c,v 1.19 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: print.c,v 1.15 1996/12/11 03:25:39 thorpej Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)print.c 8.5 (Berkeley) 7/28/94"; #else -static char rcsid[] = "$OpenBSD: print.c,v 1.18 2003/06/02 23:32:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: print.c,v 1.19 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -68,8 +68,7 @@ static int compute_columns(DISPLAY *, int *); #define IS_NOPRINT(p) ((p)->fts_number == NO_PRINT) void -printscol(dp) - DISPLAY *dp; +printscol(DISPLAY *dp) { FTSENT *p; @@ -82,8 +81,7 @@ printscol(dp) } void -printlong(dp) - DISPLAY *dp; +printlong(DISPLAY *dp) { struct stat *sp; FTSENT *p; @@ -133,9 +131,7 @@ printlong(dp) } static int -compute_columns(dp, pnum) - DISPLAY *dp; - int *pnum; +compute_columns(DISPLAY *dp, int *pnum) { int colwidth; extern int termwidth; @@ -162,8 +158,7 @@ compute_columns(dp, pnum) } void -printcol(dp) - DISPLAY *dp; +printcol(DISPLAY *dp) { static FTSENT **array; static int lastentries = -1; @@ -218,9 +213,7 @@ printcol(dp) * return # of characters printed, no trailing characters. */ static int -printaname(p, inodefield, sizefield) - FTSENT *p; - u_long sizefield, inodefield; +printaname(FTSENT *p, u_long inodefield, u_long sizefield) { struct stat *sp; int chcnt; @@ -239,8 +232,7 @@ printaname(p, inodefield, sizefield) } static void -printtime(ftime) - time_t ftime; +printtime(time_t ftime) { int i; char *longstring; @@ -265,8 +257,7 @@ printtime(ftime) } void -printacol(dp) - DISPLAY *dp; +printacol(DISPLAY *dp) { FTSENT *p; int chcnt, col, colwidth; @@ -296,8 +287,7 @@ printacol(dp) } void -printstream(dp) - DISPLAY *dp; +printstream(DISPLAY *dp) { extern int termwidth; FTSENT *p; @@ -328,8 +318,7 @@ printstream(dp) } static int -printtype(mode) - u_int mode; +printtype(u_int mode) { switch (mode & S_IFMT) { case S_IFDIR: @@ -356,8 +345,7 @@ printtype(mode) } static void -printlink(p) - FTSENT *p; +printlink(FTSENT *p) { int lnklen; char name[MAXPATHLEN], path[MAXPATHLEN]; diff --git a/bin/ls/util.c b/bin/ls/util.c index 298a194cc83..29bb7f295d2 100644 --- a/bin/ls/util.c +++ b/bin/ls/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.8 2003/06/02 23:32:08 millert Exp $ */ +/* $OpenBSD: util.c,v 1.9 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: util.c,v 1.12 1995/09/07 06:43:02 jtc Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)util.c 8.5 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: util.c,v 1.8 2003/06/02 23:32:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: util.c,v 1.9 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -54,8 +54,7 @@ static char rcsid[] = "$OpenBSD: util.c,v 1.8 2003/06/02 23:32:08 millert Exp $" #include "extern.h" int -putname(name) - char *name; +putname(char *name) { int len; @@ -65,7 +64,7 @@ putname(name) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: %s [-1ACFLRSTWacdfiklmnopqrstux] [file ...]\n", diff --git a/bin/md5/md5.c b/bin/md5/md5.c index 1f449ab4864..cbb6051ed84 100644 --- a/bin/md5/md5.c +++ b/bin/md5/md5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md5.c,v 1.22 2003/06/03 01:52:39 millert Exp $ */ +/* $OpenBSD: md5.c,v 1.23 2003/06/11 23:42:12 deraadt Exp $ */ /* * Copyright (c) 2001,2003 Todd C. Miller <Todd.Miller@courtesan.com> @@ -47,6 +47,7 @@ struct hash_functions { char * (*file)(); char * (*data)(); }; + struct hash_functions functions[] = { { "MD5", @@ -386,7 +387,7 @@ digest_test(struct hash_functions *hf) } static void -usage() +usage(void) { fprintf(stderr, "usage: %s [-p | -t | -x | -c [ checksum_file ... ]", __progname); diff --git a/bin/mt/mtrmt.c b/bin/mt/mtrmt.c index c99336f4711..4c5eefdc85d 100644 --- a/bin/mt/mtrmt.c +++ b/bin/mt/mtrmt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mtrmt.c,v 1.13 2003/06/02 23:32:08 millert Exp $ */ +/* $OpenBSD: mtrmt.c,v 1.14 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: mtrmt.c,v 1.2 1996/03/06 06:22:07 scottr Exp $ */ /*- @@ -85,8 +85,7 @@ static void rmtgets(char *, int); static int rmtreply(char *); int -rmthost(host) - char *host; +rmthost(char *host) { int len = strlen(host) + 1; @@ -118,7 +117,7 @@ rmtconnaborted(void) } void -rmtgetconn() +rmtgetconn(void) { char *cp; static struct servent *sp = NULL; @@ -174,8 +173,7 @@ rmtgetconn() } static int -okname(cp0) - char *cp0; +okname(char *cp0) { char *cp; int c; @@ -191,9 +189,7 @@ okname(cp0) } int -rmtopen(tape, mode) - char *tape; - int mode; +rmtopen(char *tape, int mode) { char buf[256]; @@ -203,7 +199,7 @@ rmtopen(tape, mode) } void -rmtclose() +rmtclose(void) { if (rmtstate != TS_OPEN) @@ -215,7 +211,7 @@ rmtclose() struct mtget mts; struct mtget * -rmtstatus() +rmtstatus(void) { int i; char *cp; @@ -229,8 +225,7 @@ rmtstatus() } int -rmtioctl(cmd, count) - int cmd, count; +rmtioctl(int cmd, int count) { char buf[256]; @@ -241,8 +236,7 @@ rmtioctl(cmd, count) } static int -rmtcall(cmd, buf) - char *cmd, *buf; +rmtcall(char *cmd, char *buf) { if (write(rmtape, buf, strlen(buf)) != strlen(buf)) @@ -251,8 +245,7 @@ rmtcall(cmd, buf) } static int -rmtreply(cmd) - char *cmd; +rmtreply(char *cmd) { char *cp; char code[30], emsg[BUFSIZ]; @@ -281,7 +274,7 @@ rmtreply(cmd) } int -rmtgetb() +rmtgetb(void) { char c; @@ -292,9 +285,7 @@ rmtgetb() /* Get a line (guaranteed to have a trailing newline). */ void -rmtgets(line, len) - char *line; - int len; +rmtgets(char *line, int len) { char *cp = line; diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c index 5f4e1879a9e..882d3af1d1f 100644 --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keyword.c,v 1.17 2003/06/02 23:32:09 millert Exp $ */ +/* $OpenBSD: keyword.c,v 1.18 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: keyword.c,v 1.12.6.1 1996/05/30 21:25:13 cgd Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)keyword.c 8.5 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: keyword.c,v 1.17 2003/06/02 23:32:09 millert Exp $"; +static char rcsid[] = "$OpenBSD: keyword.c,v 1.18 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -187,7 +187,7 @@ VAR var[] = { }; void -showkey() +showkey(void) { VAR *v; int i; @@ -208,8 +208,7 @@ showkey() } void -parsefmt(p) - char *p; +parsefmt(char *p) { static struct varent *vtail; @@ -242,8 +241,7 @@ parsefmt(p) } static VAR * -findvar(p) - char *p; +findvar(char *p) { VAR *v, key; char *hp; @@ -277,8 +275,7 @@ findvar(p) } static int -vcmp(a, b) - const void *a, *b; +vcmp(const void *a, const void *b) { return (strcmp(((VAR *)a)->name, ((VAR *)b)->name)); } diff --git a/bin/ps/nlist.c b/bin/ps/nlist.c index 8a93777a9e5..342bd4b046b 100644 --- a/bin/ps/nlist.c +++ b/bin/ps/nlist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nlist.c,v 1.13 2003/06/02 23:32:09 millert Exp $ */ +/* $OpenBSD: nlist.c,v 1.14 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: nlist.c,v 1.11 1995/03/21 09:08:03 cgd Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)nlist.c 8.4 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: nlist.c,v 1.13 2003/06/02 23:32:09 millert Exp $"; +static char rcsid[] = "$OpenBSD: nlist.c,v 1.14 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -79,7 +79,7 @@ extern int kvm_sysctl_only; kvm_read(kd, psnl[x].n_value, &v, sizeof v) != sizeof(v) int -donlist() +donlist(void) { int rval, mib[2]; size_t siz; @@ -109,8 +109,7 @@ donlist() warnx("maxslp: %s", kvm_geterr(kd)); eval = rval = 1; } - } - else { + } else { siz = sizeof (fscale); mib[0] = CTL_KERN; mib[1] = KERN_FSCALE; @@ -145,8 +144,7 @@ donlist() } void -nlisterr(nl) - struct nlist nl[]; +nlisterr(struct nlist nl[]) { int i; diff --git a/bin/ps/print.c b/bin/ps/print.c index 69387be61fd..a6cbd76acb5 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.30 2003/06/02 23:32:09 millert Exp $ */ +/* $OpenBSD: print.c,v 1.31 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: print.c,v 1.27 1995/09/29 21:58:12 cgd Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94"; #else -static char rcsid[] = "$OpenBSD: print.c,v 1.30 2003/06/02 23:32:09 millert Exp $"; +static char rcsid[] = "$OpenBSD: print.c,v 1.31 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -71,8 +71,7 @@ static char *cmdpart(char *); #define min(a,b) ((a) < (b) ? (a) : (b)) static char * -cmdpart(arg0) - char *arg0; +cmdpart(char *arg0) { char *cp; @@ -80,7 +79,7 @@ cmdpart(arg0) } void -printheader() +printheader(void) { VAR *v; struct varent *vent; @@ -101,9 +100,7 @@ printheader() } void -command(ki, ve) - KINFO *ki; - VARENT *ve; +command(KINFO *ki, VARENT *ve) { VAR *v; int left; @@ -157,9 +154,7 @@ command(ki, ve) } void -ucomm(k, ve) - KINFO *k; - VARENT *ve; +ucomm(KINFO *k, VARENT *ve) { VAR *v; @@ -168,9 +163,7 @@ ucomm(k, ve) } void -logname(k, ve) - KINFO *k; - VARENT *ve; +logname(KINFO *k, VARENT *ve) { VAR *v; @@ -187,9 +180,7 @@ logname(k, ve) #define pgtok(a) (((a)*getpagesize())/1024) void -state(k, ve) - KINFO *k; - VARENT *ve; +state(KINFO *k, VARENT *ve) { struct proc *p; int flag; @@ -260,9 +251,7 @@ state(k, ve) } void -pri(k, ve) - KINFO *k; - VARENT *ve; +pri(KINFO *k, VARENT *ve) { VAR *v; @@ -271,9 +260,7 @@ pri(k, ve) } void -uname(k, ve) - KINFO *k; - VARENT *ve; +uname(KINFO *k, VARENT *ve) { VAR *v; @@ -283,9 +270,7 @@ uname(k, ve) } void -runame(k, ve) - KINFO *k; - VARENT *ve; +runame(KINFO *k, VARENT *ve) { VAR *v; @@ -295,9 +280,7 @@ runame(k, ve) } void -gname(k, ve) - KINFO *k; - VARENT *ve; +gname(KINFO *k, VARENT *ve) { VAR *v; @@ -307,9 +290,7 @@ gname(k, ve) } void -rgname(k, ve) - KINFO *k; - VARENT *ve; +rgname(KINFO *k, VARENT *ve) { VAR *v; @@ -319,9 +300,7 @@ rgname(k, ve) } void -tdev(k, ve) - KINFO *k; - VARENT *ve; +tdev(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; @@ -339,9 +318,7 @@ tdev(k, ve) } void -tname(k, ve) - KINFO *k; - VARENT *ve; +tname(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; @@ -360,9 +337,7 @@ tname(k, ve) } void -longtname(k, ve) - KINFO *k; - VARENT *ve; +longtname(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; @@ -377,9 +352,7 @@ longtname(k, ve) } void -started(k, ve) - KINFO *k; - VARENT *ve; +started(KINFO *k, VARENT *ve) { VAR *v; static time_t now; @@ -407,9 +380,7 @@ started(k, ve) } void -lstarted(k, ve) - KINFO *k; - VARENT *ve; +lstarted(KINFO *k, VARENT *ve) { VAR *v; time_t startt; @@ -427,9 +398,7 @@ lstarted(k, ve) } void -wchan(k, ve) - KINFO *k; - VARENT *ve; +wchan(KINFO *k, VARENT *ve) { VAR *v; @@ -450,9 +419,7 @@ wchan(k, ve) } void -vsize(k, ve) - KINFO *k; - VARENT *ve; +vsize(KINFO *k, VARENT *ve) { VAR *v; @@ -463,9 +430,7 @@ vsize(k, ve) } void -rssize(k, ve) - KINFO *k; - VARENT *ve; +rssize(KINFO *k, VARENT *ve) { VAR *v; @@ -476,9 +441,7 @@ rssize(k, ve) } void -p_rssize(k, ve) /* doesn't account for text */ - KINFO *k; - VARENT *ve; +p_rssize(KINFO *k, VARENT *ve) { VAR *v; @@ -488,9 +451,7 @@ p_rssize(k, ve) /* doesn't account for text */ } void -cputime(k, ve) - KINFO *k; - VARENT *ve; +cputime(KINFO *k, VARENT *ve) { VAR *v; long secs; @@ -528,8 +489,7 @@ cputime(k, ve) } double -getpcpu(k) - KINFO *k; +getpcpu(KINFO *k) { struct proc *p; static int failure; @@ -561,9 +521,7 @@ getpcpu(k) } void -pcpu(k, ve) - KINFO *k; - VARENT *ve; +pcpu(KINFO *k, VARENT *ve) { VAR *v; @@ -572,8 +530,7 @@ pcpu(k, ve) } double -getpmem(k) - KINFO *k; +getpmem(KINFO *k) { static int failure; struct proc *p; @@ -598,9 +555,7 @@ getpmem(k) } void -pmem(k, ve) - KINFO *k; - VARENT *ve; +pmem(KINFO *k, VARENT *ve) { VAR *v; @@ -609,9 +564,7 @@ pmem(k, ve) } void -pagein(k, ve) - KINFO *k; - VARENT *ve; +pagein(KINFO *k, VARENT *ve) { VAR *v; @@ -621,9 +574,7 @@ pagein(k, ve) } void -maxrss(k, ve) - KINFO *k; - VARENT *ve; +maxrss(KINFO *k, VARENT *ve) { VAR *v; @@ -632,9 +583,7 @@ maxrss(k, ve) } void -tsize(k, ve) - KINFO *k; - VARENT *ve; +tsize(KINFO *k, VARENT *ve) { VAR *v; @@ -643,9 +592,7 @@ tsize(k, ve) } void -dsize(k, ve) - KINFO *k; - VARENT *ve; +dsize(KINFO *k, VARENT *ve) { VAR *v; @@ -654,9 +601,7 @@ dsize(k, ve) } void -ssize(k, ve) - KINFO *k; - VARENT *ve; +ssize(KINFO *k, VARENT *ve) { VAR *v; @@ -669,9 +614,7 @@ ssize(k, ve) * structures. */ static void -printval(bp, v) - char *bp; - VAR *v; +printval(char *bp, VAR *v) { static char ofmt[32] = "%"; char *fcp, *cp; @@ -749,9 +692,7 @@ printval(bp, v) } void -pvar(k, ve) - KINFO *k; - VARENT *ve; +pvar(KINFO *k, VARENT *ve) { VAR *v; @@ -760,9 +701,7 @@ pvar(k, ve) } void -evar(k, ve) - KINFO *k; - VARENT *ve; +evar(KINFO *k, VARENT *ve) { VAR *v; @@ -771,9 +710,7 @@ evar(k, ve) } void -uvar(k, ve) - KINFO *k; - VARENT *ve; +uvar(KINFO *k, VARENT *ve) { VAR *v; @@ -785,9 +722,7 @@ uvar(k, ve) } void -rvar(k, ve) - KINFO *k; - VARENT *ve; +rvar(KINFO *k, VARENT *ve) { VAR *v; @@ -799,9 +734,7 @@ rvar(k, ve) } void -emulname(k, ve) - KINFO *k; - VARENT *ve; +emulname(KINFO *k, VARENT *ve) { VAR *v; diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 2b986333766..e99fa1482a4 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ps.c,v 1.32 2003/06/02 23:32:09 millert Exp $ */ +/* $OpenBSD: ps.c,v 1.33 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: ps.c,v 1.32 2003/06/02 23:32:09 millert Exp $"; +static char rcsid[] = "$OpenBSD: ps.c,v 1.33 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -103,9 +103,7 @@ kvm_t *kd; int kvm_sysctl_only; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { struct kinfo_proc *kp; struct varent *vent; @@ -385,7 +383,7 @@ main(argc, argv) } static void -scanvars() +scanvars(void) { struct varent *vent; VAR *v; @@ -404,8 +402,7 @@ scanvars() } static void -saveuser(ki) - KINFO *ki; +saveuser(KINFO *ki) { struct usave *usp; @@ -419,8 +416,7 @@ saveuser(ki) } static int -pscomp(a, b) - const void *a, *b; +pscomp(const void *a, const void *b) { int i; #define VSIZE(k) (KI_EPROC(k)->e_vm.vm_dsize + KI_EPROC(k)->e_vm.vm_ssize + \ @@ -452,8 +448,7 @@ pscomp(a, b) * feature is available with the option 'T', which takes no argument. */ static char * -kludge_oldps_options(s) - char *s; +kludge_oldps_options(char *s) { size_t len; char *newopts, *ns, *cp; @@ -503,7 +498,7 @@ kludge_oldps_options(s) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: %s [-][acCehjklmrSTuvwx] [-O|o fmt] [-p pid] [-t tty] [-U user]\n", diff --git a/bin/stty/cchar.c b/bin/stty/cchar.c index d02d3f008ef..16e3eec6c78 100644 --- a/bin/stty/cchar.c +++ b/bin/stty/cchar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cchar.c,v 1.9 2003/06/02 23:32:09 millert Exp $ */ +/* $OpenBSD: cchar.c,v 1.10 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: cchar.c,v 1.10 1996/05/07 18:20:05 jtc Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)cchar.c 8.5 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: cchar.c,v 1.9 2003/06/02 23:32:09 millert Exp $"; +static char rcsid[] = "$OpenBSD: cchar.c,v 1.10 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -86,16 +86,13 @@ const struct cchar cchars2[] = { }; static int -c_cchar(a, b) - const void *a, *b; +c_cchar(const void *a, const void *b) { return (strcmp(((struct cchar *)a)->name, ((struct cchar *)b)->name)); } int -csearch(argvp, ip) - char ***argvp; - struct info *ip; +csearch(char ***argvp, struct info *ip) { struct cchar *cp, tmp; long val; diff --git a/bin/stty/gfmt.c b/bin/stty/gfmt.c index 460196162b1..aee5896e66b 100644 --- a/bin/stty/gfmt.c +++ b/bin/stty/gfmt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gfmt.c,v 1.5 2003/06/02 23:32:09 millert Exp $ */ +/* $OpenBSD: gfmt.c,v 1.6 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: gfmt.c,v 1.10 1996/05/07 18:20:08 jtc Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)gfmt.c 8.6 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: gfmt.c,v 1.5 2003/06/02 23:32:09 millert Exp $"; +static char rcsid[] = "$OpenBSD: gfmt.c,v 1.6 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -48,8 +48,7 @@ static char rcsid[] = "$OpenBSD: gfmt.c,v 1.5 2003/06/02 23:32:09 millert Exp $" #include "extern.h" static void -gerr(s) - char *s; +gerr(char *s) { if (s) errx(1, "illegal gfmt1 option -- %s", s); @@ -58,10 +57,7 @@ gerr(s) } void -gprint(tp, wp, ldisc) - struct termios *tp; - struct winsize *wp; - int ldisc; +gprint(struct termios *tp, struct winsize *wp, int ldisc) { const struct cchar *cp; @@ -73,9 +69,7 @@ gprint(tp, wp, ldisc) } void -gread(tp, s) - struct termios *tp; - char *s; +gread(struct termios *tp, char *s) { const struct cchar *cp; char *ep, *p; diff --git a/bin/stty/key.c b/bin/stty/key.c index f5808071cac..5d18a565aa1 100644 --- a/bin/stty/key.c +++ b/bin/stty/key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key.c,v 1.11 2003/06/02 23:32:09 millert Exp $ */ +/* $OpenBSD: key.c,v 1.12 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: key.c,v 1.11 1995/09/07 06:57:11 jtc Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)key.c 8.4 (Berkeley) 2/20/95"; #else -static char rcsid[] = "$OpenBSD: key.c,v 1.11 2003/06/02 23:32:09 millert Exp $"; +static char rcsid[] = "$OpenBSD: key.c,v 1.12 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -104,17 +104,14 @@ static struct key { }; static int -c_key(a, b) - const void *a, *b; +c_key(const void *a, const void *b) { return (strcmp(((struct key *)a)->name, ((struct key *)b)->name)); } int -ksearch(argvp, ip) - char ***argvp; - struct info *ip; +ksearch(char ***argvp, struct info *ip) { char *name; struct key *kp, tmp; @@ -143,15 +140,13 @@ ksearch(argvp, ip) } void -f_all(ip) - struct info *ip; +f_all(struct info *ip) { print(&ip->t, &ip->win, ip->ldisc, BSD); } void -f_cbreak(ip) - struct info *ip; +f_cbreak(struct info *ip) { if (ip->off) @@ -166,8 +161,7 @@ f_cbreak(ip) } void -f_columns(ip) - struct info *ip; +f_columns(struct info *ip) { ip->win.ws_col = atoi(ip->arg); @@ -175,8 +169,7 @@ f_columns(ip) } void -f_dec(ip) - struct info *ip; +f_dec(struct info *ip) { ip->t.c_cc[VERASE] = (u_char)0177; @@ -189,8 +182,7 @@ f_dec(ip) } void -f_ek(ip) - struct info *ip; +f_ek(struct info *ip) { ip->t.c_cc[VERASE] = CERASE; @@ -199,16 +191,14 @@ f_ek(ip) } void -f_everything(ip) - struct info *ip; +f_everything(struct info *ip) { print(&ip->t, &ip->win, ip->ldisc, BSD); } void -f_extproc(ip) - struct info *ip; +f_extproc(struct info *ip) { if (ip->off) { @@ -222,8 +212,7 @@ f_extproc(ip) } void -f_ispeed(ip) - struct info *ip; +f_ispeed(struct info *ip) { cfsetispeed(&ip->t, atoi(ip->arg)); @@ -231,8 +220,7 @@ f_ispeed(ip) } void -f_lcase(ip) - struct info *ip; +f_lcase(struct info *ip) { if (ip->off) { ip->t.c_iflag &= ~IUCLC; @@ -247,8 +235,7 @@ f_lcase(ip) } void -f_nl(ip) - struct info *ip; +f_nl(struct info *ip) { if (ip->off) { @@ -262,8 +249,7 @@ f_nl(ip) } void -f_ospeed(ip) - struct info *ip; +f_ospeed(struct info *ip) { cfsetospeed(&ip->t, atoi(ip->arg)); @@ -271,8 +257,7 @@ f_ospeed(ip) } void -f_raw(ip) - struct info *ip; +f_raw(struct info *ip) { if (ip->off) @@ -286,8 +271,7 @@ f_raw(ip) } void -f_rows(ip) - struct info *ip; +f_rows(struct info *ip) { ip->win.ws_row = atoi(ip->arg); @@ -295,8 +279,7 @@ f_rows(ip) } void -f_sane(ip) - struct info *ip; +f_sane(struct info *ip) { ip->t.c_cflag = TTYDEF_CFLAG | (ip->t.c_cflag & (CLOCAL|CRTSCTS)); @@ -310,24 +293,21 @@ f_sane(ip) } void -f_size(ip) - struct info *ip; +f_size(struct info *ip) { (void)printf("%d %d\n", ip->win.ws_row, ip->win.ws_col); } void -f_speed(ip) - struct info *ip; +f_speed(struct info *ip) { (void)printf("%d\n", cfgetospeed(&ip->t)); } void -f_tty(ip) - struct info *ip; +f_tty(struct info *ip) { int tmp; @@ -337,16 +317,14 @@ f_tty(ip) } void -f_ostart(ip) - struct info *ip; +f_ostart(struct info *ip) { if (ioctl (ip->fd, TIOCSTART) < 0) err(1, "TIOCSTART"); } void -f_ostop(ip) - struct info *ip; +f_ostop(struct info *ip) { if (ioctl (ip->fd, TIOCSTOP) < 0) err(1, "TIOCSTOP"); diff --git a/bin/stty/modes.c b/bin/stty/modes.c index bd2afe40995..a79953c1d3d 100644 --- a/bin/stty/modes.c +++ b/bin/stty/modes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: modes.c,v 1.6 2003/06/02 23:32:09 millert Exp $ */ +/* $OpenBSD: modes.c,v 1.7 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: modes.c,v 1.9 1996/05/07 18:20:09 jtc Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)modes.c 8.3 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: modes.c,v 1.6 2003/06/02 23:32:09 millert Exp $"; +static char rcsid[] = "$OpenBSD: modes.c,v 1.7 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -206,9 +206,7 @@ const struct modes omodes[] = { #define CHK(s) (!strcmp(name, s)) int -msearch(argvp, ip) - char ***argvp; - struct info *ip; +msearch(char ***argvp, struct info *ip) { const struct modes *mp; char *name; diff --git a/bin/stty/print.c b/bin/stty/print.c index f3a3c3589ae..0cfed316de7 100644 --- a/bin/stty/print.c +++ b/bin/stty/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.10 2003/06/02 23:32:09 millert Exp $ */ +/* $OpenBSD: print.c,v 1.11 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: print.c,v 1.11 1996/05/07 18:20:10 jtc Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94"; #else -static char rcsid[] = "$OpenBSD: print.c,v 1.10 2003/06/02 23:32:09 millert Exp $"; +static char rcsid[] = "$OpenBSD: print.c,v 1.11 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -52,11 +52,7 @@ static void bput(char *); static char *ccval(const struct cchar *, int); void -print(tp, wp, ldisc, fmt) - struct termios *tp; - struct winsize *wp; - int ldisc; - enum FMT fmt; +print(struct termios *tp, struct winsize *wp, int ldisc, enum FMT fmt) { const struct cchar *p; long tmp; @@ -220,8 +216,7 @@ static int col; static char *label; static void -binit(lb) - char *lb; +binit(char *lb) { if (col) { @@ -232,8 +227,7 @@ binit(lb) } static void -bput(s) - char *s; +bput(char *s) { if (col == 0) { @@ -249,9 +243,7 @@ bput(s) } static char * -ccval(p, c) - const struct cchar *p; - int c; +ccval(const struct cchar *p, int c) { static char buf[5]; char *bp; diff --git a/bin/stty/stty.c b/bin/stty/stty.c index 98970a68136..04be4dd104a 100644 --- a/bin/stty/stty.c +++ b/bin/stty/stty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stty.c,v 1.10 2003/06/02 23:32:09 millert Exp $ */ +/* $OpenBSD: stty.c,v 1.11 2003/06/11 23:42:12 deraadt Exp $ */ /* $NetBSD: stty.c,v 1.11 1995/03/21 09:11:30 cgd Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)stty.c 8.3 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: stty.c,v 1.10 2003/06/02 23:32:09 millert Exp $"; +static char rcsid[] = "$OpenBSD: stty.c,v 1.11 2003/06/11 23:42:12 deraadt Exp $"; #endif #endif /* not lint */ @@ -59,9 +59,7 @@ static char rcsid[] = "$OpenBSD: stty.c,v 1.10 2003/06/02 23:32:09 millert Exp $ #include "extern.h" int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { struct info i; enum FMT fmt; @@ -154,7 +152,7 @@ args: argc -= optind; } void -usage() +usage(void) { fprintf(stderr, "usage: %s [-a|-e|-g] [-f file] [operands]\n", __progname); |