diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/find/find.c | 12 | ||||
-rw-r--r-- | usr.bin/find/function.c | 152 | ||||
-rw-r--r-- | usr.bin/ftp/cmds.c | 299 | ||||
-rw-r--r-- | usr.bin/ftp/complete.c | 28 | ||||
-rw-r--r-- | usr.bin/ftp/domacro.c | 8 | ||||
-rw-r--r-- | usr.bin/ftp/fetch.c | 29 | ||||
-rw-r--r-- | usr.bin/ftp/ftp.c | 60 | ||||
-rw-r--r-- | usr.bin/ftp/main.c | 26 | ||||
-rw-r--r-- | usr.bin/ftp/ruserpass.c | 10 | ||||
-rw-r--r-- | usr.bin/ftp/stringlist.c | 18 | ||||
-rw-r--r-- | usr.bin/ftp/util.c | 58 | ||||
-rw-r--r-- | usr.bin/indent/args.c | 18 | ||||
-rw-r--r-- | usr.bin/indent/io.c | 40 | ||||
-rw-r--r-- | usr.bin/indent/lexi.c | 10 | ||||
-rw-r--r-- | usr.bin/indent/parse.c | 7 | ||||
-rw-r--r-- | usr.bin/indent/pr_comment.c | 6 | ||||
-rw-r--r-- | usr.bin/nc/atomicio.c | 6 | ||||
-rw-r--r-- | usr.bin/sed/misc.c | 15 | ||||
-rw-r--r-- | usr.bin/sort/append.c | 23 | ||||
-rw-r--r-- | usr.bin/sort/fields.c | 20 | ||||
-rw-r--r-- | usr.bin/sort/files.c | 51 | ||||
-rw-r--r-- | usr.bin/sort/fsort.c | 20 | ||||
-rw-r--r-- | usr.bin/sort/init.c | 30 | ||||
-rw-r--r-- | usr.bin/sort/msort.c | 38 |
24 files changed, 289 insertions, 695 deletions
diff --git a/usr.bin/find/find.c b/usr.bin/find/find.c index 6c9cfdcf8f2..a8547404d3b 100644 --- a/usr.bin/find/find.c +++ b/usr.bin/find/find.c @@ -1,4 +1,4 @@ -/* $OpenBSD: find.c,v 1.10 2003/06/26 07:27:29 deraadt Exp $ */ +/* $OpenBSD: find.c,v 1.11 2004/07/20 03:50:25 deraadt Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -34,7 +34,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)find.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: find.c,v 1.10 2003/06/26 07:27:29 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: find.c,v 1.11 2004/07/20 03:50:25 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -56,8 +56,7 @@ static char rcsid[] = "$OpenBSD: find.c,v 1.10 2003/06/26 07:27:29 deraadt Exp $ * command arguments. */ PLAN * -find_formplan(argv) - char **argv; +find_formplan(char **argv) { PLAN *plan, *tail, *new; @@ -150,9 +149,8 @@ FTS *tree; /* pointer to top of FTS hierarchy */ FTSENT *entry; /* shared with SIGINFO handler */ void -find_execute(plan, paths) - PLAN *plan; /* search plan */ - char **paths; /* array of pathnames to traverse */ +find_execute(PLAN *plan, /* search plan */ + char **paths) /* array of pathnames to traverse */ { sigset_t fullset, oset; PLAN *p; diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index dbd4a37f044..878c97ff119 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -1,4 +1,4 @@ -/* $OpenBSD: function.c,v 1.29 2004/07/01 18:25:47 otto Exp $ */ +/* $OpenBSD: function.c,v 1.30 2004/07/20 03:50:25 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.29 2004/07/01 18:25:47 otto Exp $"; +static char rcsid[] = "$OpenBSD: function.c,v 1.30 2004/07/20 03:50:25 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -125,9 +125,7 @@ extern FTS *tree; * Parse a string of the form [+-]# and return the value. */ static long -find_parsenum(plan, option, vp, endch) - PLAN *plan; - char *option, *vp, *endch; +find_parsenum(PLAN *plan, char *option, char *vp, char *endch) { long value; char *endchar, *str; /* Pointer to character ending conversion. */ @@ -180,9 +178,7 @@ find_parsenum(plan, option, vp, endch) * current time is n min periods. */ int -f_amin(plan, entry) - PLAN *plan; - FTSENT *entry; +f_amin(PLAN *plan, FTSENT *entry) { extern time_t now; @@ -210,9 +206,7 @@ c_amin(char *arg, char ***ignored, int unused) * current time is n 24 hour periods. */ int -f_atime(plan, entry) - PLAN *plan; - FTSENT *entry; +f_atime(PLAN *plan, FTSENT *entry) { COMPARE((now - entry->fts_statp->st_atime + @@ -239,9 +233,7 @@ c_atime(char *arg, char ***ignored, int unused) * status information and the current time is n min periods. */ int -f_cmin(plan, entry) - PLAN *plan; - FTSENT *entry; +f_cmin(PLAN *plan, FTSENT *entry) { extern time_t now; @@ -269,9 +261,7 @@ c_cmin(char *arg, char ***ignored, int unused) * status information and the current time is n 24 hour periods. */ int -f_ctime(plan, entry) - PLAN *plan; - FTSENT *entry; +f_ctime(PLAN *plan, FTSENT *entry) { COMPARE((now - entry->fts_statp->st_ctime + @@ -299,9 +289,7 @@ c_ctime(char *arg, char ***ignored, int unused) * itself. */ int -f_always_true(plan, entry) - PLAN *plan; - FTSENT *entry; +f_always_true(PLAN *plan, FTSENT *entry) { return (1); } @@ -320,9 +308,7 @@ c_depth(char *ignore, char ***ignored, int unused) * True if the file or directory is empty */ int -f_empty(plan, entry) - PLAN *plan; - FTSENT *entry; +f_empty(PLAN *plan, FTSENT *entry) { if (S_ISREG(entry->fts_statp->st_mode) && entry->fts_statp->st_size == 0) return (1); @@ -369,9 +355,7 @@ c_empty(char *ignore, char ***ignored, int unused) * user before executing the utility. */ int -f_exec(plan, entry) - PLAN *plan; - FTSENT *entry; +f_exec(PLAN *plan, FTSENT *entry) { int cnt; pid_t pid; @@ -468,9 +452,7 @@ c_exec(char *unused, char ***argvp, int isok) * the directory where the file lives. */ int -f_execdir(plan, entry) - PLAN *plan; - FTSENT *entry; +f_execdir(PLAN *plan, FTSENT *entry) { int cnt; pid_t pid; @@ -582,9 +564,7 @@ c_execdir(char *ignored, char ***argvp, int unused) * The flags argument is used to represent file flags bits. */ int -f_flags(plan, entry) - PLAN *plan; - FTSENT *entry; +f_flags(PLAN *plan, FTSENT *entry) { u_int flags; @@ -644,9 +624,7 @@ c_follow(char *ignore, char ***ignored, int unused) * True if the file is of a certain type. */ int -f_fstype(plan, entry) - PLAN *plan; - FTSENT *entry; +f_fstype(PLAN *plan, FTSENT *entry) { static dev_t curdev; /* need a guaranteed illegal dev value */ static int first = 1; @@ -742,9 +720,7 @@ c_fstype(char *arg, char ***ignored, int unused) * name, gname is taken as a group ID. */ int -f_group(plan, entry) - PLAN *plan; - FTSENT *entry; +f_group(PLAN *plan, FTSENT *entry) { return (entry->fts_statp->st_gid == plan->g_data); } @@ -777,9 +753,7 @@ c_group(char *gname, char ***ignored, int unused) * True if the file has inode # n. */ int -f_inum(plan, entry) - PLAN *plan; - FTSENT *entry; +f_inum(PLAN *plan, FTSENT *entry) { COMPARE(entry->fts_statp->st_ino, plan->i_data); } @@ -802,9 +776,7 @@ c_inum(char *arg, char ***ignored, int unused) * True if the file has n links. */ int -f_links(plan, entry) - PLAN *plan; - FTSENT *entry; +f_links(PLAN *plan, FTSENT *entry) { COMPARE(entry->fts_statp->st_nlink, plan->l_data); } @@ -827,9 +799,7 @@ c_links(char *arg, char ***ignored, int unused) * Always true - prints the current entry to stdout in "ls" format. */ int -f_ls(plan, entry) - PLAN *plan; - FTSENT *entry; +f_ls(PLAN *plan, FTSENT *entry) { printlong(entry->fts_path, entry->fts_accpath, entry->fts_statp); return (1); @@ -851,9 +821,7 @@ c_ls(char *ignore, char ***ignored, int unused) * maximum depth specified */ int -f_maxdepth(plan, entry) - PLAN *plan; - FTSENT *entry; +f_maxdepth(PLAN *plan, FTSENT *entry) { if (entry->fts_level >= plan->max_data) @@ -878,9 +846,7 @@ c_maxdepth(char *arg, char ***ignored, int unused) * minimum depth specified */ int -f_mindepth(plan, entry) - PLAN *plan; - FTSENT *entry; +f_mindepth(PLAN *plan, FTSENT *entry) { return (entry->fts_level >= plan->min_data); @@ -903,9 +869,7 @@ c_mindepth(char *arg, char ***ignored, int unused) * current time is n 24 hour periods. */ int -f_mtime(plan, entry) - PLAN *plan; - FTSENT *entry; +f_mtime(PLAN *plan, FTSENT *entry) { COMPARE((now - entry->fts_statp->st_mtime + SECSPERDAY - 1) / @@ -932,9 +896,7 @@ c_mtime(char *arg, char ***ignored, int unused) * current time is n min periods. */ int -f_mmin(plan, entry) - PLAN *plan; - FTSENT *entry; +f_mmin(PLAN *plan, FTSENT *entry) { extern time_t now; @@ -962,9 +924,7 @@ c_mmin(char *arg, char ***ignored, int unused) * matches pattern using Pattern Matching Notation S3.14 */ int -f_name(plan, entry) - PLAN *plan; - FTSENT *entry; +f_name(PLAN *plan, FTSENT *entry) { return (!fnmatch(plan->c_data, entry->fts_name, 0)); } @@ -986,9 +946,7 @@ c_name(char *pattern, char ***ignored, int unused) * */ int -f_iname(plan, entry) - PLAN *plan; - FTSENT *entry; +f_iname(PLAN *plan, FTSENT *entry) { return (!fnmatch(plan->c_data, entry->fts_name, FNM_CASEFOLD)); } @@ -1011,9 +969,7 @@ c_iname(char *pattern, char ***ignored, int unused) * file. */ int -f_newer(plan, entry) - PLAN *plan; - FTSENT *entry; +f_newer(PLAN *plan, FTSENT *entry) { return (entry->fts_statp->st_mtimespec.tv_sec > plan->t_data.tv_sec || @@ -1044,9 +1000,7 @@ c_newer(char *filename, char ***ignored, int unused) * file. */ int -f_anewer(plan, entry) - PLAN *plan; - FTSENT *entry; +f_anewer(PLAN *plan, FTSENT *entry) { return (entry->fts_statp->st_atimespec.tv_sec > plan->t_data.tv_sec || @@ -1077,9 +1031,7 @@ c_anewer(char *filename, char ***ignored, int unused) * file. */ int -f_cnewer(plan, entry) - PLAN *plan; - FTSENT *entry; +f_cnewer(PLAN *plan, FTSENT *entry) { return (entry->fts_statp->st_ctimespec.tv_sec > plan->t_data.tv_sec || @@ -1109,9 +1061,7 @@ c_cnewer(char *filename, char ***ignored, int unused) * of the getgrnam() 9.2.1 [POSIX.1] function returns NULL. */ int -f_nogroup(plan, entry) - PLAN *plan; - FTSENT *entry; +f_nogroup(PLAN *plan, FTSENT *entry) { return (group_from_gid(entry->fts_statp->st_gid, 1) ? 0 : 1); } @@ -1131,9 +1081,7 @@ c_nogroup(char *ignore, char ***ignored, int unused) * of the getpwuid() 9.2.2 [POSIX.1] function returns NULL. */ int -f_nouser(plan, entry) - PLAN *plan; - FTSENT *entry; +f_nouser(PLAN *plan, FTSENT *entry) { return (user_from_uid(entry->fts_statp->st_uid, 1) ? 0 : 1); } @@ -1153,9 +1101,7 @@ c_nouser(char *ignore, char ***ignored, int unused) * matches pattern using Pattern Matching Notation S3.14 */ int -f_path(plan, entry) - PLAN *plan; - FTSENT *entry; +f_path(PLAN *plan, FTSENT *entry) { return (!fnmatch(plan->c_data, entry->fts_path, 0)); } @@ -1178,9 +1124,7 @@ c_path(char *pattern, char ***ignored, int unused) * symbolic mode. */ int -f_perm(plan, entry) - PLAN *plan; - FTSENT *entry; +f_perm(PLAN *plan, FTSENT *entry) { mode_t mode; @@ -1223,9 +1167,7 @@ c_perm(char *perm, char ***ignored, int unused) * standard output. */ int -f_print(plan, entry) - PLAN *plan; - FTSENT *entry; +f_print(PLAN *plan, FTSENT *entry) { (void)printf("%s\n", entry->fts_path); return(1); @@ -1233,9 +1175,7 @@ f_print(plan, entry) /* ARGSUSED */ int -f_print0(plan, entry) - PLAN *plan; - FTSENT *entry; +f_print0(PLAN *plan, FTSENT *entry) { (void)fputs(entry->fts_path, stdout); (void)fputc('\0', stdout); @@ -1264,9 +1204,7 @@ c_print0(char *ignore, char ***ignored, int unused) * Prune a portion of the hierarchy. */ int -f_prune(plan, entry) - PLAN *plan; - FTSENT *entry; +f_prune(PLAN *plan, FTSENT *entry) { if (fts_set(tree, entry, FTS_SKIP)) @@ -1291,9 +1229,7 @@ c_prune(char *ignore, char ***ignored, int unused) static int divsize = 1; int -f_size(plan, entry) - PLAN *plan; - FTSENT *entry; +f_size(PLAN *plan, FTSENT *entry) { off_t size; @@ -1326,9 +1262,7 @@ c_size(char *arg, char ***ignored, int unused) * regular file, respectively. */ int -f_type(plan, entry) - PLAN *plan; - FTSENT *entry; +f_type(PLAN *plan, FTSENT *entry) { return ((entry->fts_statp->st_mode & S_IFMT) == plan->m_data); } @@ -1387,9 +1321,7 @@ c_type(char *typestring, char ***ignored, int unused) * return a valid user name, uname is taken as a user ID. */ int -f_user(plan, entry) - PLAN *plan; - FTSENT *entry; +f_user(PLAN *plan, FTSENT *entry) { return (entry->fts_statp->st_uid == plan->u_data); } @@ -1436,9 +1368,7 @@ c_xdev(char *ignore, char ***ignored, int unused) * True if expression is true. */ int -f_expr(plan, entry) - PLAN *plan; - FTSENT *entry; +f_expr(PLAN *plan, FTSENT *entry) { PLAN *p; int state; @@ -1471,9 +1401,7 @@ c_closeparen(char *ignore, char ***ignored, int unused) * Negation of a primary; the unary NOT operator. */ int -f_not(plan, entry) - PLAN *plan; - FTSENT *entry; +f_not(PLAN *plan, FTSENT *entry) { PLAN *p; int state; @@ -1496,9 +1424,7 @@ c_not(char *ignore, char ***ignored, int unused) * not evaluated if the first expression is true. */ int -f_or(plan, entry) - PLAN *plan; - FTSENT *entry; +f_or(PLAN *plan, FTSENT *entry) { PLAN *p; int state; diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c index 754e7ef015a..614d5fda8fe 100644 --- a/usr.bin/ftp/cmds.c +++ b/usr.bin/ftp/cmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmds.c,v 1.46 2003/12/16 21:46:22 deraadt Exp $ */ +/* $OpenBSD: cmds.c,v 1.47 2004/07/20 03:50:25 deraadt Exp $ */ /* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */ /* @@ -60,7 +60,7 @@ */ #if !defined(lint) && !defined(SMALL) -static char rcsid[] = "$OpenBSD: cmds.c,v 1.46 2003/12/16 21:46:22 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: cmds.c,v 1.47 2004/07/20 03:50:25 deraadt Exp $"; #endif /* not lint and not SMALL */ /* @@ -106,9 +106,7 @@ struct types { * Set transfer type. */ void -settype(argc, argv) - int argc; - char *argv[]; +settype(int argc, char *argv[]) { struct types *p; int comret; @@ -155,8 +153,7 @@ settype(argc, argv) * Used to change to and from ascii for listings. */ void -changetype(newtype, show) - int newtype, show; +changetype(int newtype, int show) { struct types *p; int comret, oldverbose = verbose; @@ -194,9 +191,7 @@ char *stype[] = { */ /*VARARGS*/ void -setbinary(argc, argv) - int argc; - char *argv[]; +setbinary(int argc, char *argv[]) { stype[1] = "binary"; @@ -208,9 +203,7 @@ setbinary(argc, argv) */ /*VARARGS*/ void -setascii(argc, argv) - int argc; - char *argv[]; +setascii(int argc, char *argv[]) { stype[1] = "ascii"; @@ -222,9 +215,7 @@ setascii(argc, argv) */ /*VARARGS*/ void -settenex(argc, argv) - int argc; - char *argv[]; +settenex(int argc, char *argv[]) { stype[1] = "tenex"; @@ -236,9 +227,7 @@ settenex(argc, argv) */ /*ARGSUSED*/ void -setftmode(argc, argv) - int argc; - char *argv[]; +setftmode(int argc, char *argv[]) { fprintf(ttyout, "We only support %s mode, sorry.\n", modename); @@ -250,9 +239,7 @@ setftmode(argc, argv) */ /*ARGSUSED*/ void -setform(argc, argv) - int argc; - char *argv[]; +setform(int argc, char *argv[]) { fprintf(ttyout, "We only support %s format, sorry.\n", formname); @@ -264,9 +251,7 @@ setform(argc, argv) */ /*ARGSUSED*/ void -setstruct(argc, argv) - int argc; - char *argv[]; +setstruct(int argc, char *argv[]) { fprintf(ttyout, "We only support %s structure, sorry.\n", structname); @@ -277,9 +262,7 @@ setstruct(argc, argv) * Send a single file. */ void -put(argc, argv) - int argc; - char *argv[]; +put(int argc, char *argv[]) { char *cmd; int loc = 0; @@ -328,9 +311,7 @@ usage: * Send multiple files. */ void -mput(argc, argv) - int argc; - char *argv[]; +mput(int argc, char *argv[]) { int i; sig_t oldintr; @@ -449,18 +430,14 @@ mput(argc, argv) } void -reget(argc, argv) - int argc; - char *argv[]; +reget(int argc, char *argv[]) { (void)getit(argc, argv, 1, "r+w"); } void -get(argc, argv) - int argc; - char *argv[]; +get(int argc, char *argv[]) { (void)getit(argc, argv, 0, restart_point ? "r+w" : "w" ); @@ -470,11 +447,7 @@ get(argc, argv) * Receive one file. */ int -getit(argc, argv, restartit, mode) - int argc; - char *argv[]; - int restartit; - const char *mode; +getit(int argc, char *argv[], int restartit, const char *mode) { int loc = 0; int rval = 0; @@ -560,8 +533,7 @@ freegetit: /* ARGSUSED */ void -mabort(signo) - int signo; +mabort(int signo) { int ointer, oconf; @@ -589,9 +561,7 @@ mabort(signo) * Get multiple files. */ void -mget(argc, argv) - int argc; - char *argv[]; +mget(int argc, char *argv[]) { sig_t oldintr; int ch, ointer; @@ -640,8 +610,7 @@ mget(argc, argv) } char * -onoff(bool) - int bool; +onoff(int bool) { return (bool ? "on" : "off"); @@ -652,9 +621,7 @@ onoff(bool) */ /*ARGSUSED*/ void -status(argc, argv) - int argc; - char *argv[]; +status(int argc, char *argv[]) { int i; @@ -719,11 +686,7 @@ status(argc, argv) * Toggle a variable */ int -togglevar(argc, argv, var, mesg) - int argc; - char *argv[]; - int *var; - const char *mesg; +togglevar(int argc, char *argv[], int *var, const char *mesg) { if (argc < 2) { *var = !*var; @@ -745,9 +708,7 @@ togglevar(argc, argv, var, mesg) */ /*VARARGS*/ void -setbell(argc, argv) - int argc; - char *argv[]; +setbell(int argc, char *argv[]) { code = togglevar(argc, argv, &bell, "Bell mode"); @@ -759,9 +720,7 @@ setbell(argc, argv) */ /*VARARGS*/ void -setedit(argc, argv) - int argc; - char *argv[]; +setedit(int argc, char *argv[]) { code = togglevar(argc, argv, &editing, "Editing mode"); @@ -774,9 +733,7 @@ setedit(argc, argv) */ /*VARARGS*/ void -setepsv4(argc, argv) - int argc; - char *argv[]; +setepsv4(int argc, char *argv[]) { code = togglevar(argc, argv, &epsv4, "EPSV/EPRT on IPv4"); @@ -788,9 +745,7 @@ setepsv4(argc, argv) */ /*VARARGS*/ void -settrace(argc, argv) - int argc; - char *argv[]; +settrace(int argc, char *argv[]) { code = togglevar(argc, argv, &trace, "Packet tracing"); @@ -801,9 +756,7 @@ settrace(argc, argv) */ /*VARARGS*/ void -sethash(argc, argv) - int argc; - char *argv[]; +sethash(int argc, char *argv[]) { if (argc == 1) hash = !hash; @@ -840,9 +793,7 @@ sethash(argc, argv) */ /*VARARGS*/ void -setverbose(argc, argv) - int argc; - char *argv[]; +setverbose(int argc, char *argv[]) { code = togglevar(argc, argv, &verbose, "Verbose mode"); @@ -853,9 +804,7 @@ setverbose(argc, argv) */ /*VARARGS*/ void -setport(argc, argv) - int argc; - char *argv[]; +setport(int argc, char *argv[]) { code = togglevar(argc, argv, &sendport, "Use of PORT/LPRT cmds"); @@ -866,9 +815,7 @@ setport(argc, argv) */ /*VARARGS*/ void -setprogress(argc, argv) - int argc; - char *argv[]; +setprogress(int argc, char *argv[]) { code = togglevar(argc, argv, &progress, "Progress bar"); @@ -879,9 +826,7 @@ setprogress(argc, argv) */ /*VARARGS*/ void -setprompt(argc, argv) - int argc; - char *argv[]; +setprompt(int argc, char *argv[]) { code = togglevar(argc, argv, &interactive, "Interactive mode"); @@ -892,9 +837,7 @@ setprompt(argc, argv) */ /*VARARGS*/ void -setgate(argc, argv) - int argc; - char *argv[]; +setgate(int argc, char *argv[]) { static char gsbuf[MAXHOSTNAMELEN]; @@ -953,9 +896,7 @@ setgate(argc, argv) */ /*VARARGS*/ void -setglob(argc, argv) - int argc; - char *argv[]; +setglob(int argc, char *argv[]) { code = togglevar(argc, argv, &doglob, "Globbing"); @@ -966,9 +907,7 @@ setglob(argc, argv) */ /*VARARGS*/ void -setpreserve(argc, argv) - int argc; - char *argv[]; +setpreserve(int argc, char *argv[]) { code = togglevar(argc, argv, &preserve, "Preserve modification times"); @@ -979,9 +918,7 @@ setpreserve(argc, argv) */ /*VARARGS*/ void -setdebug(argc, argv) - int argc; - char *argv[]; +setdebug(int argc, char *argv[]) { if (argc > 2) { fprintf(ttyout, "usage: %s [ on | off | debuglevel ]\n", argv[0]); @@ -1019,9 +956,7 @@ setdebug(argc, argv) * Set current working directory on remote machine. */ void -cd(argc, argv) - int argc; - char *argv[]; +cd(int argc, char *argv[]) { int r; @@ -1049,9 +984,7 @@ cd(argc, argv) * Set current working directory on local machine. */ void -lcd(argc, argv) - int argc; - char *argv[]; +lcd(int argc, char *argv[]) { char buf[MAXPATHLEN]; char *oldargv1; @@ -1086,9 +1019,7 @@ lcd(argc, argv) * Delete a single file. */ void -delete(argc, argv) - int argc; - char *argv[]; +delete(int argc, char *argv[]) { if ((argc < 2 && !another(&argc, &argv, "remote-file")) || argc > 2) { @@ -1103,9 +1034,7 @@ delete(argc, argv) * Delete multiple files. */ void -mdelete(argc, argv) - int argc; - char *argv[]; +mdelete(int argc, char *argv[]) { sig_t oldintr; int ointer; @@ -1145,9 +1074,7 @@ mdelete(argc, argv) * Rename a remote file. */ void -renamefile(argc, argv) - int argc; - char *argv[]; +renamefile(int argc, char *argv[]) { if (argc < 2 && !another(&argc, &argv, "from-name")) @@ -1166,9 +1093,7 @@ usage: * Get a directory listing of remote files. */ void -ls(argc, argv) - int argc; - char *argv[]; +ls(int argc, char *argv[]) { const char *cmd; char *oldargv2, *globargv2; @@ -1209,9 +1134,7 @@ freels: * Get a directory listing of multiple remote files. */ void -mls(argc, argv) - int argc; - char *argv[]; +mls(int argc, char *argv[]) { sig_t oldintr; int ointer, i; @@ -1260,9 +1183,7 @@ usage: */ /*ARGSUSED*/ void -shell(argc, argv) - int argc; - char *argv[]; +shell(int argc, char *argv[]) { pid_t pid; sig_t old1, old2; @@ -1319,9 +1240,7 @@ shell(argc, argv) * Send new user information (re-login) */ void -user(argc, argv) - int argc; - char *argv[]; +user(int argc, char *argv[]) { char acct[80]; int n, aflag = 0; @@ -1365,9 +1284,7 @@ user(argc, argv) */ /*VARARGS*/ void -pwd(argc, argv) - int argc; - char *argv[]; +pwd(int argc, char *argv[]) { int oldverbose = verbose; @@ -1386,9 +1303,7 @@ pwd(argc, argv) * Print working directory on local machine. */ void -lpwd(argc, argv) - int argc; - char *argv[]; +lpwd(int argc, char *argv[]) { char buf[MAXPATHLEN]; @@ -1403,9 +1318,7 @@ lpwd(argc, argv) * Make a directory. */ void -makedir(argc, argv) - int argc; - char *argv[]; +makedir(int argc, char *argv[]) { if ((argc < 2 && !another(&argc, &argv, "directory-name")) || @@ -1425,9 +1338,7 @@ makedir(argc, argv) * Remove a directory. */ void -removedir(argc, argv) - int argc; - char *argv[]; +removedir(int argc, char *argv[]) { if ((argc < 2 && !another(&argc, &argv, "directory-name")) || @@ -1447,9 +1358,7 @@ removedir(argc, argv) * Send a line, verbatim, to the remote machine. */ void -quote(argc, argv) - int argc; - char *argv[]; +quote(int argc, char *argv[]) { if (argc < 2 && !another(&argc, &argv, "command line to send")) { @@ -1466,9 +1375,7 @@ quote(argc, argv) * word "SITE" is added at the front. */ void -site(argc, argv) - int argc; - char *argv[]; +site(int argc, char *argv[]) { if (argc < 2 && !another(&argc, &argv, "arguments to SITE command")) { @@ -1484,10 +1391,7 @@ site(argc, argv) * Send the result as a one-line command and get response. */ void -quote1(initial, argc, argv) - const char *initial; - int argc; - char *argv[]; +quote1(const char *initial, int argc, char *argv[]) { int i, len; char buf[BUFSIZ]; /* must be >= sizeof(line) */ @@ -1526,9 +1430,7 @@ quote1(initial, argc, argv) } void -do_chmod(argc, argv) - int argc; - char *argv[]; +do_chmod(int argc, char *argv[]) { if (argc < 2 && !another(&argc, &argv, "mode")) @@ -1543,9 +1445,7 @@ usage: } void -do_umask(argc, argv) - int argc; - char *argv[]; +do_umask(int argc, char *argv[]) { int oldverbose = verbose; @@ -1555,9 +1455,7 @@ do_umask(argc, argv) } void -idle(argc, argv) - int argc; - char *argv[]; +idle(int argc, char *argv[]) { int oldverbose = verbose; @@ -1570,9 +1468,7 @@ idle(argc, argv) * Ask the other side for help. */ void -rmthelp(argc, argv) - int argc; - char *argv[]; +rmthelp(int argc, char *argv[]) { int oldverbose = verbose; @@ -1586,9 +1482,7 @@ rmthelp(argc, argv) */ /*VARARGS*/ void -quit(argc, argv) - int argc; - char *argv[]; +quit(int argc, char *argv[]) { if (connected) @@ -1604,9 +1498,7 @@ quit(argc, argv) * Terminate session, but don't exit. */ void -disconnect(argc, argv) - int argc; - char *argv[]; +disconnect(int argc, char *argv[]) { if (!connected) @@ -1624,9 +1516,7 @@ disconnect(argc, argv) } void -account(argc, argv) - int argc; - char *argv[]; +account(int argc, char *argv[]) { char *ap; @@ -1645,8 +1535,7 @@ account(argc, argv) jmp_buf abortprox; void -proxabort(notused) - int notused; +proxabort(int notused) { alarmtimer(0); @@ -1664,9 +1553,7 @@ proxabort(notused) } void -doproxy(argc, argv) - int argc; - char *argv[]; +doproxy(int argc, char *argv[]) { struct cmd *c; int cmdpos; @@ -1725,27 +1612,21 @@ doproxy(argc, argv) } void -setcase(argc, argv) - int argc; - char *argv[]; +setcase(int argc, char *argv[]) { code = togglevar(argc, argv, &mcase, "Case mapping"); } void -setcr(argc, argv) - int argc; - char *argv[]; +setcr(int argc, char *argv[]) { code = togglevar(argc, argv, &crflag, "Carriage Return stripping"); } void -setntrans(argc, argv) - int argc; - char *argv[]; +setntrans(int argc, char *argv[]) { if (argc == 1) { ntflag = 0; @@ -1764,8 +1645,7 @@ setntrans(argc, argv) } char * -dotrans(name) - char *name; +dotrans(char *name) { static char new[MAXPATHLEN]; char *cp1, *cp2 = new; @@ -1793,9 +1673,7 @@ dotrans(name) } void -setnmap(argc, argv) - int argc; - char *argv[]; +setnmap(int argc, char *argv[]) { char *cp; @@ -1827,8 +1705,7 @@ setnmap(argc, argv) } char * -domap(name) - char *name; +domap(char *name) { static char new[MAXPATHLEN]; char *cp1 = name, *cp2 = mapin; @@ -1999,9 +1876,7 @@ LOOP: } void -setpassive(argc, argv) - int argc; - char *argv[]; +setpassive(int argc, char *argv[]) { code = togglevar(argc, argv, &passivemode, @@ -2009,18 +1884,14 @@ setpassive(argc, argv) } void -setsunique(argc, argv) - int argc; - char *argv[]; +setsunique(int argc, char *argv[]) { code = togglevar(argc, argv, &sunique, "Store unique"); } void -setrunique(argc, argv) - int argc; - char *argv[]; +setrunique(int argc, char *argv[]) { code = togglevar(argc, argv, &runique, "Receive unique"); @@ -2028,9 +1899,7 @@ setrunique(argc, argv) /* change directory to parent directory */ void -cdup(argc, argv) - int argc; - char *argv[]; +cdup(int argc, char *argv[]) { int r; @@ -2048,9 +1917,7 @@ cdup(argc, argv) * Restart transfer at specific point */ void -restart(argc, argv) - int argc; - char *argv[]; +restart(int argc, char *argv[]) { quad_t nrestart_point; char *ep; @@ -2074,18 +1941,14 @@ restart(argc, argv) * Show remote system type */ void -syst(argc, argv) - int argc; - char *argv[]; +syst(int argc, char *argv[]) { (void)command("SYST"); } void -macdef(argc, argv) - int argc; - char *argv[]; +macdef(int argc, char *argv[]) { char *tmp; int c; @@ -2146,9 +2009,7 @@ macdef(argc, argv) * Get size of file on remote machine */ void -sizecmd(argc, argv) - int argc; - char *argv[]; +sizecmd(int argc, char *argv[]) { off_t size; @@ -2167,9 +2028,7 @@ sizecmd(argc, argv) * Get last modification time of file on remote machine */ void -modtime(argc, argv) - int argc; - char *argv[]; +modtime(int argc, char *argv[]) { time_t mtime; @@ -2188,9 +2047,7 @@ modtime(argc, argv) * Show status on remote machine */ void -rmtstatus(argc, argv) - int argc; - char *argv[]; +rmtstatus(int argc, char *argv[]) { (void)command(argc > 1 ? "STAT %s" : "STAT" , argv[1]); @@ -2200,9 +2057,7 @@ rmtstatus(argc, argv) * Get file if modtime is more recent than current file */ void -newer(argc, argv) - int argc; - char *argv[]; +newer(int argc, char *argv[]) { if (getit(argc, argv, -1, "w")) @@ -2214,9 +2069,7 @@ newer(argc, argv) * Display one file through $PAGER (defaults to "more"). */ void -page(argc, argv) - int argc; - char *argv[]; +page(int argc, char *argv[]) { int orestart_point, ohash, overbose; char *p, *pager, *oldargv1; diff --git a/usr.bin/ftp/complete.c b/usr.bin/ftp/complete.c index 4c555705b16..7b51ab1ddfe 100644 --- a/usr.bin/ftp/complete.c +++ b/usr.bin/ftp/complete.c @@ -1,4 +1,4 @@ -/* $OpenBSD: complete.c,v 1.15 2004/07/09 17:11:22 millert Exp $ */ +/* $OpenBSD: complete.c,v 1.16 2004/07/20 03:50:25 deraadt Exp $ */ /* $NetBSD: complete.c,v 1.10 1997/08/18 10:20:18 lukem Exp $ */ /*- @@ -39,7 +39,7 @@ #ifndef SMALL #ifndef lint -static char rcsid[] = "$OpenBSD: complete.c,v 1.15 2004/07/09 17:11:22 millert Exp $"; +static char rcsid[] = "$OpenBSD: complete.c,v 1.16 2004/07/20 03:50:25 deraadt Exp $"; #endif /* not lint */ /* @@ -62,8 +62,7 @@ static unsigned char complete_local(char *, int); static unsigned char complete_remote(char *, int); static int -comparstr(a, b) - const void *a, *b; +comparstr(const void *a, const void *b) { return (strcmp(*(char **)a, *(char **)b)); } @@ -79,10 +78,7 @@ comparstr(a, b) * words stringlist containing possible matches */ static unsigned char -complete_ambiguous(word, list, words) - char *word; - int list; - StringList *words; +complete_ambiguous(char *word, int list, StringList *words) { char insertstr[MAXPATHLEN]; char *lastmatch; @@ -134,9 +130,7 @@ complete_ambiguous(word, list, words) * Complete a command */ static unsigned char -complete_command(word, list) - char *word; - int list; +complete_command(char *word, int list) { struct cmd *c; StringList *words; @@ -162,9 +156,7 @@ complete_command(word, list) * Complete a local file */ static unsigned char -complete_local(word, list) - char *word; - int list; +complete_local(char *word, int list) { StringList *words; char dir[MAXPATHLEN]; @@ -217,9 +209,7 @@ complete_local(word, list) * Complete a remote file */ static unsigned char -complete_remote(word, list) - char *word; - int list; +complete_remote(char *word, int list) { static StringList *dirlist; static char lastdir[MAXPATHLEN]; @@ -298,9 +288,7 @@ complete_remote(word, list) * Generic complete routine */ unsigned char -complete(el, ch) - EditLine *el; - int ch; +complete(EditLine *el, int ch) { static char word[FTPBUFLEN]; static int lastc_argc, lastc_argo; diff --git a/usr.bin/ftp/domacro.c b/usr.bin/ftp/domacro.c index d622d4bfad0..545691fef71 100644 --- a/usr.bin/ftp/domacro.c +++ b/usr.bin/ftp/domacro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: domacro.c,v 1.10 2003/12/16 21:46:22 deraadt Exp $ */ +/* $OpenBSD: domacro.c,v 1.11 2004/07/20 03:50:25 deraadt Exp $ */ /* $NetBSD: domacro.c,v 1.10 1997/07/20 09:45:45 lukem Exp $ */ /* @@ -31,7 +31,7 @@ */ #if !defined(lint) && !defined(SMALL) -static char rcsid[] = "$OpenBSD: domacro.c,v 1.10 2003/12/16 21:46:22 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: domacro.c,v 1.11 2004/07/20 03:50:25 deraadt Exp $"; #endif /* not lint and not SMALL */ #include <ctype.h> @@ -42,9 +42,7 @@ static char rcsid[] = "$OpenBSD: domacro.c,v 1.10 2003/12/16 21:46:22 deraadt Ex #include "ftp_var.h" void -domacro(argc, argv) - int argc; - char *argv[]; +domacro(int argc, char *argv[]) { int i, j, count = 2, loopflg = 0; char *cp1, *cp2, line2[FTPBUFLEN]; diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index 57c0c2f79c2..379a3ed7206 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fetch.c,v 1.49 2004/02/28 20:08:38 krw Exp $ */ +/* $OpenBSD: fetch.c,v 1.50 2004/07/20 03:50:25 deraadt Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- @@ -38,7 +38,7 @@ */ #if !defined(lint) && !defined(SMALL) -static char rcsid[] = "$OpenBSD: fetch.c,v 1.49 2004/02/28 20:08:38 krw Exp $"; +static char rcsid[] = "$OpenBSD: fetch.c,v 1.50 2004/07/20 03:50:25 deraadt Exp $"; #endif /* not lint and not SMALL */ /* @@ -96,10 +96,7 @@ jmp_buf httpabort; * Returns -1 on failure, 0 on success */ static int -url_get(origline, proxyenv, outfile) - const char *origline; - const char *proxyenv; - const char *outfile; +url_get(const char *origline, const char *proxyenv, const char *outfile) { struct addrinfo hints, *res0, *res; int error; @@ -566,8 +563,7 @@ cleanup_url_get: * Abort a http retrieval */ void -aborthttp(notused) - int notused; +aborthttp(int notused) { alarmtimer(0); @@ -580,8 +576,7 @@ aborthttp(notused) * Abort a http retrieval */ void -abortfile(notused) - int notused; +abortfile(int notused) { alarmtimer(0); @@ -605,10 +600,7 @@ abortfile(notused) * Otherwise, 0 is returned if all files retrieved successfully. */ int -auto_fetch(argc, argv, outfile) - int argc; - char *argv[]; - char *outfile; +auto_fetch(int argc, char *argv[], char *outfile) { char *xargv[5]; char *cp, *line, *host, *dir, *file, *portnum; @@ -871,8 +863,7 @@ bad_ftp_url: } char * -urldecode(str) - const char *str; +urldecode(const char *str) { char *ret; char c; @@ -903,8 +894,7 @@ urldecode(str) } char -hextochar(str) - const char *str; +hextochar(const char *str) { char c, ret; @@ -926,8 +916,7 @@ hextochar(str) } int -isurl(p) - const char *p; +isurl(const char *p) { if (strncasecmp(p, FTP_URL, sizeof(FTP_URL) - 1) == 0 || diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c index 1bfda9d42cc..8510254ecb9 100644 --- a/usr.bin/ftp/ftp.c +++ b/usr.bin/ftp/ftp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftp.c,v 1.55 2003/12/16 21:46:22 deraadt Exp $ */ +/* $OpenBSD: ftp.c,v 1.56 2004/07/20 03:50:25 deraadt Exp $ */ /* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */ /* @@ -60,7 +60,7 @@ */ #if !defined(lint) && !defined(SMALL) -static char rcsid[] = "$OpenBSD: ftp.c,v 1.55 2003/12/16 21:46:22 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ftp.c,v 1.56 2004/07/20 03:50:25 deraadt Exp $"; #endif /* not lint and not SMALL */ #include <sys/types.h> @@ -117,9 +117,7 @@ off_t restart_point = 0; FILE *cin, *cout; char * -hookup(host, port) - char *host; - char *port; +hookup(char *host, char *port) { int s, len, tos, error; static char hostnamebuf[MAXHOSTNAMELEN]; @@ -270,8 +268,7 @@ bad: } void -cmdabort(notused) - int notused; +cmdabort(int notused) { alarmtimer(0); @@ -326,8 +323,7 @@ command(const char *fmt, ...) char reply_string[BUFSIZ]; /* first line of previous reply */ int -getreply(expecteof) - int expecteof; +getreply(int expecteof) { char current_line[BUFSIZ]; /* last line of previous reply */ int c, n, line; @@ -449,8 +445,7 @@ getreply(expecteof) jmp_buf sendabort; void -abortsend(notused) - int notused; +abortsend(int notused) { alarmtimer(0); @@ -462,9 +457,8 @@ abortsend(notused) } void -sendrequest(cmd, local, remote, printnames) - const char *cmd, *local, *remote; - int printnames; +sendrequest(const char *cmd, const char *local, const char *remote, + int printnames) { struct stat st; int c, d; @@ -744,8 +738,7 @@ abort: jmp_buf recvabort; void -abortrecv(notused) - int notused; +abortrecv(int notused) { alarmtimer(0); @@ -757,9 +750,8 @@ abortrecv(notused) } void -recvrequest(cmd, local, remote, lmode, printnames, ignorespecial) - const char *cmd, * volatile local, *remote, *lmode; - int printnames, ignorespecial; +recvrequest(const char *cmd, const char * volatile local, const char *remote, + const char *lmode, int printnames, int ignorespecial) { FILE * volatile fout, * volatile din; int (* volatile closefunc)(FILE *); @@ -1135,7 +1127,7 @@ abort: * otherwise the server's connect may fail. */ int -initconn() +initconn(void) { char *p, *a; int result = ERROR, len, tmpno = 0; @@ -1523,8 +1515,7 @@ bad: } FILE * -dataconn(lmode) - const char *lmode; +dataconn(const char *lmode) { union sockunion from; int s, fromlen = myctladdr.su_len; @@ -1553,8 +1544,7 @@ dataconn(lmode) } void -psummary(notused) - int notused; +psummary(int notused) { int save_errno = errno; @@ -1564,8 +1554,7 @@ psummary(notused) } void -psabort(notused) - int notused; +psabort(int notused) { alarmtimer(0); @@ -1573,8 +1562,7 @@ psabort(notused) } void -pswitch(flag) - int flag; +pswitch(int flag) { sig_t oldintr; static struct comvars { @@ -1661,8 +1649,7 @@ pswitch(flag) } void -abortpt(notused) - int notused; +abortpt(int notused) { alarmtimer(0); @@ -1675,8 +1662,7 @@ abortpt(notused) } void -proxtrans(cmd, local, remote) - const char *cmd, *local, *remote; +proxtrans(const char *cmd, const char *local, const char *remote) { volatile sig_t oldintr; int prox_type, nfnd; @@ -1797,9 +1783,7 @@ abort: } void -reset(argc, argv) - int argc; - char *argv[]; +reset(int argc, char *argv[]) { struct pollfd pfd[1]; int nfnd = 1; @@ -1818,8 +1802,7 @@ reset(argc, argv) } char * -gunique(local) - const char *local; +gunique(const char *local) { static char new[MAXPATHLEN]; char *cp = strrchr(local, '/'); @@ -1864,8 +1847,7 @@ gunique(local) } void -abort_remote(din) - FILE *din; +abort_remote(FILE *din) { char buf[BUFSIZ]; int nfnd; diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index 45f864270c1..3cefbd70acf 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.57 2003/12/16 21:46:22 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.58 2004/07/20 03:50:26 deraadt Exp $ */ /* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */ /* @@ -66,7 +66,7 @@ static char copyright[] = #endif /* not lint */ #if !defined(lint) && !defined(SMALL) -static char rcsid[] = "$OpenBSD: main.c,v 1.57 2003/12/16 21:46:22 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.58 2004/07/20 03:50:26 deraadt Exp $"; #endif /* not lint and not SMALL */ /* @@ -324,7 +324,7 @@ main(volatile int argc, char *argv[]) } void -intr() +intr(void) { alarmtimer(0); @@ -332,7 +332,7 @@ intr() } void -lostpeer() +lostpeer(void) { int save_errno = errno; @@ -368,7 +368,7 @@ lostpeer() * Generate a prompt */ char * -prompt() +prompt(void) { return ("ftp> "); } @@ -377,8 +377,7 @@ prompt() * Command parser. */ void -cmdscanner(top) - int top; +cmdscanner(int top) { struct cmd *c; int num; @@ -473,8 +472,7 @@ cmdscanner(top) } struct cmd * -getcmd(name) - const char *name; +getcmd(const char *name) { const char *p, *q; struct cmd *c, *found; @@ -511,7 +509,7 @@ getcmd(name) int slrflag; void -makeargv() +makeargv(void) { char *argp; @@ -554,7 +552,7 @@ makeargv() * handle quoting and strings */ char * -slurpstring() +slurpstring(void) { int got_one = 0; char *sb = stringbase; @@ -686,9 +684,7 @@ OUT: * Call each command handler with argc == 0 and argv[0] == name. */ void -help(argc, argv) - int argc; - char *argv[]; +help(int argc, char *argv[]) { struct cmd *c; @@ -724,7 +720,7 @@ help(argc, argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: %s [-46AadegimnptVv] [-P port] [-r seconds] [host [port]]\n" diff --git a/usr.bin/ftp/ruserpass.c b/usr.bin/ftp/ruserpass.c index e3f9a7bcfd1..de58d4f79ff 100644 --- a/usr.bin/ftp/ruserpass.c +++ b/usr.bin/ftp/ruserpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ruserpass.c,v 1.17 2003/12/16 21:46:22 deraadt Exp $ */ +/* $OpenBSD: ruserpass.c,v 1.18 2004/07/20 03:50:26 deraadt Exp $ */ /* $NetBSD: ruserpass.c,v 1.14 1997/07/20 09:46:01 lukem Exp $ */ /* @@ -35,7 +35,7 @@ static char sccsid[] = "@(#)ruserpass.c 8.4 (Berkeley) 4/27/95"; #else #ifndef SMALL -static char rcsid[] = "$OpenBSD: ruserpass.c,v 1.17 2003/12/16 21:46:22 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ruserpass.c,v 1.18 2004/07/20 03:50:26 deraadt Exp $"; #endif /* SMALL */ #endif #endif /* not lint */ @@ -81,9 +81,7 @@ static struct toktab { }; int -ruserpass(host, aname, apass, aacct) - const char *host; - char **aname, **apass, **aacct; +ruserpass(const char *host, char **aname, char **apass, char **aacct) { char *hdir, buf[BUFSIZ], *tmp; char myname[MAXHOSTNAMELEN], *mydomain; @@ -258,7 +256,7 @@ bad: } static int -token() +token(void) { char *cp; int c; diff --git a/usr.bin/ftp/stringlist.c b/usr.bin/ftp/stringlist.c index 46bd0c55bd8..d88fa831cb7 100644 --- a/usr.bin/ftp/stringlist.c +++ b/usr.bin/ftp/stringlist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stringlist.c,v 1.4 2003/12/16 21:46:22 deraadt Exp $ */ +/* $OpenBSD: stringlist.c,v 1.5 2004/07/20 03:50:26 deraadt Exp $ */ /* $NetBSD: stringlist.c,v 1.2 1997/01/17 07:26:20 lukem Exp $ */ /* @@ -33,7 +33,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) && !defined(SMALL) -static char *rcsid = "$OpenBSD: stringlist.c,v 1.4 2003/12/16 21:46:22 deraadt Exp $"; +static char *rcsid = "$OpenBSD: stringlist.c,v 1.5 2004/07/20 03:50:26 deraadt Exp $"; #endif /* LIBC_SCCS and not lint and not SMALL */ #include <stdio.h> @@ -49,7 +49,7 @@ static char *rcsid = "$OpenBSD: stringlist.c,v 1.4 2003/12/16 21:46:22 deraadt E * sl_init(): Initialize a string list */ StringList * -sl_init() +sl_init(void) { StringList *sl = malloc(sizeof(StringList)); if (sl == NULL) @@ -68,9 +68,7 @@ sl_init() * sl_add(): Add an item to the string list */ void -sl_add(sl, name) - StringList *sl; - char *name; +sl_add(StringList *sl, char *name) { if (sl->sl_cur == sl->sl_max - 1) { sl->sl_max += _SL_CHUNKSIZE; @@ -86,9 +84,7 @@ sl_add(sl, name) * sl_free(): Free a stringlist */ void -sl_free(sl, all) - StringList *sl; - int all; +sl_free(StringList *sl, int all) { size_t i; @@ -108,9 +104,7 @@ sl_free(sl, all) * sl_find(): Find a name in the string list */ char * -sl_find(sl, name) - StringList *sl; - char *name; +sl_find(StringList *sl, char *name) { size_t i; diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c index 3a4d182816d..394d918385e 100644 --- a/usr.bin/ftp/util.c +++ b/usr.bin/ftp/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.37 2003/12/16 21:46:22 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.38 2004/07/20 03:50:26 deraadt Exp $ */ /* $NetBSD: util.c,v 1.12 1997/08/18 10:20:27 lukem Exp $ */ /*- @@ -71,7 +71,7 @@ */ #if !defined(lint) && !defined(SMALL) -static char rcsid[] = "$OpenBSD: util.c,v 1.37 2003/12/16 21:46:22 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: util.c,v 1.38 2004/07/20 03:50:26 deraadt Exp $"; #endif /* not lint and not SMALL */ /* @@ -106,9 +106,7 @@ static void updateprogressmeter(int); * auto-login, if possible. */ void -setpeer(argc, argv) - int argc; - char *argv[]; +setpeer(int argc, char *argv[]) { char *host; char *port; @@ -248,9 +246,7 @@ setpeer(argc, argv) * login to remote host, using given username & password if supplied */ int -ftp_login(host, user, pass) - const char *host; - char *user, *pass; +ftp_login(const char *host, char *user, char *pass) { char tmp[80]; char *acct; @@ -365,10 +361,7 @@ tryagain: * Returns false if no new arguments have been added. */ int -another(pargc, pargv, prompt) - int *pargc; - char ***pargv; - const char *prompt; +another(int *pargc, char ***pargv, const char *prompt) { int len = strlen(line), ret; @@ -396,10 +389,7 @@ another(pargc, pargv, prompt) * of writing to the screen. */ char * -remglob(argv, doswitch, errbuf) - char *argv[]; - int doswitch; - char **errbuf; +remglob(char *argv[], int doswitch, char **errbuf) { char temp[MAXPATHLEN]; static char buf[MAXPATHLEN]; @@ -486,8 +476,7 @@ remglob(argv, doswitch, errbuf) } int -confirm(cmd, file) - const char *cmd, *file; +confirm(const char *cmd, const char *file) { char line[BUFSIZ]; @@ -527,8 +516,7 @@ top: * from the expression, we return only the first. */ int -globulize(cpp) - char **cpp; +globulize(char **cpp) { glob_t gl; int flags; @@ -558,9 +546,7 @@ globulize(cpp) * determine size of remote file */ off_t -remotesize(file, noisy) - const char *file; - int noisy; +remotesize(const char *file, int noisy) { int overbose; off_t size; @@ -591,9 +577,7 @@ remotesize(file, noisy) * determine last modification time (in GMT) of remote file */ time_t -remotemodtime(file, noisy) - const char *file; - int noisy; +remotemodtime(const char *file, int noisy) { int overbose; time_t rtime; @@ -656,7 +640,7 @@ remotemodtime(file, noisy) * Returns true if this is the controlling/foreground process, else false. */ int -foregroundproc() +foregroundproc(void) { static pid_t pgrp = -1; int ctty_pgrp; @@ -669,8 +653,7 @@ foregroundproc() } static void -updateprogressmeter(dummy) - int dummy; +updateprogressmeter(int dummy) { int save_errno = errno; @@ -693,8 +676,7 @@ updateprogressmeter(dummy) static struct timeval start; void -progressmeter(flag) - int flag; +progressmeter(int flag) { /* * List of order of magnitude prefixes. @@ -819,8 +801,7 @@ progressmeter(flag) * instead of TTYOUT. */ void -ptransfer(siginfo) - int siginfo; +ptransfer(int siginfo) { struct timeval now, td; double elapsed; @@ -860,8 +841,7 @@ ptransfer(siginfo) * List words in stringlist, vertically arranged */ void -list_vertical(sl) - StringList *sl; +list_vertical(StringList *sl) { int i, j, w; int columns, width, lines, items; @@ -902,8 +882,7 @@ list_vertical(sl) * Update the global ttywidth value, using TIOCGWINSZ. */ void -setttywidth(a) - int a; +setttywidth(int a) { int save_errno = errno; struct winsize winsize; @@ -919,8 +898,7 @@ setttywidth(a) * Set the SIGALRM interval timer for wait seconds, 0 to disable. */ void -alarmtimer(wait) - int wait; +alarmtimer(int wait) { struct itimerval itv; @@ -935,7 +913,7 @@ alarmtimer(wait) */ #ifndef SMALL void -controlediting() +controlediting(void) { HistEvent hev; diff --git a/usr.bin/indent/args.c b/usr.bin/indent/args.c index 8ca61984aa3..292c3c9bf12 100644 --- a/usr.bin/indent/args.c +++ b/usr.bin/indent/args.c @@ -1,4 +1,4 @@ -/* $OpenBSD: args.c,v 1.13 2003/06/12 01:07:27 deraadt Exp $ */ +/* $OpenBSD: args.c,v 1.14 2004/07/20 03:50:26 deraadt Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #ifndef lint /*static char sccsid[] = "@(#)args.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: args.c,v 1.13 2003/06/12 01:07:27 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: args.c,v 1.14 2004/07/20 03:50:26 deraadt Exp $"; #endif /* not lint */ /* @@ -161,7 +161,7 @@ void set_option(char *); * given in these files. */ void -set_profile() +set_profile(void) { FILE *f; char fname[BUFSIZ]; @@ -187,8 +187,7 @@ set_profile() } void -scan_profile(f) - FILE *f; +scan_profile(FILE *f) { int i; char *p; @@ -213,9 +212,7 @@ scan_profile(f) char *param_start; int -eqin(s1, s2) - char *s1; - char *s2; +eqin(char *s1, char *s2) { while (*s1) { if (*s1++ != *s2++) @@ -229,7 +226,7 @@ eqin(s1, s2) * Set the defaults. */ void -set_defaults() +set_defaults(void) { struct pro *p; @@ -244,8 +241,7 @@ set_defaults() } void -set_option(arg) - char *arg; +set_option(char *arg) { struct pro *p; diff --git a/usr.bin/indent/io.c b/usr.bin/indent/io.c index 73ed875ea58..b0a012802d1 100644 --- a/usr.bin/indent/io.c +++ b/usr.bin/indent/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.8 2003/09/26 22:23:28 tedu Exp $ */ +/* $OpenBSD: io.c,v 1.9 2004/07/20 03:50:26 deraadt Exp $ */ /* * Copyright (c) 1985 Sun Microsystems, Inc. @@ -33,7 +33,7 @@ #ifndef lint /*static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: io.c,v 1.8 2003/09/26 22:23:28 tedu Exp $"; +static char rcsid[] = "$OpenBSD: io.c,v 1.9 2004/07/20 03:50:26 deraadt Exp $"; #endif /* not lint */ #include <stdio.h> @@ -49,7 +49,7 @@ int comment_open; static int paren_target; void -dump_line() +dump_line(void) { /* dump_line is the routine that actually * effects the printing of the new source. It * prints the label section, followed by the @@ -283,7 +283,7 @@ inhibit_newline: } int -compute_code_target() +compute_code_target(void) { int target_col; @@ -310,7 +310,7 @@ compute_code_target() } int -compute_label_target() +compute_label_target(void) { return ps.pcase ? (int) (case_ind * ps.ind_size) + 1 @@ -335,7 +335,7 @@ compute_label_target() * */ void -fill_buffer() +fill_buffer(void) { /* this routine reads stuff from the input */ char *p, *buf2; int i; @@ -437,7 +437,7 @@ fill_buffer() * ALGORITHM: Put tabs and/or blanks into pobuf, then write pobuf. * * PARAMETERS: current integer The current column target - * nteger The desired column + * target integer The desired column * * RETURNS: Integer value of the new column. (If current >= target, no action is * taken, and current is returned. @@ -452,11 +452,7 @@ fill_buffer() * */ int -pad_output(current, target) /* writes tabs and blanks (if necessary) to - * get the current output position up to the - * target column */ - int current; /* the current column value */ - int target; /* position we want it at */ +pad_output(int current, int target) { int curr; /* internal column pointer */ int tcur; @@ -498,13 +494,7 @@ pad_output(current, target) /* writes tabs and blanks (if necessary) to * */ int -count_spaces(current, buffer) -/* - * this routine figures out where the character position will be after - * printing the text in buffer starting at column "current" - */ - int current; - char *buffer; +count_spaces(int current, char *buffer) { char *buf; /* used to look thru buffer */ int cur; /* current character counter */ @@ -560,18 +550,14 @@ diag(int level, char *msg, ...) } void -writefdef(f, nm) - struct fstate *f; - int nm; +writefdef(struct fstate *f, int nm) { fprintf(output, ".ds f%c %s\n.nr s%c %d\n", nm, f->font, nm, f->size); } char * -chfont(of, nf, s) - struct fstate *of, *nf; - char *s; +chfont(struct fstate *of, struct fstate *nf, char *s) { if (of->font[0] != nf->font[0] || of->font[1] != nf->font[1]) { @@ -601,9 +587,7 @@ chfont(of, nf, s) } void -parsefont(f, s0) - struct fstate *f; - char *s0; +parsefont(struct fstate *f, char *s0) { char *s = s0; int sizedelta = 0; diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c index fa62b4740a6..6c8595a0849 100644 --- a/usr.bin/indent/lexi.c +++ b/usr.bin/indent/lexi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lexi.c,v 1.10 2003/09/26 22:23:28 tedu Exp $ */ +/* $OpenBSD: lexi.c,v 1.11 2004/07/20 03:50:26 deraadt Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #ifndef lint /*static char sccsid[] = "@(#)lexi.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: lexi.c,v 1.10 2003/09/26 22:23:28 tedu Exp $"; +static char rcsid[] = "$OpenBSD: lexi.c,v 1.11 2004/07/20 03:50:26 deraadt Exp $"; #endif /* not lint */ /* @@ -120,7 +120,7 @@ char chartype[128] = int -lexi() +lexi(void) { int unary_delim; /* this is set to 1 if the current token * forces a following operator to be unary */ @@ -562,9 +562,7 @@ stop_lit: * Add the given keyword to the keyword table, using val as the keyword type */ void -addkey(key, val) - char *key; - int val; +addkey(char *key, int val) { struct templ *p; int i = 0; diff --git a/usr.bin/indent/parse.c b/usr.bin/indent/parse.c index b1da01a0a20..3121f7f8519 100644 --- a/usr.bin/indent/parse.c +++ b/usr.bin/indent/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.7 2003/06/26 21:43:07 deraadt Exp $ */ +/* $OpenBSD: parse.c,v 1.8 2004/07/20 03:50:26 deraadt Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #ifndef lint /*static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: parse.c,v 1.7 2003/06/26 21:43:07 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: parse.c,v 1.8 2004/07/20 03:50:26 deraadt Exp $"; #endif /* not lint */ #include <stdio.h> @@ -44,8 +44,7 @@ static char rcsid[] = "$OpenBSD: parse.c,v 1.7 2003/06/26 21:43:07 deraadt Exp $ void reduce(void); void -parse(tk) - int tk; /* the code for the construct scanned */ +parse(int tk) /* the code for the construct scanned */ { int i; diff --git a/usr.bin/indent/pr_comment.c b/usr.bin/indent/pr_comment.c index a49ce4d799b..d4964d1f0ad 100644 --- a/usr.bin/indent/pr_comment.c +++ b/usr.bin/indent/pr_comment.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pr_comment.c,v 1.5 2003/06/12 01:07:27 deraadt Exp $ */ +/* $OpenBSD: pr_comment.c,v 1.6 2004/07/20 03:50:26 deraadt Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #ifndef lint /*static char sccsid[] = "@(#)pr_comment.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: pr_comment.c,v 1.5 2003/06/12 01:07:27 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: pr_comment.c,v 1.6 2004/07/20 03:50:26 deraadt Exp $"; #endif /* not lint */ #include <err.h> @@ -74,7 +74,7 @@ static char rcsid[] = "$OpenBSD: pr_comment.c,v 1.5 2003/06/12 01:07:27 deraadt */ void -pr_comment() +pr_comment(void) { int now_col; /* column we are in now */ int adj_max_col; /* Adjusted max_col for when we decide to diff --git a/usr.bin/nc/atomicio.c b/usr.bin/nc/atomicio.c index 4437b6717bb..9e732904adc 100644 --- a/usr.bin/nc/atomicio.c +++ b/usr.bin/nc/atomicio.c @@ -35,11 +35,7 @@ ssize_t atomicio(ssize_t (*f)(int, void *, size_t), int fd, void *_s, size_t n); * ensure all of data on socket comes through. f==read || f==write */ ssize_t -atomicio(f, fd, _s, n) - ssize_t (*f) (int, void *, size_t); - int fd; - void *_s; - size_t n; +atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n) { char *s = _s; ssize_t res, pos = 0; diff --git a/usr.bin/sed/misc.c b/usr.bin/sed/misc.c index 2d8a82af432..18fee03a552 100644 --- a/usr.bin/sed/misc.c +++ b/usr.bin/sed/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.5 2003/06/03 02:56:16 millert Exp $ */ +/* $OpenBSD: misc.c,v 1.6 2004/07/20 03:50:26 deraadt Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. @@ -35,7 +35,7 @@ #ifndef lint /* from: static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93"; */ -static char *rcsid = "$OpenBSD: misc.c,v 1.5 2003/06/03 02:56:16 millert Exp $"; +static char *rcsid = "$OpenBSD: misc.c,v 1.6 2004/07/20 03:50:26 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -54,8 +54,7 @@ static char *rcsid = "$OpenBSD: misc.c,v 1.5 2003/06/03 02:56:16 millert Exp $"; * malloc with result test */ void * -xmalloc(size) - u_int size; +xmalloc(u_int size) { void *p; @@ -68,9 +67,7 @@ xmalloc(size) * realloc with result test */ void * -xrealloc(p, size) - void *p; - u_int size; +xrealloc(void *p, u_int size) { if (p == NULL) /* Compatibility hack. */ return (xmalloc(size)); @@ -86,9 +83,7 @@ xrealloc(p, size) * the buffer). */ char * -strregerror(errcode, preg) - int errcode; - regex_t *preg; +strregerror(int errcode, regex_t *preg) { static char *oe; size_t s; diff --git a/usr.bin/sort/append.c b/usr.bin/sort/append.c index f191d2bd05f..38797679f1d 100644 --- a/usr.bin/sort/append.c +++ b/usr.bin/sort/append.c @@ -1,4 +1,4 @@ -/* $OpenBSD: append.c,v 1.8 2003/06/03 02:56:16 millert Exp $ */ +/* $OpenBSD: append.c,v 1.9 2004/07/20 03:50:27 deraadt Exp $ */ /*- * Copyright (c) 1993 @@ -36,7 +36,7 @@ #if 0 static char sccsid[] = "@(#)append.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: append.c,v 1.8 2003/06/03 02:56:16 millert Exp $"; +static char rcsid[] = "$OpenBSD: append.c,v 1.9 2004/07/20 03:50:27 deraadt Exp $"; #endif #endif /* not lint */ @@ -63,13 +63,8 @@ static char rcsid[] = "$OpenBSD: append.c,v 1.8 2003/06/03 02:56:16 millert Exp * copy sorted lines to output; check for uniqueness */ void -append(keylist, nelem, depth, fp, put, ftbl) - u_char **keylist; - int nelem; - int depth; - FILE *fp; - void (*put)(RECHEADER *, FILE *); - struct field *ftbl; +append(u_char **keylist, int nelem, int depth, FILE *fp, + void (*put)(RECHEADER *, FILE *), struct field *ftbl) { u_char *wts, *wts1; int n, odepth; @@ -166,11 +161,8 @@ append(keylist, nelem, depth, fp, put, ftbl) * output the already sorted eol bin. */ void -rd_append(binno, infl0, nfiles, outfp, buffer, bufend) - u_char *buffer, *bufend; - int binno, nfiles; - union f_handle infl0; - FILE *outfp; +rd_append(int binno, union f_handle infl0, int nfiles, FILE *outfp, + u_char *buffer, u_char *bufend) { RECHEADER *rec; @@ -189,8 +181,7 @@ rd_append(binno, infl0, nfiles, outfp, buffer, bufend) * append plain text--used after sorting the biggest bin. */ void -concat(a, b) - FILE *a, *b; +concat(FILE *a, FILE *b) { int nread; char buffer[4096]; diff --git a/usr.bin/sort/fields.c b/usr.bin/sort/fields.c index e6ebcda8d4f..a96038ef4f1 100644 --- a/usr.bin/sort/fields.c +++ b/usr.bin/sort/fields.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fields.c,v 1.9 2003/09/25 02:06:40 tedu Exp $ */ +/* $OpenBSD: fields.c,v 1.10 2004/07/20 03:50:27 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.9 2003/09/25 02:06:40 tedu Exp $"; +static char rcsid[] = "$OpenBSD: fields.c,v 1.10 2004/07/20 03:50:27 deraadt Exp $"; #endif #endif /* not lint */ @@ -75,11 +75,8 @@ u_char fnum[NBINS], rnum[NBINS]; * followed by the original line. */ length_t -enterkey(keybuf, line, size, fieldtable) - RECHEADER *keybuf; /* pointer to start of key */ - DBT *line; - int size; - struct field fieldtable[]; +enterkey(RECHEADER *keybuf, /* pointer to start of key */ + DBT *line, int size, struct field fieldtable[]) { int i; u_char *l_d_mask; @@ -135,10 +132,7 @@ enterkey(keybuf, line, size, fieldtable) * constructs a field (as defined by -k) within a key */ u_char * -enterfield(tablepos, endkey, cur_fld, gflags) - struct field *cur_fld; - u_char *tablepos, *endkey; - int gflags; +enterfield(u_char *tablepos, u_char *endkey, struct field *cur_fld, int gflags) { u_char *start, *end, *lineend, *mask, *lweight; struct column icol, tcol; @@ -206,9 +200,7 @@ enterfield(tablepos, endkey, cur_fld, gflags) */ u_char * -number(pos, bufend, line, lineend, Rflag) - u_char *line, *pos, *bufend, *lineend; - int Rflag; +number(u_char *pos, u_char *bufend, u_char *line, u_char *lineend, int Rflag) { int or_sign, parity = 0; int expincr = 1, exponent = -1; diff --git a/usr.bin/sort/files.c b/usr.bin/sort/files.c index 008f0a9bd08..d8592a37b10 100644 --- a/usr.bin/sort/files.c +++ b/usr.bin/sort/files.c @@ -1,4 +1,4 @@ -/* $OpenBSD: files.c,v 1.10 2003/11/15 05:56:28 tedu Exp $ */ +/* $OpenBSD: files.c,v 1.11 2004/07/20 03:50:27 deraadt Exp $ */ /*- * Copyright (c) 1993 @@ -36,7 +36,7 @@ #if 0 static char sccsid[] = "@(#)files.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: files.c,v 1.10 2003/11/15 05:56:28 tedu Exp $"; +static char rcsid[] = "$OpenBSD: files.c,v 1.11 2004/07/20 03:50:27 deraadt Exp $"; #endif #endif /* not lint */ @@ -52,13 +52,8 @@ static int seq(FILE *, DBT *, DBT *); * It keeps the buffers for all temporary files. */ int -getnext(binno, infl0, nfiles, pos, end, dummy) - int binno; - union f_handle infl0; - int nfiles; - RECHEADER *pos; - u_char *end; - struct field *dummy; +getnext(int binno, union f_handle infl0, int nfiles, RECHEADER *pos, u_char *end, + struct field *dummy) { int i; u_char *hp; @@ -124,13 +119,8 @@ getnext(binno, infl0, nfiles, pos, end, dummy) * in the first fsort pass. */ int -makeline(flno, filelist, nfiles, buffer, bufend, dummy2) - int flno; - union f_handle filelist; - int nfiles; - RECHEADER *buffer; - u_char *bufend; - struct field *dummy2; +makeline(int flno, union f_handle filelist, int nfiles, RECHEADER *buffer, + u_char *bufend, struct field *dummy2) { static u_char *obufend; static size_t osz; @@ -209,12 +199,8 @@ makeline(flno, filelist, nfiles, buffer, bufend, dummy2) * This generates keys. It's only called in the first fsort pass */ int -makekey(flno, filelist, nfiles, buffer, bufend, ftbl) - int flno, nfiles; - union f_handle filelist; - RECHEADER *buffer; - u_char *bufend; - struct field *ftbl; +makekey(int flno, union f_handle filelist, int nfiles, RECHEADER *buffer, + u_char *bufend, struct field *ftbl) { static int fileno = 0; static FILE *dbdesc = 0; @@ -272,10 +258,7 @@ makekey(flno, filelist, nfiles, buffer, bufend, ftbl) * get a key/line pair from fp */ static int -seq(fp, line, key) - FILE *fp; - DBT *line; - DBT *key; +seq(FILE *fp, DBT *line, DBT *key) { static char *buf, flag = 1; char *end, *pos; @@ -317,9 +300,7 @@ seq(fp, line, key) * write a key/line pair to a temporary file */ void -putrec(rec, fp) - RECHEADER *rec; - FILE *fp; +putrec(RECHEADER *rec, FILE *fp) { EWRITE(rec, 1, rec->length + sizeof(TRECHEADER), fp); } @@ -328,9 +309,7 @@ putrec(rec, fp) * write a line to output */ void -putline(rec, fp) - RECHEADER *rec; - FILE *fp; +putline(RECHEADER *rec, FILE *fp) { EWRITE(rec->data+rec->offset, 1, rec->length - rec->offset, fp); } @@ -339,12 +318,8 @@ putline(rec, fp) * get a record from a temporary file. (Used by merge sort.) */ int -geteasy(flno, filelist, nfiles, rec, end, dummy2) - int flno, nfiles; - union f_handle filelist; - RECHEADER *rec; - u_char *end; - struct field *dummy2; +geteasy(int flno, union f_handle filelist, int nfiles, RECHEADER *rec, + u_char *end, struct field *dummy2) { int i; FILE *fp; diff --git a/usr.bin/sort/fsort.c b/usr.bin/sort/fsort.c index 560d83412ef..7a3af24ec9f 100644 --- a/usr.bin/sort/fsort.c +++ b/usr.bin/sort/fsort.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fsort.c,v 1.10 2004/03/15 13:35:36 sturm Exp $ */ +/* $OpenBSD: fsort.c,v 1.11 2004/07/20 03:50:27 deraadt Exp $ */ /*- * Copyright (c) 1993 @@ -36,7 +36,7 @@ #if 0 static char sccsid[] = "@(#)fsort.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: fsort.c,v 1.10 2004/03/15 13:35:36 sturm Exp $"; +static char rcsid[] = "$OpenBSD: fsort.c,v 1.11 2004/07/20 03:50:27 deraadt Exp $"; #endif #endif /* not lint */ @@ -61,12 +61,8 @@ extern char *toutpath; int PANIC = FSORTMAX; void -fsort(binno, depth, infiles, nfiles, outfp, ftbl) - int binno, depth; - union f_handle infiles; - int nfiles; - FILE *outfp; - struct field *ftbl; +fsort(int binno, int depth, union f_handle infiles, int nfiles, FILE *outfp, + struct field *ftbl) { u_char *bufend, **keypos, *tmpbuf; u_char *weights; @@ -278,13 +274,7 @@ fsort(binno, depth, infiles, nfiles, outfp, ftbl) */ #define swap(a, b, t) t = a, a = b, b = t void -onepass(a, depth, n, sizes, tr, fp) - u_char **a; - int depth; - long n; - long sizes[]; - u_char *tr; - FILE *fp; +onepass(u_char **a, int depth, long n, long sizes[], u_char *tr, FILE *fp) { size_t tsizes[NBINS+1]; u_char **bin[257], **top[256], ***bp, ***bpmax, ***tp; diff --git a/usr.bin/sort/init.c b/usr.bin/sort/init.c index 66aaa40b49a..ac2f07c1803 100644 --- a/usr.bin/sort/init.c +++ b/usr.bin/sort/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.6 2003/06/26 00:12:39 deraadt Exp $ */ +/* $OpenBSD: init.c,v 1.7 2004/07/20 03:50:27 deraadt Exp $ */ /*- * Copyright (c) 1993 @@ -36,7 +36,7 @@ #if 0 static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: init.c,v 1.6 2003/06/26 00:12:39 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: init.c,v 1.7 2004/07/20 03:50:27 deraadt Exp $"; #endif #endif /* not lint */ @@ -62,8 +62,7 @@ char *setcolumn(char *, struct field *, int); * keep clist in order--inserts a column in a sorted array */ static void -insertcol(field) - struct field *field; +insertcol(struct field *field) { int i; for (i = 0; i < ncols; i++) @@ -90,8 +89,7 @@ insertcol(field) * matches fields with the appropriate columns--n^2 but who cares? */ void -fldreset(fldtab) - struct field *fldtab; +fldreset(struct field *fldtab) { int i; fldtab[0].tcol.p = clist+ncols-1; @@ -111,10 +109,7 @@ fldreset(fldtab) * interprets a column in a -k field */ char * -setcolumn(pos, cur_fld, gflag) - char *pos; - struct field *cur_fld; - int gflag; +setcolumn(char *pos, struct field *cur_fld, int gflag) { struct column *col; int tmp; @@ -147,10 +142,7 @@ setcolumn(pos, cur_fld, gflag) } int -setfield(pos, cur_fld, gflag) - char *pos; - struct field *cur_fld; - int gflag; +setfield(char *pos, struct field *cur_fld, int gflag) { int tmp; cur_fld->weights = ascii; @@ -194,8 +186,7 @@ setfield(pos, cur_fld, gflag) } int -optval(desc, tcolflag) - int desc, tcolflag; +optval(int desc, int tcolflag) { switch(desc) { case 'b': @@ -217,9 +208,7 @@ optval(desc, tcolflag) * Note that the conversion is tricky, see the manual for details. */ void -fixit(argc, argv) - int *argc; - char **argv; +fixit(int *argc, char **argv) { int i, j; long v, w, x; @@ -301,8 +290,7 @@ fixit(argc, argv) * all bets are off. See also num_init in number.c */ void -settables(gflags) - int gflags; +settables(int gflags) { u_char *wts; int i, incr; diff --git a/usr.bin/sort/msort.c b/usr.bin/sort/msort.c index 2891bc7177a..25804c6bbb7 100644 --- a/usr.bin/sort/msort.c +++ b/usr.bin/sort/msort.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msort.c,v 1.13 2003/06/26 00:12:39 deraadt Exp $ */ +/* $OpenBSD: msort.c,v 1.14 2004/07/20 03:50:27 deraadt Exp $ */ /*- * Copyright (c) 1993 @@ -36,7 +36,7 @@ #if 0 static char sccsid[] = "@(#)msort.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: msort.c,v 1.13 2003/06/26 00:12:39 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: msort.c,v 1.14 2004/07/20 03:50:27 deraadt Exp $"; #endif #endif /* not lint */ @@ -68,13 +68,9 @@ static int cmp(RECHEADER *, RECHEADER *); static int insert(struct mfile **, struct mfile **, int, int); void -fmerge(binno, files, nfiles, get, outfp, fput, ftbl) - union f_handle files; - int binno, nfiles; - int (*get)(int, union f_handle, int, RECHEADER *, u_char *, struct field *); - FILE *outfp; - void (*fput)(RECHEADER *, FILE *); - struct field *ftbl; +fmerge(int binno, union f_handle files, int nfiles, + int (*get)(int, union f_handle, int, RECHEADER *, u_char *, struct field *), + FILE *outfp, void (*fput)(RECHEADER *, FILE *), struct field *ftbl) { FILE *tout; int i, j, last; @@ -142,12 +138,9 @@ fmerge(binno, files, nfiles, get, outfp, fput, ftbl) } void -merge(infl0, nfiles, get, outfp, put, ftbl) - int infl0, nfiles; - int (*get)(int, union f_handle, int, RECHEADER *, u_char *, struct field *); - void (*put)(RECHEADER *, FILE *); - FILE *outfp; - struct field *ftbl; +merge(int infl0, int nfiles, + int (*get)(int, union f_handle, int, RECHEADER *, u_char *, struct field *), + FILE *outfp, void (*put)(RECHEADER *, FILE *), struct field *ftbl) { int c, i, j; union f_handle dummy = {0}; @@ -198,9 +191,8 @@ merge(infl0, nfiles, get, outfp, put, ftbl) * otherwise just inserts *rec in flist. */ static int -insert(flist, rec, ttop, delete) - struct mfile **flist, **rec; - int delete, ttop; /* delete = 0 or 1 */ +insert(struct mfile **flist, struct mfile **rec, int ttop, + int delete) /* delete = 0 or 1 */ { struct mfile *tmprec; int top, mid, bot = 0, cmpv = 1; @@ -253,10 +245,9 @@ insert(flist, rec, ttop, delete) * check order on one file */ void -order(infile, get, ftbl) - union f_handle infile; - int (*get)(int, union f_handle, int, RECHEADER *, u_char *, struct field *); - struct field *ftbl; +order(union f_handle infile, + int (*get)(int, union f_handle, int, RECHEADER *, u_char *, struct field *), + struct field *ftbl) { u_char *crec_end, *prec_end, *trec_end; int c; @@ -306,8 +297,7 @@ order(infile, get, ftbl) } static int -cmp(rec1, rec2) - RECHEADER *rec1, *rec2; +cmp(RECHEADER *rec1, RECHEADER *rec2) { int r; u_char *pos1, *pos2, *end; |