From b57441971c3dc402f929d760fe0bd771085223bb Mon Sep 17 00:00:00 2001 From: Hiten Pandya Date: Sun, 28 Sep 2003 14:39:22 +0000 Subject: [PATCH] K&R style function removal. Update functions to ANSI style. Patch has been tested. Submitted by: Eirik Nygaard Reviewed by: Hiten Pandya --- bin/cat/cat.c | 20 +-- bin/chio/chio.c | 88 +++-------- bin/chmod/chmod.c | 8 +- bin/date/date.c | 15 +- bin/date/netdate.c | 5 +- bin/dd/args.c | 50 +++---- bin/dd/conv.c | 14 +- bin/dd/dd.c | 18 +-- bin/dd/misc.c | 10 +- bin/dd/position.c | 6 +- bin/df/df.c | 4 +- bin/domainname/domainname.c | 8 +- bin/echo/echo.c | 6 +- bin/ed/buf.c | 32 ++-- bin/ed/cbc.c | 39 ++--- bin/ed/glbl.c | 19 +-- bin/ed/io.c | 41 ++---- bin/ed/main.c | 82 ++++------- bin/ed/re.c | 10 +- bin/ed/sub.c | 25 +--- bin/ed/undo.c | 11 +- bin/hostname/hostname.c | 8 +- bin/mkdir/mkdir.c | 12 +- bin/mv/mv.c | 18 +-- bin/pax/ar_io.c | 70 +-------- bin/pax/ar_subs.c | 45 +----- bin/pax/buf_subs.c | 101 +------------ bin/pax/cache.c | 50 +------ bin/pax/cpio.c | 134 +---------------- bin/pax/file_subs.c | 129 +---------------- bin/pax/ftree.c | 36 +---- bin/pax/gen_subs.c | 58 +------- bin/pax/getoldopt.c | 7 +- bin/pax/options.c | 94 +----------- bin/pax/pat_rep.c | 103 +------------ bin/pax/pax.c | 20 +-- bin/pax/sel_subs.c | 51 +------ bin/pax/tables.c | 138 +----------------- bin/pax/tar.c | 107 +------------- bin/pax/tty_subs.c | 38 +---- bin/ps/fmt.c | 13 +- bin/ps/keyword.c | 13 +- bin/ps/nlist.c | 4 +- bin/ps/print.c | 136 +++++------------ bin/ps/ps.c | 31 ++-- bin/rmdir/rmdir.c | 11 +- bin/sleep/sleep.c | 8 +- bin/stty/cchar.c | 9 +- bin/stty/gfmt.c | 14 +- bin/stty/key.c | 57 +++----- bin/stty/modes.c | 6 +- bin/stty/print.c | 18 +-- bin/stty/stty.c | 8 +- bin/stty/util.c | 4 +- bin/sync/sync.c | 6 +- bin/test/test.c | 51 +++---- sbin/adjkerntz/adjkerntz.c | 11 +- sbin/atacontrol/atacontrol.c | 4 +- sbin/atm/atm/atm.c | 61 ++------ sbin/atm/atm/atm_eni.c | 22 +-- sbin/atm/atm/atm_fore200.c | 31 ++-- sbin/atm/atm/atm_inet.c | 10 +- sbin/atm/atm/atm_print.c | 17 +-- sbin/atm/atm/atm_set.c | 22 +-- sbin/atm/atm/atm_show.c | 61 ++------ sbin/atm/atm/atm_subr.c | 34 ++--- sbin/atm/fore_dnld/fore_dnld.c | 49 ++----- sbin/atm/ilmid/ilmid.c | 12 +- sbin/badsect/badsect.c | 15 +- sbin/ccdconfig/ccdconfig.c | 46 ++---- sbin/clri/clri.c | 6 +- sbin/dmesg/dmesg.c | 8 +- sbin/dump/dumprmt.c | 55 +++---- sbin/dump/itime.c | 23 +-- sbin/dump/main.c | 22 +-- sbin/dump/optr.c | 63 ++------ sbin/dump/pathnames.h | 4 +- sbin/dump/tape.c | 52 +++---- sbin/dump/traverse.c | 62 ++------ sbin/dump/unctime.c | 5 +- sbin/dumpfs/dumpfs.c | 19 +-- sbin/dumpon/dumpon.c | 4 +- sbin/fsck/dir.c | 65 +++------ sbin/fsck/fsutil.c | 91 ++---------- sbin/fsck/inode.c | 66 +++------ sbin/fsck/main.c | 22 +-- sbin/fsck/pass1.c | 7 +- sbin/fsck/pass1b.c | 7 +- sbin/fsck/pass2.c | 10 +- sbin/fsck/pass3.c | 4 +- sbin/fsck/pass4.c | 7 +- sbin/fsck/pass5.c | 4 +- sbin/fsck/preen.c | 23 +-- sbin/fsck/setup.c | 21 +-- sbin/fsck/utilities.c | 107 +++----------- sbin/fsck_msdosfs/boot.c | 10 +- sbin/fsck_msdosfs/check.c | 5 +- sbin/fsck_msdosfs/dir.c | 76 +++------- sbin/fsck_msdosfs/fat.c | 62 ++------ sbin/fsck_msdosfs/main.c | 19 +-- sbin/fsdb/fsdb.c | 39 ++--- sbin/fsdb/fsdbutil.c | 34 ++--- sbin/fsirand/fsirand.c | 11 +- sbin/i386/cxconfig/cxconfig.c | 10 +- sbin/i386/fdisk/fdisk.c | 14 +- sbin/ifconfig/ifconfig.c | 241 ++++++++----------------------- sbin/ifconfig/ifieee80211.c | 6 +- sbin/ifconfig/ifmedia.c | 59 ++------ sbin/ifconfig/ifvlan.c | 21 +-- sbin/init/init.c | 145 ++++--------------- sbin/ip6fw/ip6fw.c | 56 ++----- sbin/ldconfig/ldconfig.c | 30 ++-- sbin/mknod/mknod.c | 17 +-- sbin/mount/getmntopts.c | 17 +-- sbin/mount/mount.c | 54 ++----- sbin/mount/mount_ufs.c | 8 +- sbin/mount/vfslist.c | 9 +- sbin/mount_ext2fs/mount_ext2fs.c | 8 +- sbin/mount_hpfs/mount_hpfs.c | 21 +-- sbin/mount_msdos/mount_msdos.c | 25 +--- sbin/mount_nfs/mount_nfs.c | 20 +-- sbin/mount_ntfs/mount_ntfs.c | 21 +-- sbin/mount_null/mount_null.c | 12 +- sbin/mount_portal/activate.c | 25 +--- sbin/mount_portal/conf.c | 38 ++--- sbin/mount_portal/mount_portal.c | 14 +- sbin/mount_portal/pt_exec.c | 9 +- sbin/mount_portal/pt_file.c | 9 +- sbin/mount_portal/pt_tcp.c | 9 +- sbin/mount_portal/pt_tcplisten.c | 9 +- sbin/mount_std/mount_std.c | 8 +- sbin/mount_umap/mount_umap.c | 8 +- sbin/mount_union/mount_union.c | 12 +- sbin/mountd/mountd.c | 152 ++++++------------- sbin/natd/natd.c | 6 +- sbin/newfs/mkfs.c | 79 +++------- sbin/newfs/newfs.c | 31 +--- sbin/nfsd/nfsd.c | 17 +-- sbin/nfsiod/nfsiod.c | 14 +- sbin/nos-tun/nos-tun.c | 4 +- sbin/pc98/fdisk/fdisk.c | 45 +++--- sbin/ping/ping.c | 46 ++---- sbin/ping6/ping6.c | 99 ++++--------- sbin/quotacheck/quotacheck.c | 51 ++----- sbin/rcorder/ealloc.c | 18 +-- sbin/rcorder/hash.c | 47 +++--- sbin/rcorder/rcorder.c | 73 +++------- sbin/reboot/reboot.c | 6 +- sbin/restore/dirs.c | 72 +++------ sbin/restore/interactive.c | 42 ++---- sbin/restore/main.c | 8 +- sbin/restore/restore.c | 45 ++---- sbin/restore/symtab.c | 49 ++----- sbin/restore/tape.c | 105 ++++---------- sbin/restore/utilities.c | 68 +++------ sbin/route/route.c | 86 ++++------- sbin/savecore/savecore.c | 57 +++----- sbin/shutdown/shutdown.c | 29 ++-- sbin/slattach/slattach.c | 16 +- sbin/startslip/startslip.c | 23 ++- sbin/swapon/swapon.c | 4 +- sbin/sysctl/pathconf.c | 19 +-- sbin/tunefs/tunefs.c | 29 +--- 163 files changed, 1379 insertions(+), 4423 deletions(-) diff --git a/bin/cat/cat.c b/bin/cat/cat.c index 35f3d23571..e94804f3c1 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)cat.c 8.2 (Berkeley) 4/27/95 * $FreeBSD: src/bin/cat/cat.c,v 1.14.2.8 2002/06/29 05:09:26 tjr Exp $ - * $DragonFly: src/bin/cat/cat.c,v 1.4 2003/09/21 04:13:50 drhodus Exp $ + * $DragonFly: src/bin/cat/cat.c,v 1.5 2003/09/28 14:39:13 hmp Exp $ */ #include @@ -72,9 +72,7 @@ static int udom_open (const char *path, int flags); #endif int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch; @@ -122,9 +120,7 @@ main(argc, argv) } void -scanfiles(argv, cooked) - char **argv; - int cooked; +scanfiles(char **argv, int cooked) { int i = 0; char *path; @@ -167,8 +163,7 @@ scanfiles(argv, cooked) } static void -cook_cat(fp) - register FILE *fp; +cook_cat(register FILE *fp) { register int ch, gobble, line, prev; @@ -235,8 +230,7 @@ cook_cat(fp) } static void -raw_cat(rfd) - register int rfd; +raw_cat(register int rfd) { register int off, wfd; ssize_t nr, nw; @@ -265,9 +259,7 @@ raw_cat(rfd) #ifndef NO_UDOM_SUPPORT static int -udom_open(path, flags) - const char *path; - int flags; +udom_open(const char *path, int flags) { struct sockaddr_un sou; int fd; diff --git a/bin/chio/chio.c b/bin/chio/chio.c index 2e3d7ab708..4f69772f67 100644 --- a/bin/chio/chio.c +++ b/bin/chio/chio.c @@ -32,7 +32,7 @@ * * @(#) Copyright (c) 1996 Jason R. Thorpe. All rights reserved. * $FreeBSD: src/bin/chio/chio.c,v 1.15.2.3 2001/07/28 19:22:01 mikeh Exp $ - * $DragonFly: src/bin/chio/chio.c,v 1.3 2003/09/21 04:17:25 drhodus Exp $ + * $DragonFly: src/bin/chio/chio.c,v 1.4 2003/09/28 14:39:13 hmp Exp $ */ /* * Additional Copyright (c) 1997, by Matthew Jacob, for NASA/Ames Research Ctr. @@ -118,9 +118,7 @@ static int changer_fd; static const char *changer_name; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int ch, i; @@ -173,10 +171,7 @@ main(argc, argv) } static int -do_move(cname, argc, argv) - const char *cname; - int argc; - char **argv; +do_move(const char *cname, int argc, char **argv) { struct changer_move cmd; int val; @@ -254,10 +249,7 @@ do_move(cname, argc, argv) } static int -do_exchange(cname, argc, argv) - const char *cname; - int argc; - char **argv; +do_exchange(const char *cname, int argc, char **argv) { struct changer_exchange cmd; int val; @@ -366,10 +358,7 @@ do_exchange(cname, argc, argv) } static int -do_position(cname, argc, argv) - const char *cname; - int argc; - char **argv; +do_position(const char *cname, int argc, char **argv) { struct changer_position cmd; int val; @@ -430,10 +419,7 @@ do_position(cname, argc, argv) /* ARGSUSED */ static int -do_params(cname, argc, argv) - const char *cname; - int argc; - char **argv; +do_params(const char *cname, int argc, char **argv) { struct changer_params data; int picker; @@ -476,10 +462,7 @@ do_params(cname, argc, argv) /* ARGSUSED */ static int -do_getpicker(cname, argc, argv) - const char *cname; - int argc; - char **argv; +do_getpicker(const char *cname, int argc, char **argv) { int picker; @@ -506,10 +489,7 @@ do_getpicker(cname, argc, argv) } static int -do_setpicker(cname, argc, argv) - const char *cname; - int argc; - char **argv; +do_setpicker(const char *cname, int argc, char **argv) { int picker; @@ -537,10 +517,7 @@ do_setpicker(cname, argc, argv) } static int -do_status(cname, argc, argv) - const char *cname; - int argc; - char **argv; +do_status(const char *cname, int argc, char **argv) { struct changer_params cp; struct changer_element_status_request cesr; @@ -759,10 +736,7 @@ do_status(cname, argc, argv) } static int -do_ielem(cname, argc, argv) - const char *cname; - int argc; - char **argv; +do_ielem(const char *cname, int argc, char **argv) { int timeout = 0; @@ -785,10 +759,7 @@ do_ielem(cname, argc, argv) } static int -do_voltag(cname, argc, argv) - const char *cname; - int argc; - char **argv; +do_voltag(const char *cname, int argc, char **argv) { int force = 0; int clear = 0; @@ -873,8 +844,7 @@ do_voltag(cname, argc, argv) } static int -parse_element_type(cp) - char *cp; +parse_element_type(char *cp) { int i; @@ -887,8 +857,7 @@ parse_element_type(cp) } static const char * -element_type_name(et) - int et; +element_type_name(int et) { int i; @@ -900,8 +869,7 @@ element_type_name(et) } static int -parse_element_unit(cp) - char *cp; +parse_element_unit(char *cp) { int i; char *p; @@ -914,8 +882,7 @@ parse_element_unit(cp) } static int -parse_special(cp) - char *cp; +parse_special(char *cp) { int val; @@ -928,8 +895,7 @@ parse_special(cp) } static int -is_special(cp) - char *cp; +is_special(char *cp) { int i; @@ -941,9 +907,7 @@ is_special(cp) } static const char * -bits_to_string(v, cp) - ces_status_flags v; - const char *cp; +bits_to_string(ces_status_flags v, const char *cp) { const char *np; char f, sep, *bp; @@ -974,10 +938,7 @@ bits_to_string(v, cp) * element back to its source slot. */ static int -do_return(cname, argc, argv) - const char *cname; - int argc; - char **argv; +do_return(const char *cname, int argc, char **argv) { struct changer_element_status *ces; struct changer_move cmd; @@ -1040,9 +1001,7 @@ usage: * should free() it when done. */ static struct changer_element_status * -get_element_status(type, element) - unsigned int type; - unsigned int element; +get_element_status(unsigned int type, unsigned int element) { struct changer_element_status_request cesr; struct changer_element_status *ces; @@ -1079,10 +1038,7 @@ get_element_status(type, element) * and iterate until we find a match, or crap out. */ static void -find_element(voltag, et, eu) - char *voltag; - u_int16_t *et; - u_int16_t *eu; +find_element(char *voltag, u_int16_t *et, u_int16_t *eu) { struct changer_params cp; struct changer_element_status_request cesr; @@ -1202,14 +1158,14 @@ find_element(voltag, et, eu) } static void -cleanup() +cleanup(void) { /* Simple enough... */ (void)close(changer_fd); } static void -usage() +usage(void) { (void) fprintf(stderr, "usage: %s [-f changer] command [-] " "arg1 arg2 [arg3 [...]]\n", __progname); diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c index 16827babc9..1c273e7bcd 100644 --- a/bin/chmod/chmod.c +++ b/bin/chmod/chmod.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1989, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)chmod.c 8.8 (Berkeley) 4/1/94 * $FreeBSD: src/bin/chmod/chmod.c,v 1.16.2.6 2002/10/18 01:36:38 trhodes Exp $ - * $DragonFly: src/bin/chmod/chmod.c,v 1.3 2003/09/21 04:18:00 drhodus Exp $ + * $DragonFly: src/bin/chmod/chmod.c,v 1.4 2003/09/28 14:39:13 hmp Exp $ */ #include @@ -48,13 +48,11 @@ #include #include -int main (int, char *[]); +int main (int, char **); void usage (void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { FTS *ftsp; FTSENT *p; diff --git a/bin/date/date.c b/bin/date/date.c index a439708e2d..08e7c11ac9 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1985, 1987, 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)date.c 8.2 (Berkeley) 4/28/95 * $FreeBSD: src/bin/date/date.c,v 1.32.2.6 2001/10/31 17:31:51 dillon Exp $ - * $DragonFly: src/bin/date/date.c,v 1.3 2003/09/21 04:19:10 drhodus Exp $ + * $DragonFly: src/bin/date/date.c,v 1.4 2003/09/28 14:39:13 hmp Exp $ */ #include @@ -65,9 +65,7 @@ static void usage (void); int logwtmp (char *, char *, char *); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { struct timezone tz; int ch, rflag; @@ -173,10 +171,7 @@ main(argc, argv) #define ATOI2(s) ((s) += 2, ((s)[-2] - '0') * 10 + ((s)[-1] - '0')) void -setthetime(fmt, p, jflag, nflag) - const char *fmt; - register const char *p; - int jflag, nflag; +setthetime(const char *fmt, register const char *p, int jflag, int nflag) { register struct tm *lt; struct timeval tv; @@ -286,14 +281,14 @@ setthetime(fmt, p, jflag, nflag) } static void -badformat() +badformat(void) { warnx("illegal time format"); usage(); } static void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n", "usage: date [-jnu] [-d dst] [-r seconds] [-t west] " diff --git a/bin/date/netdate.c b/bin/date/netdate.c index ebe61dfdae..088a3c0f05 100644 --- a/bin/date/netdate.c +++ b/bin/date/netdate.c @@ -32,7 +32,7 @@ * * @(#)netdate.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/bin/date/netdate.c,v 1.11.2.1 2001/05/12 17:14:22 fenner Exp $ - * $DragonFly: src/bin/date/netdate.c,v 1.2 2003/06/17 04:22:49 dillon Exp $ + * $DragonFly: src/bin/date/netdate.c,v 1.3 2003/09/28 14:39:13 hmp Exp $ */ #include @@ -64,8 +64,7 @@ extern int retval; * Returns 0 on success. Returns > 0 on failure, setting retval to 2; */ int -netsettime(tval) - time_t tval; +netsettime(time_t tval) { struct timeval tout; struct servent *sp; diff --git a/bin/dd/args.c b/bin/dd/args.c index 4170fb7491..fd97eb9b73 100644 --- a/bin/dd/args.c +++ b/bin/dd/args.c @@ -36,7 +36,7 @@ * * @(#)args.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/args.c,v 1.25.2.2 2001/01/23 14:20:03 asmodai Exp $ - * $DragonFly: src/bin/dd/args.c,v 1.3 2003/09/21 04:19:42 drhodus Exp $ + * $DragonFly: src/bin/dd/args.c,v 1.4 2003/09/28 14:39:13 hmp Exp $ */ #include @@ -92,8 +92,7 @@ static char *oper; * args -- parse JCL syntax of dd. */ void -jcl(argv) - char **argv; +jcl(char **argv) { struct arg *ap, tmp; char *arg; @@ -169,8 +168,7 @@ jcl(argv) } static int -c_arg(a, b) - const void *a, *b; +c_arg(const void *a, const void *b) { return (strcmp(((const struct arg *)a)->name, @@ -178,8 +176,7 @@ c_arg(a, b) } static void -f_bs(arg) - char *arg; +f_bs(char *arg) { quad_t res; @@ -190,8 +187,7 @@ f_bs(arg) } static void -f_cbs(arg) - char *arg; +f_cbs(char *arg) { quad_t res; @@ -202,8 +198,7 @@ f_cbs(arg) } static void -f_count(arg) - char *arg; +f_count(char *arg) { cpy_cnt = get_num(arg); @@ -214,8 +209,7 @@ f_count(arg) } static void -f_files(arg) - char *arg; +f_files(char *arg) { files_cnt = get_num(arg); @@ -224,8 +218,7 @@ f_files(arg) } static void -f_ibs(arg) - char *arg; +f_ibs(char *arg) { quad_t res; @@ -238,16 +231,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) { quad_t res; @@ -260,24 +251,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_offset(arg); } static void -f_skip(arg) - char *arg; +f_skip(char *arg) { in.offset = get_offset(arg); @@ -307,8 +295,7 @@ static const struct conv { }; static void -f_conv(arg) - char *arg; +f_conv(char *arg) { struct conv *cp, tmp; @@ -327,8 +314,7 @@ f_conv(arg) } static int -c_conv(a, b) - const void *a, *b; +c_conv(const void *a, const void *b) { return (strcmp(((const struct conv *)a)->name, @@ -348,8 +334,7 @@ c_conv(a, b) * the product of the indicated values. */ static quad_t -get_num(val) - char *val; +get_num(char *val) { quad_t num, t; char *expr; @@ -418,8 +403,7 @@ erange: } static off_t -get_offset(val) - char *val; +get_offset(char *val) { quad_t num; diff --git a/bin/dd/conv.c b/bin/dd/conv.c index 25c36a5c11..9d30877c0b 100644 --- a/bin/dd/conv.c +++ b/bin/dd/conv.c @@ -36,7 +36,7 @@ * * @(#)conv.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/conv.c,v 1.15 1999/09/13 21:47:10 green Exp $ - * $DragonFly: src/bin/dd/conv.c,v 1.2 2003/06/17 04:22:49 dillon Exp $ + * $DragonFly: src/bin/dd/conv.c,v 1.3 2003/09/28 14:39:13 hmp Exp $ */ #include @@ -54,7 +54,7 @@ * Worst case buffer calculation is (ibs + obs - 1). */ void -def() +def(void) { u_char *inp; const u_char *t; @@ -83,7 +83,7 @@ def() } void -def_close() +def_close(void) { /* Just update the count, everything is already in the buffer. */ if (in.dbcnt) @@ -98,7 +98,7 @@ def_close() * max out buffer: obs + cbsz */ void -block() +block(void) { u_char *inp, *outp; const u_char *t; @@ -184,7 +184,7 @@ block() } void -block_close() +block_close(void) { /* * Copy any remaining data into the output buffer and pad to a record. @@ -211,7 +211,7 @@ block_close() * max out buffer: obs + cbsz */ void -unblock() +unblock(void) { u_char *inp; const u_char *t; @@ -245,7 +245,7 @@ unblock() } void -unblock_close() +unblock_close(void) { u_char *t; size_t cnt; diff --git a/bin/dd/dd.c b/bin/dd/dd.c index ef07a2a487..af5a689b9a 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -37,7 +37,7 @@ * @(#) Copyright (c) 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)dd.c 8.5 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/dd.c,v 1.27.2.3 2001/08/01 01:37:35 obrien Exp $ - * $DragonFly: src/bin/dd/dd.c,v 1.3 2003/09/21 04:19:42 drhodus Exp $ + * $DragonFly: src/bin/dd/dd.c,v 1.4 2003/09/28 14:39:13 hmp Exp $ */ #include @@ -77,9 +77,7 @@ quad_t files_cnt = 1; /* # of files to copy */ const u_char *ctab; /* conversion table */ int -main(argc, argv) - int argc __unused; - char *argv[]; +main(int argc __unused, char **argv) { (void)setlocale(LC_CTYPE, ""); jcl(argv); @@ -98,7 +96,7 @@ main(argc, argv) } static void -setup() +setup(void) { u_int cnt; struct timeval tv; @@ -200,8 +198,7 @@ setup() } static void -getfdtype(io) - IO *io; +getfdtype(IO *io) { struct stat sb; int type; @@ -237,7 +234,7 @@ getfdtype(io) } static void -dd_in() +dd_in(void) { ssize_t n; @@ -344,7 +341,7 @@ dd_in() * is truncated. */ static void -dd_close() +dd_close(void) { if (cfunc == def) def_close(); @@ -364,8 +361,7 @@ dd_close() } void -dd_out(force) - int force; +dd_out(int force) { u_char *outp; size_t cnt, i, n; diff --git a/bin/dd/misc.c b/bin/dd/misc.c index d2b768810b..2062681243 100644 --- a/bin/dd/misc.c +++ b/bin/dd/misc.c @@ -36,7 +36,7 @@ * * @(#)misc.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/misc.c,v 1.18.2.1 2001/08/01 01:40:03 obrien Exp $ - * $DragonFly: src/bin/dd/misc.c,v 1.2 2003/06/17 04:22:49 dillon Exp $ + * $DragonFly: src/bin/dd/misc.c,v 1.3 2003/09/28 14:39:13 hmp Exp $ */ #include @@ -52,7 +52,7 @@ #include "extern.h" void -summary() +summary(void) { struct timeval tv; double secs; @@ -85,8 +85,7 @@ summary() /* ARGSUSED */ void -summaryx(notused) - int notused __unused; +summaryx(int notused __unused) { int save_errno = errno; @@ -96,8 +95,7 @@ summaryx(notused) /* ARGSUSED */ void -terminate(sig) - int sig; +terminate(int sig) { summary(); diff --git a/bin/dd/position.c b/bin/dd/position.c index f4f0bcdfe9..51b0a05cee 100644 --- a/bin/dd/position.c +++ b/bin/dd/position.c @@ -36,7 +36,7 @@ * * @(#)position.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/position.c,v 1.17.2.2 2001/01/23 14:23:55 asmodai Exp $ - * $DragonFly: src/bin/dd/position.c,v 1.2 2003/06/17 04:22:49 dillon Exp $ + * $DragonFly: src/bin/dd/position.c,v 1.3 2003/09/28 14:39:13 hmp Exp $ */ #include @@ -56,7 +56,7 @@ * output. */ void -pos_in() +pos_in(void) { off_t cnt; int warned; @@ -119,7 +119,7 @@ pos_in() } void -pos_out() +pos_out(void) { struct mtop t_op; off_t cnt; diff --git a/bin/df/df.c b/bin/df/df.c index 31060acc75..4d32cd120b 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -38,7 +38,7 @@ * @(#) Copyright (c) 1980, 1990, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)df.c 8.9 (Berkeley) 5/8/95 * $FreeBSD: src/bin/df/df.c,v 1.23.2.9 2002/07/01 00:14:24 iedowse Exp $ - * $DragonFly: src/bin/df/df.c,v 1.3 2003/08/08 04:18:29 dillon Exp $ + * $DragonFly: src/bin/df/df.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -123,7 +123,7 @@ static __inline int imax(int a, int b) } int -main(int argc, char *argv[]) +main(int argc, char **argv) { struct stat stbuf; struct statfs statfsbuf, *mntbuf; diff --git a/bin/domainname/domainname.c b/bin/domainname/domainname.c index 34552d4c49..f2711ff5ed 100644 --- a/bin/domainname/domainname.c +++ b/bin/domainname/domainname.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)hostname.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/bin/domainname/domainname.c,v 1.12.2.1 2001/08/01 02:32:16 obrien Exp $ - * $DragonFly: src/bin/domainname/domainname.c,v 1.3 2003/09/21 04:20:36 drhodus Exp $ + * $DragonFly: src/bin/domainname/domainname.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -48,9 +48,7 @@ int main (int, char *[]); void usage (void); int -main(argc,argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch; char domainname[MAXHOSTNAMELEN]; @@ -78,7 +76,7 @@ main(argc,argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: domainname [ypdomain]\n"); exit(1); diff --git a/bin/echo/echo.c b/bin/echo/echo.c index 42c2f07c4d..5d5012e63d 100644 --- a/bin/echo/echo.c +++ b/bin/echo/echo.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)echo.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/bin/echo/echo.c,v 1.8.2.1 2001/08/01 02:33:32 obrien Exp $ - * $DragonFly: src/bin/echo/echo.c,v 1.3 2003/09/21 04:21:11 drhodus Exp $ + * $DragonFly: src/bin/echo/echo.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -43,9 +43,7 @@ int main (int, char *[]); int -main(argc, argv) - int argc __unused; - char *argv[]; +main(int argc __unused, char **argv) { int nflag; diff --git a/bin/ed/buf.c b/bin/ed/buf.c index 16d14e83de..9b5af86c8a 100644 --- a/bin/ed/buf.c +++ b/bin/ed/buf.c @@ -27,7 +27,7 @@ * * @(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp * $FreeBSD: src/bin/ed/buf.c,v 1.17 1999/08/27 23:14:12 peter Exp $ - * $DragonFly: src/bin/ed/buf.c,v 1.2 2003/06/17 04:22:49 dillon Exp $ + * $DragonFly: src/bin/ed/buf.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -44,8 +44,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 */ @@ -80,8 +79,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; @@ -127,8 +125,7 @@ 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; @@ -141,8 +138,7 @@ add_line_node(lp) /* get_line_node_addr: return line number of pointer */ long -get_line_node_addr(lp) - line_t *lp; +get_line_node_addr(line_t *lp) { line_t *cp = &buffer_head; long n = 0; @@ -159,8 +155,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) - long n; +get_addressed_line_node(long n) { static line_t *lp = &buffer_head; static long on = 0; @@ -195,7 +190,7 @@ char sfn[15] = ""; /* scratch file name */ /* open_sbuf: open scratch file */ int -open_sbuf() +open_sbuf(void) { int fd = -1; int u; @@ -219,7 +214,7 @@ open_sbuf() /* close_sbuf: close scratch file */ int -close_sbuf() +close_sbuf(void) { if (sfp) { if (fclose(sfp) < 0) { @@ -237,8 +232,7 @@ close_sbuf() /* quit: remove_lines scratch file and exit */ void -quit(n) - int n; +quit(int n) { if (sfp) { fclose(sfp); @@ -252,7 +246,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; @@ -277,11 +271,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 1508b2c880..74e9bd2723 100644 --- a/bin/ed/cbc.c +++ b/bin/ed/cbc.c @@ -38,7 +38,7 @@ * * @(#)cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp * $FreeBSD: src/bin/ed/cbc.c,v 1.12.2.1 2001/07/04 22:32:18 kris Exp $ - * $DragonFly: src/bin/ed/cbc.c,v 1.2 2003/06/17 04:22:49 dillon Exp $ + * $DragonFly: src/bin/ed/cbc.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -103,7 +103,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; @@ -122,8 +122,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) { @@ -139,9 +138,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) { @@ -157,8 +154,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) { @@ -176,7 +172,7 @@ flush_des_file(fp) * get keyword from tty or stdin */ int -get_keyword() +get_keyword(void) { register char *p; /* used to obtain the key */ Desbuf msgbuf; /* I/O buffer */ @@ -203,8 +199,7 @@ get_keyword() * print a warning message and, possibly, terminate */ void -des_error(s) - char *s; /* the message */ +des_error(char *s) { (void)sprintf(errmsg, "%s", s ? s : strerror(errno)); } @@ -213,9 +208,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); @@ -245,9 +238,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) { register int i, j; /* counter in a for loop */ int nbuf[64]; /* used for hex/key translation */ @@ -313,8 +304,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) { register int i, j; /* counter in a for loop */ register int par; /* parity counter */ @@ -343,10 +333,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 */ @@ -382,9 +369,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 */ register int n; /* number of bytes actually read */ diff --git a/bin/ed/glbl.c b/bin/ed/glbl.c index 1642c8af6d..fe14524d02 100644 --- a/bin/ed/glbl.c +++ b/bin/ed/glbl.c @@ -27,7 +27,7 @@ * * @(#)glob.c,v 1.1 1994/02/01 00:34:40 alm Exp * $FreeBSD: src/bin/ed/glbl.c,v 1.9.2.1 2001/01/23 14:38:31 asmodai Exp $ - * $DragonFly: src/bin/ed/glbl.c,v 1.2 2003/06/17 04:22:49 dillon Exp $ + * $DragonFly: src/bin/ed/glbl.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -40,8 +40,7 @@ /* 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; @@ -74,9 +73,7 @@ build_active_list(isgcmd) /* exec_global: apply command list in the command buffer to the active lines in a range; return command status */ long -exec_global(interact, gflag) - int interact; - int gflag; +exec_global(int interact, int gflag) { static char *ocmd = NULL; static int ocmdsz = 0; @@ -148,8 +145,7 @@ long 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; @@ -187,8 +183,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; long i; @@ -205,7 +200,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++; @@ -215,7 +210,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 f2d8fc2165..5afbf3652f 100644 --- a/bin/ed/io.c +++ b/bin/ed/io.c @@ -26,7 +26,7 @@ * * @(#)io.c,v 1.1 1994/02/01 00:34:41 alm Exp * $FreeBSD: src/bin/ed/io.c,v 1.10 1999/08/27 23:14:14 peter Exp $ - * $DragonFly: src/bin/ed/io.c,v 1.2 2003/06/17 04:22:49 dillon Exp $ + * $DragonFly: src/bin/ed/io.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ #include "ed.h" @@ -36,9 +36,7 @@ extern int scripted; /* read_file: read a named file/pipe into the buffer; return line count */ long -read_file(fn, n) - char *fn; - long n; +read_file(char *fn, long n) { FILE *fp; long size; @@ -69,9 +67,7 @@ int newline_added; /* if set, newline appended to input file */ /* read_stream: read a stream into the editor buffer; return status */ long -read_stream(fp, n) - FILE *fp; - long n; +read_stream(FILE *fp, long n) { line_t *lp = get_addressed_line_node(n); undo_t *up = NULL; @@ -120,8 +116,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) { register int c; register int i = 0; @@ -150,11 +145,7 @@ get_stream_line(fp) /* write_file: write a range of lines to a named file/pipe; return line count */ long -write_file(fn, mode, n, m) - char *fn; - char *mode; - long n; - long m; +write_file(char *fn, char *mode, long n, long m) { FILE *fp; long size; @@ -178,10 +169,7 @@ write_file(fn, mode, n, m) /* write_stream: write a range of lines to a stream; return status */ long -write_stream(fp, n, m) - FILE *fp; - long n; - long m; +write_stream(FILE *fp, long n, long m) { line_t *lp = get_addressed_line_node(n); unsigned long size = 0; @@ -210,10 +198,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) { @@ -226,9 +211,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 */ @@ -271,7 +254,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) { register int oi = 0; register int i = 0; @@ -319,11 +302,7 @@ extern int cols; /* put_tty_line: print text to stdout */ int -put_tty_line(s, l, n, gflag) - char *s; - int l; - long n; - int gflag; +put_tty_line(char *s, int l, long n, int gflag) { int col = 0; int lc = 0; diff --git a/bin/ed/main.c b/bin/ed/main.c index a8f98d0ce6..879f025eb5 100644 --- a/bin/ed/main.c +++ b/bin/ed/main.c @@ -28,7 +28,7 @@ * @(#) Copyright (c) 1993 Andrew Moore, Talke Studio. All rights reserved. * @(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp * $FreeBSD: src/bin/ed/main.c,v 1.14.2.4 2001/08/01 02:36:03 obrien Exp $ - * $DragonFly: src/bin/ed/main.c,v 1.2 2003/06/17 04:22:49 dillon Exp $ + * $DragonFly: src/bin/ed/main.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ /* @@ -97,9 +97,7 @@ const char usage[] = "usage: %s [-] [-sx] [-p string] [name]\n"; /* ed: line editor */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int c, n; long status = 0; @@ -260,7 +258,7 @@ long 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) { long addr; @@ -288,7 +286,7 @@ extract_addr_range() /* next_addr: return the next line address in the command buffer */ long -next_addr() +next_addr(void) { char *hd; long addr = current_addr; @@ -439,7 +437,7 @@ long rows = 22; /* scroll length: ws_row - 2 */ /* exec_command: execute the next command in command buffer; return print request, if any */ int -exec_command() +exec_command(void) { extern long u_current_addr; extern long u_addr_last; @@ -873,8 +871,7 @@ exec_command() /* check_addr_range: return status of address range check */ int -check_addr_range(n, m) - long n, m; +check_addr_range(long n, long m) { if (addr_cnt == 0) { first_addr = n; @@ -893,9 +890,7 @@ check_addr_range(n, m) pattern in a given direction. wrap around begin/end of editor buffer if necessary */ long -get_matching_node_addr(pat, dir) - pattern_t *pat; - int dir; +get_matching_node_addr(pattern_t *pat, int dir) { char *s; long n = current_addr; @@ -920,7 +915,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; @@ -963,7 +958,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; @@ -1029,8 +1024,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) - long n; +append_lines(long n) { int l; char *lp = ibuf; @@ -1079,9 +1073,7 @@ append_lines(n) /* join_lines: replace a range of lines with the joined text of those lines */ int -join_lines(from, to) - long from; - long to; +join_lines(long from, long to) { static char *buf = NULL; static int n; @@ -1118,8 +1110,7 @@ join_lines(from, to) /* move_lines: move a range of lines */ int -move_lines(addr) - long addr; +move_lines(long addr) { line_t *b1, *a1, *b2, *a2; long n = INC_MOD(second_addr, addr_last); @@ -1163,8 +1154,7 @@ move_lines(addr) /* copy_lines: copy a range of lines; return status */ int -copy_lines(addr) - long addr; +copy_lines(long addr) { line_t *lp, *np = get_addressed_line_node(first_addr); undo_t *up = NULL; @@ -1200,8 +1190,7 @@ copy_lines(addr) /* delete_lines: delete a range of lines */ int -delete_lines(from, to) - long from, to; +delete_lines(long from, long to) { line_t *n, *p; @@ -1226,10 +1215,7 @@ delete_lines(from, to) /* display_lines: print a range of lines to stdout */ int -display_lines(from, to, gflag) - long from; - long to; - int gflag; +display_lines(long from, long to, int gflag) { line_t *bp; line_t *ep; @@ -1258,9 +1244,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((unsigned char)n)) { sprintf(errmsg, "invalid mark character"); @@ -1274,8 +1258,7 @@ mark_line_node(lp, n) /* get_marked_node_addr: return address of a marked line */ long -get_marked_node_addr(n) - int n; +get_marked_node_addr(int n) { if (!islower((unsigned char)n)) { sprintf(errmsg, "invalid mark character"); @@ -1287,8 +1270,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; @@ -1302,8 +1284,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; @@ -1321,9 +1302,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); } @@ -1331,8 +1310,7 @@ has_trailing_escape(s, t) /* strip_escapes: return copy of escaped string of at most length PATH_MAX */ char * -strip_escapes(s) - char *s; +strip_escapes(char *s) { static char *file = NULL; static int filesz = 0; @@ -1348,8 +1326,7 @@ strip_escapes(s) void -signal_hup(signo) - int signo; +signal_hup(int signo) { if (mutex) sigflags |= (1 << (signo - 1)); @@ -1359,8 +1336,7 @@ signal_hup(signo) void -signal_int(signo) - int signo; +signal_int(int signo) { if (mutex) sigflags |= (1 << (signo - 1)); @@ -1370,8 +1346,7 @@ signal_int(signo) void -handle_hup(signo) - int signo; +handle_hup(int signo) { char *hup = NULL; /* hup filename */ char *s; @@ -1395,8 +1370,7 @@ handle_hup(signo) void -handle_int(signo) - int signo; +handle_int(int signo) { if (!sigactive) quit(1); @@ -1412,8 +1386,7 @@ handle_int(signo) int cols = 72; /* wrap column */ void -handle_winch(signo) - int signo; +handle_winch(int signo) { int save_errno = errno; @@ -1430,8 +1403,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, '/'))) { sprintf(errmsg, "shell access restricted"); diff --git a/bin/ed/re.c b/bin/ed/re.c index 948fd9aeb0..b9c1c480a7 100644 --- a/bin/ed/re.c +++ b/bin/ed/re.c @@ -27,7 +27,7 @@ * * @(#)re.c,v 1.6 1994/02/01 00:34:43 alm Exp * $FreeBSD: src/bin/ed/re.c,v 1.15.2.1 2001/08/01 02:36:03 obrien Exp $ - * $DragonFly: src/bin/ed/re.c,v 1.2 2003/06/17 04:22:49 dillon Exp $ + * $DragonFly: src/bin/ed/re.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ #include "ed.h" @@ -40,7 +40,7 @@ char errmsg[PATH_MAX + 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; @@ -77,8 +77,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 */ @@ -114,8 +113,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 27a0ad9423..eccb17a1ad 100644 --- a/bin/ed/sub.c +++ b/bin/ed/sub.c @@ -27,7 +27,7 @@ * * @(#)sub.c,v 1.1 1994/02/01 00:34:44 alm Exp * $FreeBSD: src/bin/ed/sub.c,v 1.12 1999/08/27 23:14:15 peter Exp $ - * $DragonFly: src/bin/ed/sub.c,v 1.2 2003/06/17 04:22:50 dillon Exp $ + * $DragonFly: src/bin/ed/sub.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ #include "ed.h" @@ -39,9 +39,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; - long *np; +extract_subst_tail(int *flagp, long *np) { char delimiter; @@ -72,7 +70,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; @@ -113,10 +111,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; @@ -170,11 +165,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; @@ -232,11 +223,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 be36f3ed2b..f82193a350 100644 --- a/bin/ed/undo.c +++ b/bin/ed/undo.c @@ -26,7 +26,7 @@ * * @(#)undo.c,v 1.1 1994/02/01 00:34:44 alm Exp * $FreeBSD: src/bin/ed/undo.c,v 1.9 1999/08/27 23:14:15 peter Exp $ - * $DragonFly: src/bin/ed/undo.c,v 1.2 2003/06/17 04:22:50 dillon Exp $ + * $DragonFly: src/bin/ed/undo.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ #include "ed.h" @@ -39,10 +39,7 @@ long 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; - long from; - long to; +push_undo_stack(int type, long from, long to) { undo_t *t; @@ -86,7 +83,7 @@ long 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) { long n; long o_current_addr = current_addr; @@ -135,7 +132,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/hostname/hostname.c b/bin/hostname/hostname.c index 2e64f98f35..14c6b9516d 100644 --- a/bin/hostname/hostname.c +++ b/bin/hostname/hostname.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)hostname.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/bin/hostname/hostname.c,v 1.10.2.1 2001/08/01 02:40:23 obrien Exp $ - * $DragonFly: src/bin/hostname/hostname.c,v 1.3 2003/09/21 04:22:19 drhodus Exp $ + * $DragonFly: src/bin/hostname/hostname.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -48,9 +48,7 @@ int main (int, char *[]); void usage (void); int -main(argc,argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, sflag; char *p, hostname[MAXHOSTNAMELEN]; @@ -85,7 +83,7 @@ main(argc,argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: hostname [-s] [name-of-host]\n"); diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c index 2c9f78e913..11d99ff3b8 100644 --- a/bin/mkdir/mkdir.c +++ b/bin/mkdir/mkdir.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1992, 1993 The Regents of the University of California. All rights reserved. * @(#)mkdir.c 8.2 (Berkeley) 1/25/94 * $FreeBSD: src/bin/mkdir/mkdir.c,v 1.19.2.2 2001/08/01 04:42:37 obrien Exp $ - * $DragonFly: src/bin/mkdir/mkdir.c,v 1.3 2003/09/21 04:23:06 drhodus Exp $ + * $DragonFly: src/bin/mkdir/mkdir.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -55,9 +55,7 @@ void usage (void); int vflag; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, exitval, success, omode, pflag; mode_t *set = (mode_t *)NULL; @@ -127,9 +125,7 @@ main(argc, argv) } int -build(path, omode) - char *path; - mode_t omode; +build(char *path, mode_t omode) { struct stat sb; mode_t numask, oumask; @@ -197,7 +193,7 @@ build(path, omode) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: mkdir [-pv] [-m mode] directory ...\n"); diff --git a/bin/mv/mv.c b/bin/mv/mv.c index f4ef70127f..977d13e9f9 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mv.c 8.2 (Berkeley) 4/2/94 * $FreeBSD: src/bin/mv/mv.c,v 1.24.2.5 2002/08/19 00:26:41 johan Exp $ - * $DragonFly: src/bin/mv/mv.c,v 1.3 2003/09/21 04:23:40 drhodus Exp $ + * $DragonFly: src/bin/mv/mv.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -66,9 +66,7 @@ int main (int, char *[]); void usage (void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register int baselen, len, rval; register char *p, *endp; @@ -146,8 +144,7 @@ main(argc, argv) } int -do_move(from, to) - char *from, *to; +do_move(char *from, char *to) { struct stat sb; int ask, ch, first; @@ -231,9 +228,7 @@ do_move(from, to) } int -fastcopy(from, to, sbp) - char *from, *to; - struct stat *sbp; +fastcopy(char *from, char *to, struct stat *sbp) { struct timeval tval[2]; static u_int blen; @@ -324,8 +319,7 @@ err: if (unlink(to)) } int -copy(from, to) - char *from, *to; +copy(char *from, char *to) { int pid, status; @@ -370,7 +364,7 @@ copy(from, to) } void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n", diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c index a17d1340fd..299d91218d 100644 --- a/bin/pax/ar_io.c +++ b/bin/pax/ar_io.c @@ -36,7 +36,7 @@ * * @(#)ar_io.c 8.2 (Berkeley) 4/18/94 * $FreeBSD: src/bin/pax/ar_io.c,v 1.12.2.1 2001/08/01 05:03:11 obrien Exp $ - * $DragonFly: src/bin/pax/ar_io.c,v 1.4 2003/09/21 04:24:16 drhodus Exp $ + * $DragonFly: src/bin/pax/ar_io.c,v 1.5 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -94,14 +94,8 @@ static void ar_start_gzip (int, const char *, int); * -1 on failure, 0 otherwise */ -#ifdef __STDC__ int ar_open(char *name) -#else -int -ar_open(name) - char *name; -#endif { struct mtget mb; @@ -299,13 +293,8 @@ ar_open(name) * ar_close() * closes archive device, increments volume number, and prints i/o summary */ -#ifdef __STDC__ void ar_close(void) -#else -void -ar_close() -#endif { int status; @@ -423,13 +412,8 @@ ar_close() * other side of the pipe from getting a SIGPIPE (pax will stop * reading an archive once a format dependent trailer is detected). */ -#ifdef __STDC__ void ar_drain(void) -#else -void -ar_drain() -#endif { register int res; char drbuf[MAXBLK]; @@ -460,13 +444,8 @@ ar_drain() * 0 if all ready to write, -1 otherwise */ -#ifdef __STDC__ int ar_set_wr(void) -#else -int -ar_set_wr() -#endif { off_t cpos; @@ -503,13 +482,8 @@ ar_set_wr() * 0 if we can append, -1 otherwise. */ -#ifdef __STDC__ int ar_app_ok(void) -#else -int -ar_app_ok() -#endif { if (artyp == ISPIPE) { paxwarn(1, "Cannot append to an archive obtained from a pipe."); @@ -532,15 +506,8 @@ ar_app_ok() * Number of bytes in buffer. 0 for end of file, -1 for a read error. */ -#ifdef __STDC__ int ar_read(register char *buf, register int cnt) -#else -int -ar_read(buf, cnt) - register char *buf; - register int cnt; -#endif { register int res = 0; @@ -622,15 +589,8 @@ ar_read(buf, cnt) * error in the archive occured. */ -#ifdef __STDC__ int ar_write(register char *buf, register int bsz) -#else -int -ar_write(buf, bsz) - register char *buf; - register int bsz; -#endif { register int res; off_t cpos; @@ -747,13 +707,8 @@ ar_write(buf, bsz) * 0 when ok to try i/o again, -1 otherwise. */ -#ifdef __STDC__ int ar_rdsync(void) -#else -int -ar_rdsync() -#endif { long fsbz; off_t cpos; @@ -838,15 +793,8 @@ ar_rdsync() * partial move (the amount moved is in skipped) */ -#ifdef __STDC__ int ar_fow(off_t sksz, off_t *skipped) -#else -int -ar_fow(sksz, skipped) - off_t sksz; - off_t *skipped; -#endif { off_t cpos; off_t mpos; @@ -904,14 +852,8 @@ ar_fow(sksz, skipped) * 0 if moved the requested distance, -1 on complete failure */ -#ifdef __STDC__ int ar_rev(off_t sksz) -#else -int -ar_rev(sksz) - off_t sksz; -#endif { off_t cpos; struct mtop mb; @@ -1042,13 +984,8 @@ ar_rev(sksz) * physical block size if ok (ok > 0), -1 otherwise */ -#ifdef __STDC__ static int get_phys(void) -#else -static int -get_phys() -#endif { register int padsz = 0; register int res; @@ -1160,13 +1097,8 @@ get_phys() * 0 when ready to continue, -1 when all done */ -#ifdef __STDC__ int ar_next(void) -#else -int -ar_next() -#endif { char buf[PAXPATHLEN+2]; static int freeit = 0; diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c index 01efdc3403..71d35cd80a 100644 --- a/bin/pax/ar_subs.c +++ b/bin/pax/ar_subs.c @@ -36,7 +36,7 @@ * * @(#)ar_subs.c 8.2 (Berkeley) 4/18/94 * $FreeBSD: src/bin/pax/ar_subs.c,v 1.13.2.1 2001/08/01 05:03:11 obrien Exp $ - * $DragonFly: src/bin/pax/ar_subs.c,v 1.3 2003/09/21 04:24:16 drhodus Exp $ + * $DragonFly: src/bin/pax/ar_subs.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -71,13 +71,8 @@ u_long flcnt; /* number of files processed */ * (no pattern matches all). */ -#ifdef __STDC__ void list(void) -#else -void -list() -#endif { register ARCHD *arcn; register int res; @@ -153,13 +148,8 @@ list() * pattern(s) (no patterns extracts all members) */ -#ifdef __STDC__ void extract(void) -#else -void -extract() -#endif { register ARCHD *arcn; register int res; @@ -364,15 +354,8 @@ extract() * previously written archive. */ -#ifdef __STDC__ static void wr_archive(register ARCHD *arcn, int is_app) -#else -static void -wr_archive(arcn, is_app) - register ARCHD *arcn; - int is_app; -#endif { register int res; register int hlk; @@ -574,13 +557,8 @@ wr_archive(arcn, is_app) * over write existing files that it creates. */ -#ifdef __STDC__ void append(void) -#else -void -append() -#endif { register ARCHD *arcn; register int res; @@ -715,13 +693,8 @@ append() * write a new archive */ -#ifdef __STDC__ void archive(void) -#else -void -archive() -#endif { ARCHD archd; @@ -746,13 +719,8 @@ archive() * (except the files are forced to be under the destination directory). */ -#ifdef __STDC__ void copy(void) -#else -void -copy() -#endif { register ARCHD *arcn; register int res; @@ -998,14 +966,8 @@ copy() * the specs for rd_wrbuf() for more details) */ -#ifdef __STDC__ static int next_head(register ARCHD *arcn) -#else -static int -next_head(arcn) - register ARCHD *arcn; -#endif { register int ret; register char *hdend; @@ -1156,13 +1118,8 @@ next_head(arcn) * 0 if archive found -1 otherwise */ -#ifdef __STDC__ static int get_arc(void) -#else -static int -get_arc() -#endif { register int i; register int hdsz = 0; diff --git a/bin/pax/buf_subs.c b/bin/pax/buf_subs.c index 3e765f7003..f0735d5f0c 100644 --- a/bin/pax/buf_subs.c +++ b/bin/pax/buf_subs.c @@ -36,7 +36,7 @@ * * @(#)buf_subs.c 8.2 (Berkeley) 4/18/94 * $FreeBSD: src/bin/pax/buf_subs.c,v 1.12.2.1 2001/08/01 05:03:11 obrien Exp $ - * $DragonFly: src/bin/pax/buf_subs.c,v 1.2 2003/06/17 04:22:50 dillon Exp $ + * $DragonFly: src/bin/pax/buf_subs.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -80,13 +80,8 @@ off_t rdcnt; /* # of bytes read on current vol */ * 0 if ok, -1 if the user specified write block size violates pax spec */ -#ifdef __STDC__ int wr_start(void) -#else -int -wr_start() -#endif { buf = &(bufmem[BLKMULT]); /* @@ -133,13 +128,8 @@ wr_start() * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int rd_start(void) -#else -int -rd_start() -#endif { /* * leave space for the header pushback (see get_arc()). If we are @@ -176,13 +166,8 @@ rd_start() * set up buffer system for copying within the file system */ -#ifdef __STDC__ void cp_start(void) -#else -void -cp_start() -#endif { buf = &(bufmem[BLKMULT]); rdblksz = blksz = MAXBLK; @@ -220,14 +205,8 @@ cp_start() * 0 for success, -1 for failure */ -#ifdef __STDC__ int appnd_start(off_t skcnt) -#else -int -appnd_start(skcnt) - off_t skcnt; -#endif { register int res; off_t cnt; @@ -325,13 +304,8 @@ appnd_start(skcnt) * 0 on success, and -1 on failure */ -#ifdef __STDC__ int rd_sync(void) -#else -int -rd_sync() -#endif { register int errcnt = 0; register int res; @@ -398,15 +372,8 @@ rd_sync() * pback space is increased. */ -#ifdef __STDC__ void pback(char *pt, int cnt) -#else -void -pback(pt, cnt) - char *pt; - int cnt; -#endif { bufpt -= cnt; memcpy(bufpt, pt, cnt); @@ -421,14 +388,8 @@ pback(pt, cnt) * 0 if ok, -1 failure, and 1 when EOF on the archive volume was detected. */ -#ifdef __STDC__ int rd_skip(off_t skcnt) -#else -int -rd_skip(skcnt) - off_t skcnt; -#endif { off_t res; off_t cnt; @@ -496,13 +457,8 @@ rd_skip(skcnt) * BE a requirement.... */ -#ifdef __STDC__ void wr_fin(void) -#else -void -wr_fin() -#endif { if (bufpt > buf) { memset(bufpt, 0, bufend - bufpt); @@ -522,15 +478,8 @@ wr_fin() * 0 if buffer was filled ok, -1 o.w. (buffer flush failure) */ -#ifdef __STDC__ int wr_rdbuf(register char *out, register int outcnt) -#else -int -wr_rdbuf(out, outcnt) - register char *out; - register int outcnt; -#endif { register int cnt; @@ -565,15 +514,8 @@ wr_rdbuf(out, outcnt) * -1 is a read error */ -#ifdef __STDC__ int rd_wrbuf(register char *in, register int cpcnt) -#else -int -rd_wrbuf(in, cpcnt) - register char *in; - register int cpcnt; -#endif { register int res; register int cnt; @@ -620,14 +562,8 @@ rd_wrbuf(in, cpcnt) * 0 if ok, -1 if there was a buf_flush failure */ -#ifdef __STDC__ int wr_skip(off_t skcnt) -#else -int -wr_skip(skcnt) - off_t skcnt; -#endif { register int cnt; @@ -664,16 +600,8 @@ wr_skip(skcnt) * 0, but "left" is set to be greater than zero. */ -#ifdef __STDC__ int wr_rdfile(ARCHD *arcn, int ifd, off_t *left) -#else -int -wr_rdfile(arcn, ifd, left) - ARCHD *arcn; - int ifd; - off_t *left; -#endif { register int cnt; register int res = 0; @@ -733,16 +661,8 @@ wr_rdfile(arcn, ifd, left) * we return a 0 but "left" is set to be the amount unwritten */ -#ifdef __STDC__ int rd_wrfile(ARCHD *arcn, int ofd, off_t *left) -#else -int -rd_wrfile(arcn, ofd, left) - ARCHD *arcn; - int ofd; - off_t *left; -#endif { register int cnt = 0; register off_t size = arcn->sb.st_size; @@ -829,16 +749,8 @@ rd_wrfile(arcn, ofd, left) * destination file so we can properly copy files with holes. */ -#ifdef __STDC__ void cp_file(ARCHD *arcn, int fd1, int fd2) -#else -void -cp_file(arcn, fd1, fd2) - ARCHD *arcn; - int fd1; - int fd2; -#endif { register int cnt; register off_t cpcnt = 0L; @@ -918,13 +830,8 @@ cp_file(arcn, fd1, fd2) * 0 when finished (user specified termination in ar_next()). */ -#ifdef __STDC__ int buf_fill(void) -#else -int -buf_fill() -#endif { register int cnt; static int fini = 0; @@ -968,14 +875,8 @@ buf_fill() * 0 if all is ok, -1 when a write error occurs. */ -#ifdef __STDC__ int buf_flush(register int bufcnt) -#else -int -buf_flush(bufcnt) - register int bufcnt; -#endif { register int cnt; register int push = 0; diff --git a/bin/pax/cache.c b/bin/pax/cache.c index 2cbfc0b5b8..21a72658c9 100644 --- a/bin/pax/cache.c +++ b/bin/pax/cache.c @@ -36,7 +36,7 @@ * * @(#)cache.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/bin/pax/cache.c,v 1.12.2.1 2001/08/01 05:03:11 obrien Exp $ - * $DragonFly: src/bin/pax/cache.c,v 1.2 2003/06/17 04:22:50 dillon Exp $ + * $DragonFly: src/bin/pax/cache.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -72,13 +72,8 @@ static GIDC **grptb = NULL; /* group name to gid cache */ * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int uidtb_start(void) -#else -int -uidtb_start() -#endif { static int fail = 0; @@ -101,13 +96,8 @@ uidtb_start() * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int gidtb_start(void) -#else -int -gidtb_start() -#endif { static int fail = 0; @@ -130,13 +120,8 @@ gidtb_start() * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int usrtb_start(void) -#else -int -usrtb_start() -#endif { static int fail = 0; @@ -159,13 +144,8 @@ usrtb_start() * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int grptb_start(void) -#else -int -grptb_start() -#endif { static int fail = 0; @@ -189,15 +169,8 @@ grptb_start() * Pointer to stored name (or a empty string) */ -#ifdef __STDC__ char * name_uid(uid_t uid, int frc) -#else -char * -name_uid(uid, frc) - uid_t uid; - int frc; -#endif { register struct passwd *pw; register UIDC *ptr; @@ -267,15 +240,8 @@ name_uid(uid, frc) * Pointer to stored name (or a empty string) */ -#ifdef __STDC__ char * name_gid(gid_t gid, int frc) -#else -char * -name_gid(gid, frc) - gid_t gid; - int frc; -#endif { register struct group *gr; register GIDC *ptr; @@ -344,15 +310,8 @@ name_gid(gid, frc) * the uid (if any) for a user name, or a -1 if no match can be found */ -#ifdef __STDC__ int uid_name(char *name, uid_t *uid) -#else -int -uid_name(name, uid) - char *name; - uid_t *uid; -#endif { register struct passwd *pw; register UIDC *ptr; @@ -415,15 +374,8 @@ uid_name(name, uid) * the gid (if any) for a group name, or a -1 if no match can be found */ -#ifdef __STDC__ int gid_name(char *name, gid_t *gid) -#else -int -gid_name(name, gid) - char *name; - gid_t *gid; -#endif { register struct group *gr; register GIDC *ptr; diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c index fcf82326a5..7812281d56 100644 --- a/bin/pax/cpio.c +++ b/bin/pax/cpio.c @@ -36,7 +36,7 @@ * * @(#)cpio.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/bin/pax/cpio.c,v 1.12.2.1 2001/08/01 05:03:11 obrien Exp $ - * $DragonFly: src/bin/pax/cpio.c,v 1.3 2003/09/21 04:24:16 drhodus Exp $ + * $DragonFly: src/bin/pax/cpio.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -71,13 +71,8 @@ static int swp_head; /* binary cpio header byte swap */ * 0 if ok -1 otherwise (the return values of lnk_start()) */ -#ifdef __STDC__ int cpio_strd(void) -#else -int -cpio_strd() -#endif { return(lnk_start()); } @@ -92,14 +87,8 @@ cpio_strd() * 0 if a valid trailer, -1 if not a valid trailer, */ -#ifdef __STDC__ int cpio_trail(register ARCHD *arcn) -#else -int -cpio_trail(arcn) - register ARCHD *arcn; -#endif { /* * look for trailer id in file we are about to process @@ -116,14 +105,8 @@ cpio_trail(arcn) * 0 */ -#ifdef __STDC__ static int com_rd(register ARCHD *arcn) -#else -static int -com_rd(arcn) - register ARCHD *arcn; -#endif { arcn->skip = 0; arcn->pat = NULL; @@ -171,13 +154,8 @@ com_rd(arcn) * result of the write of the trailer from the cpio specific write func */ -#ifdef __STDC__ int cpio_endwr(void) -#else -int -cpio_endwr() -#endif { ARCHD last; @@ -199,15 +177,8 @@ cpio_endwr() * 0 if ok, -1 otherwise */ -#ifdef __STDC__ static int rd_nm(register ARCHD *arcn, int nsz) -#else -static int -rd_nm(arcn, nsz) - register ARCHD *arcn; - int nsz; -#endif { /* * do not even try bogus values @@ -236,14 +207,8 @@ rd_nm(arcn, nsz) * 0 if ok, -1 otherwise */ -#ifdef __STDC__ static int rd_ln_nm(register ARCHD *arcn) -#else -static int -rd_ln_nm(arcn) - register ARCHD *arcn; -#endif { /* * check the length specified for bogus values @@ -293,15 +258,8 @@ rd_ln_nm(arcn) * 0 if a valid header, -1 otherwise */ -#ifdef __STDC__ int cpio_id(char *blk, int size) -#else -int -cpio_id(blk, size) - char *blk; - int size; -#endif { if ((size < sizeof(HD_CPIO)) || (strncmp(blk, AMAGIC, sizeof(AMAGIC) - 1) != 0)) @@ -317,15 +275,8 @@ cpio_id(blk, size) * 0 if a valid header, -1 otherwise. */ -#ifdef __STDC__ int cpio_rd(register ARCHD *arcn, register char *buf) -#else -int -cpio_rd(arcn, buf) - register ARCHD *arcn; - register char *buf; -#endif { register int nsz; register HD_CPIO *hd; @@ -400,13 +351,8 @@ cpio_rd(arcn, buf) * size of trailer header in this format */ -#ifdef __STDC__ off_t cpio_endrd(void) -#else -off_t -cpio_endrd() -#endif { return((off_t)(sizeof(HD_CPIO) + sizeof(TRAILER))); } @@ -418,13 +364,8 @@ cpio_endrd() * 0 if ok, -1 otherwise (what dev_start() returns) */ -#ifdef __STDC__ int cpio_stwr(void) -#else -int -cpio_stwr() -#endif { return(dev_start()); } @@ -438,14 +379,8 @@ cpio_stwr() * data to write after the header, -1 if archive write failed */ -#ifdef __STDC__ int cpio_wr(register ARCHD *arcn) -#else -int -cpio_wr(arcn) - register ARCHD *arcn; -#endif { register HD_CPIO *hd; register int nsz; @@ -574,15 +509,8 @@ cpio_wr(arcn) * 0 if a valid header, -1 otherwise */ -#ifdef __STDC__ int vcpio_id(char *blk, int size) -#else -int -vcpio_id(blk, size) - char *blk; - int size; -#endif { if ((size < sizeof(HD_VCPIO)) || (strncmp(blk, AVMAGIC, sizeof(AVMAGIC) - 1) != 0)) @@ -598,15 +526,8 @@ vcpio_id(blk, size) * 0 if a valid header, -1 otherwise */ -#ifdef __STDC__ int crc_id(char *blk, int size) -#else -int -crc_id(blk, size) - char *blk; - int size; -#endif { if ((size < sizeof(HD_VCPIO)) || (strncmp(blk, AVCMAGIC, sizeof(AVCMAGIC) - 1) != 0)) @@ -621,13 +542,8 @@ crc_id(blk, size) * 0 if ok -1 otherwise (the return values of lnk_start()) */ -#ifdef __STDC__ int crc_strd(void) -#else -int -crc_strd() -#endif { docrc = 1; return(lnk_start()); @@ -641,15 +557,8 @@ crc_strd() * 0 if a valid header, -1 otherwise. */ -#ifdef __STDC__ int vcpio_rd(register ARCHD *arcn, register char *buf) -#else -int -vcpio_rd(arcn, buf) - register ARCHD *arcn; - register char *buf; -#endif { register HD_VCPIO *hd; dev_t devminor; @@ -747,13 +656,8 @@ vcpio_rd(arcn, buf) * size of trailer header in this format */ -#ifdef __STDC__ off_t vcpio_endrd(void) -#else -off_t -vcpio_endrd() -#endif { return((off_t)(sizeof(HD_VCPIO) + sizeof(TRAILER) + (VCPIO_PAD(sizeof(HD_VCPIO) + sizeof(TRAILER))))); @@ -766,13 +670,8 @@ vcpio_endrd() * 0 if ok, -1 otherwise (what dev_start() returns) */ -#ifdef __STDC__ int crc_stwr(void) -#else -int -crc_stwr() -#endif { docrc = 1; return(dev_start()); @@ -787,14 +686,8 @@ crc_stwr() * NO data to write after the header, -1 if archive write failed */ -#ifdef __STDC__ int vcpio_wr(register ARCHD *arcn) -#else -int -vcpio_wr(arcn) - register ARCHD *arcn; -#endif { register HD_VCPIO *hd; unsigned int nsz; @@ -950,15 +843,8 @@ vcpio_wr(arcn) * 0 if a valid header, -1 otherwise */ -#ifdef __STDC__ int bcpio_id(char *blk, int size) -#else -int -bcpio_id(blk, size) - char *blk; - int size; -#endif { if (size < sizeof(HD_BCPIO)) return(-1); @@ -985,15 +871,8 @@ bcpio_id(blk, size) * 0 if a valid header, -1 otherwise. */ -#ifdef __STDC__ int bcpio_rd(register ARCHD *arcn, register char *buf) -#else -int -bcpio_rd(arcn, buf) - register ARCHD *arcn; - register char *buf; -#endif { register HD_BCPIO *hd; register int nsz; @@ -1089,13 +968,8 @@ bcpio_rd(arcn, buf) * size of trailer header in this format */ -#ifdef __STDC__ off_t bcpio_endrd(void) -#else -off_t -bcpio_endrd() -#endif { return((off_t)(sizeof(HD_BCPIO) + sizeof(TRAILER) + (BCPIO_PAD(sizeof(HD_BCPIO) + sizeof(TRAILER))))); @@ -1112,14 +986,8 @@ bcpio_endrd() * data to write after the header, -1 if archive write failed */ -#ifdef __STDC__ int bcpio_wr(register ARCHD *arcn) -#else -int -bcpio_wr(arcn) - register ARCHD *arcn; -#endif { register HD_BCPIO *hd; register int nsz; diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c index 7eb304a5f8..69f3f20437 100644 --- a/bin/pax/file_subs.c +++ b/bin/pax/file_subs.c @@ -36,7 +36,7 @@ * * @(#)file_subs.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/bin/pax/file_subs.c,v 1.12.2.1 2001/08/01 05:03:11 obrien Exp $ - * $DragonFly: src/bin/pax/file_subs.c,v 1.3 2003/09/21 04:24:17 drhodus Exp $ + * $DragonFly: src/bin/pax/file_subs.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -72,14 +72,8 @@ mk_link (register char *,register struct stat *,register char *, int); * file descriptor or -1 for failure */ -#ifdef __STDC__ int file_creat(register ARCHD *arcn) -#else -int -file_creat(arcn) - register ARCHD *arcn; -#endif { int fd = -1; mode_t file_mode; @@ -135,15 +129,8 @@ file_creat(arcn) * 0 for success, -1 for failure */ -#ifdef __STDC__ void file_close(register ARCHD *arcn, int fd) -#else -void -file_close(arcn, fd) - register ARCHD *arcn; - int fd; -#endif { int res = 0; @@ -182,14 +169,8 @@ file_close(arcn, fd) * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int lnk_creat(register ARCHD *arcn) -#else -int -lnk_creat(arcn) - register ARCHD *arcn; -#endif { struct stat sb; @@ -222,14 +203,8 @@ lnk_creat(arcn) * 0 if cross_lnk() ok, -1 for fatal flaw (like linking to self). */ -#ifdef __STDC__ int cross_lnk(register ARCHD *arcn) -#else -int -cross_lnk(arcn) - register ARCHD *arcn; -#endif { /* * try to make a link to original file (-l flag in copy mode). make sure @@ -252,14 +227,8 @@ cross_lnk(arcn) * 0 skip it file exists (-k) or may be the same as source file */ -#ifdef __STDC__ int chk_same(register ARCHD *arcn) -#else -int -chk_same(arcn) - register ARCHD *arcn; -#endif { struct stat sb; @@ -295,18 +264,9 @@ chk_same(arcn) * allowed option). -1 an error occurred. */ -#ifdef __STDC__ static int mk_link(register char *to, register struct stat *to_sb, register char *from, int ign) -#else -static int -mk_link(to, to_sb, from, ign) - register char *to; - register struct stat *to_sb; - register char *from; - int ign; -#endif { struct stat sb; int oerrno; @@ -377,14 +337,8 @@ mk_link(to, to_sb, from, ign) * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int node_creat(register ARCHD *arcn) -#else -int -node_creat(arcn) - register ARCHD *arcn; -#endif { register int res; register int ign = 0; @@ -547,15 +501,8 @@ node_creat(arcn) * 1 we found a directory and we were going to create a directory. */ -#ifdef __STDC__ int unlnk_exist(register char *name, register int type) -#else -int -unlnk_exist(name, type) - register char *name; - register int type; -#endif { struct stat sb; @@ -605,16 +552,8 @@ unlnk_exist(name, type) * 0 otherwise */ -#ifdef __STDC__ int chk_path( register char *name, uid_t st_uid, gid_t st_gid) -#else -int -chk_path(name, st_uid, st_gid) - register char *name; - uid_t st_uid; - gid_t st_gid; -#endif { register char *spt = name; struct stat sb; @@ -697,17 +636,8 @@ chk_path(name, st_uid, st_gid) * not set request. */ -#ifdef __STDC__ void set_ftime(char *fnm, time_t mtime, time_t atime, int frc) -#else -void -set_ftime(fnm, mtime, atime, frc) - char *fnm; - time_t mtime; - time_t atime; - int frc; -#endif { static struct timeval tv[2] = {{0L, 0L}, {0L, 0L}}; struct stat sb; @@ -744,16 +674,8 @@ set_ftime(fnm, mtime, atime, frc) * 0 when set, -1 on failure */ -#ifdef __STDC__ int set_ids(char *fnm, uid_t uid, gid_t gid) -#else -int -set_ids(fnm, uid, gid) - char *fnm; - uid_t uid; - gid_t gid; -#endif { if (chown(fnm, uid, gid) < 0) { /* @@ -776,16 +698,8 @@ set_ids(fnm, uid, gid) * 0 when set, -1 on failure */ -#ifdef __STDC__ int set_lids(char *fnm, uid_t uid, gid_t gid) -#else -int -set_lids(fnm, uid, gid) - char *fnm; - uid_t uid; - gid_t gid; -#endif { if (lchown(fnm, uid, gid) < 0) { /* @@ -806,15 +720,8 @@ set_lids(fnm, uid, gid) * Set file access mode */ -#ifdef __STDC__ void set_pmode(char *fnm, mode_t mode) -#else -void -set_pmode(fnm, mode) - char *fnm; - mode_t mode; -#endif { mode &= ABITS; if (chmod(fnm, mode) < 0) @@ -870,21 +777,9 @@ set_pmode(fnm, mode) * number of bytes written, -1 on write (or lseek) error. */ -#ifdef __STDC__ int file_write(int fd, char *str, register int cnt, int *rem, int *isempt, int sz, char *name) -#else -int -file_write(fd, str, cnt, rem, isempt, sz, name) - int fd; - char *str; - register int cnt; - int *rem; - int *isempt; - int sz; - char *name; -#endif { register char *pt; register char *end; @@ -963,16 +858,8 @@ file_write(fd, str, cnt, rem, isempt, sz, name) * write the last BYTE with a zero (back up one byte and write a zero). */ -#ifdef __STDC__ void file_flush(int fd, char *fname, int isempt) -#else -void -file_flush(fd, fname, isempt) - int fd; - char *fname; - int isempt; -#endif { static char blnk[] = "\0"; @@ -1002,15 +889,8 @@ file_flush(fd, fname, isempt) * reset access time (tflag) do so (the times are stored in arcn). */ -#ifdef __STDC__ void rdfile_close(register ARCHD *arcn, register int *fd) -#else -void -rdfile_close(arcn, fd) - register ARCHD *arcn; - register int *fd; -#endif { /* * make sure the file is open @@ -1039,15 +919,8 @@ rdfile_close(arcn, fd) * 0 if was able to calculate the crc, -1 otherwise */ -#ifdef __STDC__ int set_crc(register ARCHD *arcn, register int fd) -#else -int -set_crc(arcn, fd) - register ARCHD *arcn; - register int fd; -#endif { register int i; register int res; diff --git a/bin/pax/ftree.c b/bin/pax/ftree.c index fc32905bc5..45ce09299b 100644 --- a/bin/pax/ftree.c +++ b/bin/pax/ftree.c @@ -36,7 +36,7 @@ * * @(#)ftree.c 8.2 (Berkeley) 4/18/94 * $FreeBSD: src/bin/pax/ftree.c,v 1.13.2.1 2001/08/01 05:03:11 obrien Exp $ - * $DragonFly: src/bin/pax/ftree.c,v 1.3 2003/09/21 04:24:17 drhodus Exp $ + * $DragonFly: src/bin/pax/ftree.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -87,13 +87,8 @@ static int ftree_arg (void); * 0 if there is at least one valid file arg to process, -1 otherwise */ -#ifdef __STDC__ int ftree_start(void) -#else -int -ftree_start() -#endif { /* * set up the operation mode of fts, open the first file arg. We must @@ -146,15 +141,8 @@ ftree_start() * 0 if added to the linked list, -1 if failed */ -#ifdef __STDC__ int ftree_add(register char *str, int chflg) -#else -int -ftree_add(str, chflg) - register char *str; - int chflg; -#endif { register FTREE *ft; register int len; @@ -198,14 +186,8 @@ ftree_add(str, chflg) * -n and -d processing. */ -#ifdef __STDC__ void ftree_sel(register ARCHD *arcn) -#else -void -ftree_sel(arcn) - register ARCHD *arcn; -#endif { /* * set reference bit for this pattern. This linked list is only used @@ -237,13 +219,8 @@ ftree_sel(arcn) * have a selected member (reference count still 0) */ -#ifdef __STDC__ void ftree_chk(void) -#else -void -ftree_chk() -#endif { register FTREE *ft; register int wban = 0; @@ -279,13 +256,8 @@ ftree_chk() * stdin). */ -#ifdef __STDC__ static int ftree_arg(void) -#else -static int -ftree_arg() -#endif { register char *pt; @@ -358,14 +330,8 @@ ftree_arg() * 0 when contents of arcn have been set with the next file, -1 when done. */ -#ifdef __STDC__ int next_file(register ARCHD *arcn) -#else -int -next_file(arcn) - register ARCHD *arcn; -#endif { register int cnt; time_t atime; diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c index e0cbc25b72..c6fb258c8c 100644 --- a/bin/pax/gen_subs.c +++ b/bin/pax/gen_subs.c @@ -36,7 +36,7 @@ * * @(#)gen_subs.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/bin/pax/gen_subs.c,v 1.12.2.4 2002/03/12 17:49:17 phantom Exp $ - * $DragonFly: src/bin/pax/gen_subs.c,v 1.2 2003/06/17 04:22:50 dillon Exp $ + * $DragonFly: src/bin/pax/gen_subs.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -77,16 +77,8 @@ static int d_first = -1; * list the members of an archive in ls format */ -#ifdef __STDC__ void ls_list(register ARCHD *arcn, time_t now, FILE *fp) -#else -void -ls_list(arcn, now, fp) - register ARCHD *arcn; - time_t now; - FILE *fp; -#endif { register struct stat *sbp; char f_mode[MODELEN]; @@ -165,14 +157,8 @@ ls_list(arcn, now, fp) * print a short summary of file to tty. */ -#ifdef __STDC__ void ls_tty(register ARCHD *arcn) -#else -void -ls_tty(arcn) - register ARCHD *arcn; -#endif { char f_date[DATELEN]; char f_mode[MODELEN]; @@ -206,16 +192,8 @@ ls_tty(arcn) * doing a strncpy(), a strlen(), and then a possible memset()) */ -#ifdef __STDC__ int l_strncpy(register char *dest, register char *src, int len) -#else -int -l_strncpy(dest, src, len) - register char *dest; - register char *src; - int len; -#endif { register char *stop; register char *start; @@ -240,16 +218,8 @@ l_strncpy(dest, src, len) * unsigned long value */ -#ifdef __STDC__ u_long asc_ul(register char *str, int len, register int base) -#else -u_long -asc_ul(str, len, base) - register char *str; - int len; - register int base; -#endif { register char *stop; u_long tval = 0; @@ -291,17 +261,8 @@ asc_ul(str, len, base) * NOTE: the string created is NOT TERMINATED. */ -#ifdef __STDC__ int ul_asc(u_long val, register char *str, register int len, register int base) -#else -int -ul_asc(val, str, len, base) - u_long val; - register char *str; - register int len; - register int base; -#endif { register char *pt; u_long digit; @@ -354,16 +315,8 @@ ul_asc(val, str, len, base) * u_quad_t value */ -#ifdef __STDC__ u_quad_t asc_uqd(register char *str, int len, register int base) -#else -u_quad_t -asc_uqd(str, len, base) - register char *str; - int len; - register int base; -#endif { register char *stop; u_quad_t tval = 0; @@ -405,17 +358,8 @@ asc_uqd(str, len, base) * NOTE: the string created is NOT TERMINATED. */ -#ifdef __STDC__ int uqd_asc(u_quad_t val, register char *str, register int len, register int base) -#else -int -uqd_asc(val, str, len, base) - u_quad_t val; - register char *str; - register int len; - register int base; -#endif { register char *pt; u_quad_t digit; diff --git a/bin/pax/getoldopt.c b/bin/pax/getoldopt.c index 46fab8a030..1cc4df59b9 100644 --- a/bin/pax/getoldopt.c +++ b/bin/pax/getoldopt.c @@ -10,7 +10,7 @@ * in the Pubic Domain for your edification and enjoyment. * * $FreeBSD: src/bin/pax/getoldopt.c,v 1.1.2.1 2001/08/01 05:03:11 obrien Exp $ - * $DragonFly: src/bin/pax/getoldopt.c,v 1.2 2003/06/17 04:22:50 dillon Exp $ + * $DragonFly: src/bin/pax/getoldopt.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -18,10 +18,7 @@ #include int -getoldopt(argc, argv, optstring) - int argc; - char **argv; - char *optstring; +getoldopt(int argc, char **argv, char *optstring) { static char *key; /* Points to next keyletter */ static char use_getopt; /* !=0 if argv[1][0] was '-' */ diff --git a/bin/pax/options.c b/bin/pax/options.c index 7721cfadd4..0e07144b40 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -36,7 +36,7 @@ * * @(#)options.c 8.2 (Berkeley) 4/18/94 * $FreeBSD: src/bin/pax/options.c,v 1.13.2.3 2001/08/01 05:03:11 obrien Exp $ - * $DragonFly: src/bin/pax/options.c,v 1.3 2003/09/21 04:24:17 drhodus Exp $ + * $DragonFly: src/bin/pax/options.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -145,15 +145,8 @@ int ford[] = {5, 4, 3, 2, 1, 0, -1 }; * parser */ -#ifdef __STDC__ void options(register int argc, register char **argv) -#else -void -options(argc, argv) - register int argc; - register char **argv; -#endif { /* @@ -181,15 +174,8 @@ options(argc, argv) * the user specified a legal set of flags. If not, complain and exit */ -#ifdef __STDC__ static void pax_options(register int argc, register char **argv) -#else -static void -pax_options(argc, argv) - register int argc; - register char **argv; -#endif { register int c; register int i; @@ -586,15 +572,8 @@ pax_options(argc, argv) * the user specified a legal set of flags. If not, complain and exit */ -#ifdef __STDC__ static void tar_options(register int argc, register char **argv) -#else -static void -tar_options(argc, argv) - register int argc; - register char **argv; -#endif { register int c; int fstdin = 0; @@ -987,8 +966,7 @@ tar_options(argc, argv) } int -mkpath(path) - char *path; +mkpath(char *path) { struct stat sb; register char *slash; @@ -1025,15 +1003,8 @@ mkpath(path) * the user specified a legal set of flags. If not, complain and exit */ -#ifdef __STDC__ static void cpio_options(register int argc, register char **argv) -#else -static void -cpio_options(argc, argv) - register int argc; - register char **argv; -#endif { register int c, i; char *str; @@ -1292,14 +1263,8 @@ cpio_options(argc, argv) * print out those invalid flag sets found to the user */ -#ifdef __STDC__ static void printflg(unsigned int flg) -#else -static void -printflg(flg) - unsigned int flg; -#endif { int nxt; int pos = 0; @@ -1319,15 +1284,8 @@ printflg(flg) * by the user */ -#ifdef __STDC__ static int c_frmt(const void *a, const void *b) -#else -static int -c_frmt(a, b) - void *a; - void *b; -#endif { return(strcmp(((FSUB *)a)->name, ((FSUB *)b)->name)); } @@ -1340,13 +1298,8 @@ c_frmt(a, b) * pointer to next OPLIST entry or NULL (end of list). */ -#ifdef __STDC__ OPLIST * opt_next(void) -#else -OPLIST * -opt_next() -#endif { OPLIST *opt; @@ -1361,13 +1314,8 @@ opt_next() * when the format does not support options. */ -#ifdef __STDC__ int bad_opt(void) -#else -int -bad_opt() -#endif { register OPLIST *opt; @@ -1392,14 +1340,8 @@ bad_opt() * 0 if format in name=value format, -1 if -o is passed junk */ -#ifdef __STDC__ int opt_add(register char *str) -#else -int -opt_add(str) - register char *str; -#endif { register OPLIST *opt; register char *frpt; @@ -1467,14 +1409,8 @@ opt_add(str) * 0 for an error, a positive value o.w. */ -#ifdef __STDC__ static off_t str_offt(char *val) -#else -static off_t -str_offt(val) - char *val; -#endif { char *expr; off_t num, t; @@ -1535,14 +1471,8 @@ str_offt(val) return(num); } -#ifdef __STDC__ char * getline(FILE *f) -#else -char * -getline(f) - FILE *f; -#endif { char *name, *temp; size_t len; @@ -1571,13 +1501,8 @@ getline(f) * 0 */ -#ifdef __STDC__ static int no_op(void) -#else -static int -no_op() -#endif { return(0); } @@ -1587,13 +1512,8 @@ no_op() * print the usage summary to the user */ -#ifdef __STDC__ void pax_usage(void) -#else -void -pax_usage() -#endif { (void)fputs("usage: pax [-cdnvz] [-E limit] [-f archive] ", stderr); (void)fputs("[-s replstr] ... [-U user] ...", stderr); @@ -1626,13 +1546,8 @@ pax_usage() * print the usage summary to the user */ -#ifdef __STDC__ void tar_usage(void) -#else -void -tar_usage() -#endif { (void)fputs("usage: tar [-]{crtux}[-befhjmopqsvwyzHLOPXZ014578] [blocksize] ", stderr); @@ -1646,13 +1561,8 @@ tar_usage() * print the usage summary to the user */ -#ifdef __STDC__ void cpio_usage(void) -#else -void -cpio_usage() -#endif { (void)fputs("usage: cpio -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr); (void)fputs(" [-F archive] < name-list [> archive]\n", stderr); diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c index f123511815..68a04e9d1d 100644 --- a/bin/pax/pat_rep.c +++ b/bin/pax/pat_rep.c @@ -36,7 +36,7 @@ * * @(#)pat_rep.c 8.2 (Berkeley) 4/18/94 * $FreeBSD: src/bin/pax/pat_rep.c,v 1.15.2.1 2001/08/01 05:03:11 obrien Exp $ - * $DragonFly: src/bin/pax/pat_rep.c,v 1.3 2003/09/21 04:24:17 drhodus Exp $ + * $DragonFly: src/bin/pax/pat_rep.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -95,14 +95,8 @@ static int resub (regex_t *, regmatch_t *, char *, char *, char *); * the list of replacement patterns; -1 otherwise. */ -#ifdef __STDC__ int rep_add(register char *str) -#else -int -rep_add(str) - register char *str; -#endif { register char *pt1; register char *pt2; @@ -223,15 +217,8 @@ rep_add(str) * 0 if the pattern was added to the list, -1 otherwise */ -#ifdef __STDC__ int pat_add(char *str, char *chdname) -#else -int -pat_add(str, chdname) - char *str; - char *chdname; -#endif { register PATTERN *pt; @@ -275,13 +262,8 @@ pat_add(str, chdname) * a selected archive member. */ -#ifdef __STDC__ void pat_chk(void) -#else -void -pat_chk() -#endif { register PATTERN *pt; register int wban = 0; @@ -317,14 +299,8 @@ pat_chk() * match, -1 otherwise. */ -#ifdef __STDC__ int pat_sel(register ARCHD *arcn) -#else -int -pat_sel(arcn) - register ARCHD *arcn; -#endif { register PATTERN *pt; register PATTERN **ppt; @@ -442,14 +418,8 @@ pat_sel(arcn) * looking for more members) */ -#ifdef __STDC__ int pat_match(register ARCHD *arcn) -#else -int -pat_match(arcn) - register ARCHD *arcn; -#endif { register PATTERN *pt; @@ -520,16 +490,8 @@ pat_match(arcn) * Note: *pend may be changed to show where the prefix ends. */ -#ifdef __STDC__ static int fn_match(register char *pattern, register char *string, char **pend) -#else -static int -fn_match(pattern, string, pend) - register char *pattern; - register char *string; - char **pend; -#endif { register char c; char test; @@ -601,15 +563,8 @@ fn_match(pattern, string, pend) /* NOTREACHED */ } -#ifdef __STDC__ static char * range_match(register char *pattern, register int test) -#else -static char * -range_match(pattern, test) - register char *pattern; - register int test; -#endif { register char c; register char c2; @@ -651,14 +606,8 @@ range_match(pattern, test) * 0 continue to process file, 1 skip this file, -1 pax is finished */ -#ifdef __STDC__ int mod_name(register ARCHD *arcn) -#else -int -mod_name(arcn) - register ARCHD *arcn; -#endif { register int res = 0; @@ -750,14 +699,8 @@ mod_name(arcn) * 0 process this file, 1 skip this file, -1 we need to exit pax */ -#ifdef __STDC__ static int tty_rename(register ARCHD *arcn) -#else -static int -tty_rename(arcn) - register ARCHD *arcn; -#endif { char tmpname[PAXPATHLEN+2]; int res; @@ -822,16 +765,8 @@ tty_rename(arcn) * 0 if ok, -1 if failure (name too long) */ -#ifdef __STDC__ int set_dest(register ARCHD *arcn, char *dest_dir, int dir_len) -#else -int -set_dest(arcn, dest_dir, dir_len) - register ARCHD *arcn; - char *dest_dir; - int dir_len; -#endif { if (fix_path(arcn->name, &(arcn->nlen), dest_dir, dir_len) < 0) return(-1); @@ -857,17 +792,8 @@ set_dest(arcn, dest_dir, dir_len) * 0 if ok, -1 if the final name is too long */ -#ifdef __STDC__ static int fix_path( char *or_name, int *or_len, char *dir_name, int dir_len) -#else -static int -fix_path(or_name, or_len, dir_name, dir_len) - char *or_name; - int *or_len; - char *dir_name; - int dir_len; -#endif { register char *src; register char *dest; @@ -929,16 +855,8 @@ fix_path(or_name, or_len, dir_name, dir_len) * ended up empty) */ -#ifdef __STDC__ static int rep_name(char *name, int *nlen, int prnt) -#else -static int -rep_name(name, nlen, prnt) - char *name; - int *nlen; - int prnt; -#endif { register REPLACE *pt; register char *inpt; @@ -1103,17 +1021,8 @@ rep_name(name, nlen, prnt) * -1 if error, or the number of characters added to the destination. */ -#ifdef __STDC__ static int resub(regexp *prog, char *src, char *dest, register char *destend) -#else -static int -resub(prog, src, dest, destend) - regexp *prog; - char *src; - char *dest; - register char *destend; -#endif { register char *spt; register char *dpt; @@ -1161,19 +1070,9 @@ resub(prog, src, dest, destend) * -1 if error, or the number of characters added to the destination. */ -#ifdef __STDC__ static int resub(regex_t *rp, register regmatch_t *pm, char *src, char *dest, register char *destend) -#else -static int -resub(rp, pm, src, dest, destend) - regex_t *rp; - register regmatch_t *pm; - char *src; - char *dest; - register char *destend; -#endif { register char *spt; register char *dpt; diff --git a/bin/pax/pax.c b/bin/pax/pax.c index c6d8c3f6c0..f72d71b29a 100644 --- a/bin/pax/pax.c +++ b/bin/pax/pax.c @@ -37,7 +37,7 @@ * @(#) Copyright (c) 1992, 1993 The Regents of the University of California. All rights reserved. * @(#)pax.c 8.2 (Berkeley) 4/18/94 * $FreeBSD: src/bin/pax/pax.c,v 1.13.2.4 2002/11/07 15:29:53 imp Exp $ - * $DragonFly: src/bin/pax/pax.c,v 1.3 2003/09/21 04:24:17 drhodus Exp $ + * $DragonFly: src/bin/pax/pax.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -219,15 +219,8 @@ char *tempbase; /* basename of tempfile to use for mkstemp(3) */ * Return: 0 if ok, 1 otherwise */ -#ifdef __STDC__ int main(int argc, char **argv) -#else -int -main(argc, argv) - int argc; - char **argv; -#endif { char *tmpdir; size_t tdlen; @@ -303,14 +296,8 @@ main(argc, argv) * never.... */ -#ifdef __STDC__ void sig_cleanup(int which_sig) -#else -void -sig_cleanup(which_sig) - int which_sig; -#endif { /* * restore modes and times for any dirs we may have created @@ -336,13 +323,8 @@ sig_cleanup(which_sig) * when dealing with a medium to large sized archives. */ -#ifdef __STDC__ static int gen_init(void) -#else -static int -gen_init() -#endif { struct rlimit reslimit; struct sigaction n_hand; diff --git a/bin/pax/sel_subs.c b/bin/pax/sel_subs.c index eac6d270cd..63a6f397ef 100644 --- a/bin/pax/sel_subs.c +++ b/bin/pax/sel_subs.c @@ -36,7 +36,7 @@ * * @(#)sel_subs.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/bin/pax/sel_subs.c,v 1.11.2.1 2001/08/01 05:03:11 obrien Exp $ - * $DragonFly: src/bin/pax/sel_subs.c,v 1.3 2003/09/21 04:24:17 drhodus Exp $ + * $DragonFly: src/bin/pax/sel_subs.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -74,14 +74,8 @@ static GRPT **grptb = NULL; /* group selection table */ * 0 if this archive member should be processed, 1 if it should be skipped */ -#ifdef __STDC__ int sel_chk(register ARCHD *arcn) -#else -int -sel_chk(arcn) - register ARCHD *arcn; -#endif { if (((usrtb != NULL) && usr_match(arcn)) || ((grptb != NULL) && grp_match(arcn)) || @@ -105,14 +99,8 @@ sel_chk(arcn) * 0 if added ok, -1 otherwise; */ -#ifdef __STDC__ int usr_add(register char *str) -#else -int -usr_add(str) - register char *str; -#endif { register u_int indx; register USRT *pt; @@ -184,14 +172,8 @@ usr_add(str) * 0 if this archive member should be processed, 1 if it should be skipped */ -#ifdef __STDC__ static int usr_match(register ARCHD *arcn) -#else -static int -usr_match(arcn) - register ARCHD *arcn; -#endif { register USRT *pt; @@ -218,14 +200,8 @@ usr_match(arcn) * 0 if added ok, -1 otherwise; */ -#ifdef __STDC__ int grp_add(register char *str) -#else -int -grp_add(str) - register char *str; -#endif { register u_int indx; register GRPT *pt; @@ -297,14 +273,8 @@ grp_add(str) * 0 if this archive member should be processed, 1 if it should be skipped */ -#ifdef __STDC__ static int grp_match(register ARCHD *arcn) -#else -static int -grp_match(arcn) - register ARCHD *arcn; -#endif { register GRPT *pt; @@ -353,14 +323,8 @@ grp_match(arcn) * 0 if the time range was added to the list, -1 otherwise */ -#ifdef __STDC__ int trng_add(register char *str) -#else -int -trng_add(str) - register char *str; -#endif { register TIME_RNG *pt; register char *up_pt = NULL; @@ -499,14 +463,8 @@ trng_add(str) * 0 if this archive member should be processed, 1 if it should be skipped */ -#ifdef __STDC__ static int trng_match(register ARCHD *arcn) -#else -static int -trng_match(arcn) - register ARCHD *arcn; -#endif { register TIME_RNG *pt; @@ -574,15 +532,8 @@ trng_match(arcn) * 0 if converted ok, -1 otherwise */ -#ifdef __STDC__ static int str_sec(register char *str, time_t *tval) -#else -static int -str_sec(str, tval) - register char *str; - time_t *tval; -#endif { register struct tm *lt; register char *dot = NULL; diff --git a/bin/pax/tables.c b/bin/pax/tables.c index ad153b092e..f148d32d02 100644 --- a/bin/pax/tables.c +++ b/bin/pax/tables.c @@ -36,7 +36,7 @@ * * @(#)tables.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/bin/pax/tables.c,v 1.13.2.1 2001/08/01 05:03:12 obrien Exp $ - * $DragonFly: src/bin/pax/tables.c,v 1.3 2003/09/21 04:24:17 drhodus Exp $ + * $DragonFly: src/bin/pax/tables.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -101,13 +101,8 @@ static DEVT *chk_dev (dev_t, int); * 0 if created, -1 if failure */ -#ifdef __STDC__ int lnk_start(void) -#else -int -lnk_start() -#endif { if (ltab != NULL) return(0); @@ -130,14 +125,8 @@ lnk_start() * if found returns 1; if not found returns 0; -1 on error */ -#ifdef __STDC__ int chk_lnk(register ARCHD *arcn) -#else -int -chk_lnk(arcn) - register ARCHD *arcn; -#endif { register HRDLNK *pt; register HRDLNK **ppt; @@ -223,14 +212,8 @@ chk_lnk(arcn) * we do not want to accidently point another file at it later on. */ -#ifdef __STDC__ void purg_lnk(register ARCHD *arcn) -#else -void -purg_lnk(arcn) - register ARCHD *arcn; -#endif { register HRDLNK *pt; register HRDLNK **ppt; @@ -283,13 +266,8 @@ purg_lnk(arcn) * write phase */ -#ifdef __STDC__ void lnk_end(void) -#else -void -lnk_end() -#endif { register int i; register HRDLNK *pt; @@ -348,13 +326,8 @@ lnk_end() * 0 if the table and file was created ok, -1 otherwise */ -#ifdef __STDC__ int ftime_start(void) -#else -int -ftime_start() -#endif { if (ftab != NULL) @@ -391,14 +364,8 @@ ftime_start() * -1 on error */ -#ifdef __STDC__ int chk_ftime(register ARCHD *arcn) -#else -int -chk_ftime(arcn) - register ARCHD *arcn; -#endif { register FTM *pt; register int namelen; @@ -516,13 +483,8 @@ chk_ftime(arcn) * 0 if successful, -1 otherwise */ -#ifdef __STDC__ int name_start(void) -#else -int -name_start() -#endif { if (ntab != NULL) return(0); @@ -542,16 +504,8 @@ name_start() * 0 if added, -1 otherwise */ -#ifdef __STDC__ int add_name(register char *oname, int onamelen, char *nname) -#else -int -add_name(oname, onamelen, nname) - register char *oname; - int onamelen; - char *nname; -#endif { register NAMT *pt; register u_int indx; @@ -618,16 +572,8 @@ add_name(oname, onamelen, nname) * new name (oname is the link to name) */ -#ifdef __STDC__ void sub_name(register char *oname, int *onamelen, size_t onamesize) -#else -void -sub_name(oname, onamelen, onamesize) - register char *oname; - int *onamelen; - size_t onamesize; -#endif { register NAMT *pt; register u_int indx; @@ -710,13 +656,8 @@ sub_name(oname, onamelen, onamesize) * 0 if successful, -1 otherwise */ -#ifdef __STDC__ int dev_start(void) -#else -int -dev_start() -#endif { if (dtab != NULL) return(0); @@ -737,14 +678,8 @@ dev_start() * 0 if added ok, -1 otherwise */ -#ifdef __STDC__ int add_dev(register ARCHD *arcn) -#else -int -add_dev(arcn) - register ARCHD *arcn; -#endif { if (chk_dev(arcn->sb.st_dev, 1) == NULL) return(-1); @@ -764,15 +699,8 @@ add_dev(arcn) * is returned (indicates an error). */ -#ifdef __STDC__ static DEVT * chk_dev(dev_t dev, int add) -#else -static DEVT * -chk_dev(dev, add) - dev_t dev; - int add; -#endif { register DEVT *pt; register u_int indx; @@ -829,16 +757,8 @@ chk_dev(dev, add) * 0 if all ok, -1 otherwise. */ -#ifdef __STDC__ int map_dev(register ARCHD *arcn, u_long dev_mask, u_long ino_mask) -#else -int -map_dev(arcn, dev_mask, ino_mask) - register ARCHD *arcn; - u_long dev_mask; - u_long ino_mask; -#endif { register DEVT *pt; register DLIST *dpt; @@ -979,13 +899,8 @@ map_dev(arcn, dev_mask, ino_mask) * 0 is created ok, -1 otherwise. */ -#ifdef __STDC__ int atdir_start(void) -#else -int -atdir_start() -#endif { if (atab != NULL) return(0); @@ -1004,13 +919,8 @@ atdir_start() * entries are for directories READ by pax */ -#ifdef __STDC__ void atdir_end(void) -#else -void -atdir_end() -#endif { register ATDIR *pt; register int i; @@ -1040,18 +950,8 @@ atdir_end() * and chained by inode number. This is for directories READ by pax */ -#ifdef __STDC__ void add_atdir(char *fname, dev_t dev, ino_t ino, time_t mtime, time_t atime) -#else -void -add_atdir(fname, dev, ino, mtime, atime) - char *fname; - dev_t dev; - ino_t ino; - time_t mtime; - time_t atime; -#endif { register ATDIR *pt; register u_int indx; @@ -1112,17 +1012,8 @@ add_atdir(fname, dev, ino, mtime, atime) * 0 if found, -1 if not found. */ -#ifdef __STDC__ int get_atdir(dev_t dev, ino_t ino, time_t *mtime, time_t *atime) -#else -int -get_atdir(dev, ino, mtime, atime) - dev_t dev; - ino_t ino; - time_t *mtime; - time_t *atime; -#endif { register ATDIR *pt; register ATDIR **ppt; @@ -1196,13 +1087,8 @@ get_atdir(dev, ino, mtime, atime) * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int dir_start(void) -#else -int -dir_start() -#endif { if (dirfd != -1) @@ -1234,17 +1120,8 @@ dir_start() * pax spec) */ -#ifdef __STDC__ void add_dir(char *name, int nlen, struct stat *psb, int frc_mode) -#else -void -add_dir(name, nlen, psb, frc_mode) - char *name; - int nlen; - struct stat *psb; - int frc_mode; -#endif { DIRDATA dblk; @@ -1284,13 +1161,8 @@ add_dir(name, nlen, psb, frc_mode) * by pax */ -#ifdef __STDC__ void proc_dir(void) -#else -void -proc_dir() -#endif { char name[PAXPATHLEN+1]; DIRDATA dblk; @@ -1352,16 +1224,8 @@ proc_dir() * the hash value of the string MOD (%) the table size. */ -#ifdef __STDC__ u_int st_hash(char *name, int len, int tabsz) -#else -u_int -st_hash(name, len, tabsz) - char *name; - int len; - int tabsz; -#endif { register char *pt; register char *dest; diff --git a/bin/pax/tar.c b/bin/pax/tar.c index e28a7982ac..f8bae959e3 100644 --- a/bin/pax/tar.c +++ b/bin/pax/tar.c @@ -36,7 +36,7 @@ * * @(#)tar.c 8.2 (Berkeley) 4/18/94 * $FreeBSD: src/bin/pax/tar.c,v 1.13.2.1 2001/08/01 05:03:12 obrien Exp $ - * $DragonFly: src/bin/pax/tar.c,v 1.3 2003/09/21 04:24:17 drhodus Exp $ + * $DragonFly: src/bin/pax/tar.c,v 1.4 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -74,13 +74,8 @@ static int tar_nodir; /* do not write dirs under old tar */ * 0 if ok, -1 otherwise (what wr_skip returns) */ -#ifdef __STDC__ int tar_endwr(void) -#else -int -tar_endwr() -#endif { return(wr_skip((off_t)(NULLCNT*BLKMULT))); } @@ -92,13 +87,8 @@ tar_endwr() * size of trailer (2 * BLKMULT) */ -#ifdef __STDC__ off_t tar_endrd(void) -#else -off_t -tar_endrd() -#endif { return((off_t)(NULLCNT*BLKMULT)); } @@ -114,16 +104,8 @@ tar_endrd() * could never contain a header. */ -#ifdef __STDC__ int tar_trail(register char *buf, register int in_resync, register int *cnt) -#else -int -tar_trail(buf, in_resync, cnt) - register char *buf; - register int in_resync; - register int *cnt; -#endif { register int i; @@ -165,17 +147,8 @@ tar_trail(buf, in_resync, cnt) * 0 if the number fit into the string, -1 otherwise */ -#ifdef __STDC__ static int ul_oct(u_long val, register char *str, register int len, int term) -#else -static int -ul_oct(val, str, len, term) - u_long val; - register char *str; - register int len; - int term; -#endif { register char *pt; @@ -229,17 +202,8 @@ ul_oct(val, str, len, term) * 0 if the number fit into the string, -1 otherwise */ -#ifdef __STDC__ static int uqd_oct(u_quad_t val, register char *str, register int len, int term) -#else -static int -uqd_oct(val, str, len, term) - u_quad_t val; - register char *str; - register int len; - int term; -#endif { register char *pt; @@ -292,15 +256,8 @@ uqd_oct(val, str, len, term) * unsigned long checksum */ -#ifdef __STDC__ static u_long tar_chksm(register char *blk, register int len) -#else -static u_long -tar_chksm(blk, len) - register char *blk; - register int len; -#endif { register char *stop; register char *pt; @@ -340,15 +297,8 @@ tar_chksm(blk, len) * 0 if a tar header, -1 otherwise */ -#ifdef __STDC__ int tar_id(register char *blk, int size) -#else -int -tar_id(blk, size) - register char *blk; - int size; -#endif { register HD_TAR *hd; register HD_USTAR *uhd; @@ -381,13 +331,8 @@ tar_id(blk, size) * 0 if ok -1 otherwise */ -#ifdef __STDC__ int tar_opt(void) -#else -int -tar_opt() -#endif { OPLIST *opt; @@ -423,15 +368,8 @@ tar_opt() * 0 */ -#ifdef __STDC__ int tar_rd(register ARCHD *arcn, register char *buf) -#else -int -tar_rd(arcn, buf) - register ARCHD *arcn; - register char *buf; -#endif { register HD_TAR *hd; register char *pt; @@ -560,14 +498,8 @@ tar_rd(arcn, buf) * data to write after the header, -1 if archive write failed */ -#ifdef __STDC__ int tar_wr(register ARCHD *arcn) -#else -int -tar_wr(arcn) - register ARCHD *arcn; -#endif { register HD_TAR *hd; int len; @@ -727,13 +659,8 @@ tar_wr(arcn) * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int ustar_strd(void) -#else -int -ustar_strd() -#endif { if ((usrtb_start() < 0) || (grptb_start() < 0)) return(-1); @@ -747,13 +674,8 @@ ustar_strd() * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int ustar_stwr(void) -#else -int -ustar_stwr() -#endif { if ((uidtb_start() < 0) || (gidtb_start() < 0)) return(-1); @@ -768,15 +690,8 @@ ustar_stwr() * 0 if a ustar header, -1 otherwise */ -#ifdef __STDC__ int ustar_id(char *blk, int size) -#else -int -ustar_id(blk, size) - char *blk; - int size; -#endif { register HD_USTAR *hd; @@ -807,15 +722,8 @@ ustar_id(blk, size) * 0 */ -#ifdef __STDC__ int ustar_rd(register ARCHD *arcn, register char *buf) -#else -int -ustar_rd(arcn, buf) - register ARCHD *arcn; - register char *buf; -#endif { register HD_USTAR *hd; register char *dest; @@ -970,14 +878,8 @@ ustar_rd(arcn, buf) * data to write after the header, -1 if archive write failed */ -#ifdef __STDC__ int ustar_wr(register ARCHD *arcn) -#else -int -ustar_wr(arcn) - register ARCHD *arcn; -#endif { register HD_USTAR *hd; register char *pt; @@ -1158,15 +1060,8 @@ ustar_wr(arcn) * the file name is too long */ -#ifdef __STDC__ static char * name_split(register char *name, register int len) -#else -static char * -name_split(name, len) - register char *name; - register int len; -#endif { register char *start; diff --git a/bin/pax/tty_subs.c b/bin/pax/tty_subs.c index a47f1d350a..9eeb5d7b36 100644 --- a/bin/pax/tty_subs.c +++ b/bin/pax/tty_subs.c @@ -36,7 +36,7 @@ * * @(#)tty_subs.c 8.2 (Berkeley) 4/18/94 * $FreeBSD: src/bin/pax/tty_subs.c,v 1.11.2.1 2001/08/01 05:03:12 obrien Exp $ - * $DragonFly: src/bin/pax/tty_subs.c,v 1.2 2003/06/17 04:22:50 dillon Exp $ + * $DragonFly: src/bin/pax/tty_subs.c,v 1.3 2003/09/28 14:39:14 hmp Exp $ */ #include @@ -68,13 +68,8 @@ static FILE *ttyinf = NULL; /* input pointing at control tty */ * open fails, future ops that require user input will get an EOF */ -#ifdef __STDC__ int tty_init(void) -#else -int -tty_init() -#endif { int ttyfd; @@ -100,15 +95,8 @@ tty_init() * if there is no controlling terminal, just return. */ -#ifdef __STDC__ void tty_prnt(const char *fmt, ...) -#else -void -tty_prnt(fmt, va_alist) - const char *fmt; - va_dcl -#endif { va_list ap; # ifdef __STDC__ @@ -131,15 +119,8 @@ tty_prnt(fmt, va_alist) * 0 if data was read, -1 otherwise. */ -#ifdef __STDC__ int tty_read(char *str, int len) -#else -int -tty_read(str, len) - char *str; - int len; -#endif { register char *pt; @@ -161,16 +142,8 @@ tty_read(str, len) * will be non-zero. */ -#ifdef __STDC__ void paxwarn(int set, const char *fmt, ...) -#else -void -paxwarn(set, fmt, va_alist) - int set; - const char *fmt; - va_dcl -#endif { va_list ap; # ifdef __STDC__ @@ -201,17 +174,8 @@ paxwarn(set, fmt, va_alist) * will be non-zero. */ -#ifdef __STDC__ void syswarn(int set, int errnum, const char *fmt, ...) -#else -void -syswarn(set, errnum, fmt, va_alist) - int set; - int errnum; - const char *fmt; - va_dcl -#endif { va_list ap; # ifdef __STDC__ diff --git a/bin/ps/fmt.c b/bin/ps/fmt.c index 07eb9f31fe..38092f32ac 100644 --- a/bin/ps/fmt.c +++ b/bin/ps/fmt.c @@ -32,7 +32,7 @@ * * @(#)fmt.c 8.4 (Berkeley) 4/15/94 * $FreeBSD: src/bin/ps/fmt.c,v 1.14.2.1 2002/03/16 01:15:11 mikeh Exp $ - * $DragonFly: src/bin/ps/fmt.c,v 1.3 2003/09/21 04:24:47 drhodus Exp $ + * $DragonFly: src/bin/ps/fmt.c,v 1.4 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -54,8 +54,7 @@ static char *shquote (char **); * This is a stub until marc does the real one. */ static char * -shquote(argv) - char **argv; +shquote(char **argv) { static long arg_max = -1; long len; @@ -93,8 +92,7 @@ shquote(argv) } static char * -cmdpart(arg0) - char *arg0; +cmdpart(char *arg0) { char *cp; @@ -102,10 +100,7 @@ cmdpart(arg0) } char * -fmt_argv(argv, cmd, maxlen) - char **argv; - char *cmd; - int maxlen; +fmt_argv(char **argv, char *cmd, int maxlen) { int len; char *ap, *cp; diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c index 58327925a9..a15786c303 100644 --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -32,7 +32,7 @@ * * @(#)keyword.c 8.5 (Berkeley) 4/2/94 * $FreeBSD: src/bin/ps/keyword.c,v 1.24.2.3 2002/10/10 20:05:32 jmallett Exp $ - * $DragonFly: src/bin/ps/keyword.c,v 1.7 2003/09/21 04:24:47 drhodus Exp $ + * $DragonFly: src/bin/ps/keyword.c,v 1.8 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -188,7 +188,7 @@ VAR var[] = { }; void -showkey() +showkey(void) { VAR *v; int i; @@ -209,8 +209,7 @@ showkey() } void -parsefmt(p) - char *p; +parsefmt(char *p) { static struct varent *vtail; @@ -243,8 +242,7 @@ parsefmt(p) } static VAR * -findvar(p) - char *p; +findvar(char *p) { VAR *v, key; char *hp; @@ -274,8 +272,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 efff5062a3..19fcf4a78a 100644 --- a/bin/ps/nlist.c +++ b/bin/ps/nlist.c @@ -32,7 +32,7 @@ * * @(#)nlist.c 8.4 (Berkeley) 4/2/94 * $FreeBSD: src/bin/ps/nlist.c,v 1.12.6.2 2001/08/01 05:04:48 obrien Exp $ - * $DragonFly: src/bin/ps/nlist.c,v 1.2 2003/06/17 04:22:50 dillon Exp $ + * $DragonFly: src/bin/ps/nlist.c,v 1.3 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -46,7 +46,7 @@ int mempages; /* number of pages of phys. memory */ int fscale; /* kernel _fscale variable */ int -donlist() +donlist(void) { size_t oldlen; diff --git a/bin/ps/print.c b/bin/ps/print.c index 1c820311c2..5ff25cceed 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -32,7 +32,7 @@ * * @(#)print.c 8.6 (Berkeley) 4/16/94 * $FreeBSD: src/bin/ps/print.c,v 1.36.2.4 2002/11/30 13:00:14 tjr Exp $ - * $DragonFly: src/bin/ps/print.c,v 1.7 2003/07/25 05:28:53 dillon Exp $ + * $DragonFly: src/bin/ps/print.c,v 1.8 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -62,7 +62,7 @@ #include "ps.h" void -printheader() +printheader(void) { VAR *v; struct varent *vent; @@ -92,9 +92,7 @@ printheader() } void -command(k, ve) - KINFO *k; - VARENT *ve; +command(KINFO *k, VARENT *ve) { VAR *v; int left; @@ -148,9 +146,7 @@ command(k, ve) } void -ucomm(k, ve) - KINFO *k; - VARENT *ve; +ucomm(KINFO *k, VARENT *ve) { VAR *v; @@ -159,9 +155,7 @@ ucomm(k, ve) } void -logname(k, ve) - KINFO *k; - VARENT *ve; +logname(KINFO *k, VARENT *ve) { VAR *v; char *s; @@ -171,9 +165,7 @@ logname(k, ve) } void -state(k, ve) - KINFO *k; - VARENT *ve; +state(KINFO *k, VARENT *ve) { struct proc *p; int flag; @@ -243,9 +235,7 @@ state(k, ve) } void -pri(k, ve) - KINFO *k; - VARENT *ve; +pri(KINFO *k, VARENT *ve) { VAR *v; @@ -254,9 +244,7 @@ pri(k, ve) } void -uname(k, ve) - KINFO *k; - VARENT *ve; +uname(KINFO *k, VARENT *ve) { VAR *v; @@ -266,16 +254,13 @@ uname(k, ve) } int -s_uname(k) - KINFO *k; +s_uname(KINFO *k) { return (strlen(user_from_uid(KI_EPROC(k)->e_ucred.cr_uid, 0))); } void -runame(k, ve) - KINFO *k; - VARENT *ve; +runame(KINFO *k, VARENT *ve) { VAR *v; @@ -285,16 +270,13 @@ runame(k, ve) } int -s_runame(k) - KINFO *k; +s_runame(KINFO *k) { return (strlen(user_from_uid(KI_EPROC(k)->e_ucred.cr_ruid, 0))); } void -tdev(k, ve) - KINFO *k; - VARENT *ve; +tdev(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; @@ -312,9 +294,7 @@ tdev(k, ve) } void -tname(k, ve) - KINFO *k; - VARENT *ve; +tname(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; @@ -334,9 +314,7 @@ tname(k, ve) } void -longtname(k, ve) - KINFO *k; - VARENT *ve; +longtname(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; @@ -351,9 +329,7 @@ longtname(k, ve) } void -started(k, ve) - KINFO *k; - VARENT *ve; +started(KINFO *k, VARENT *ve) { VAR *v; static time_t now; @@ -387,9 +363,7 @@ started(k, ve) } void -lstarted(k, ve) - KINFO *k; - VARENT *ve; +lstarted(KINFO *k, VARENT *ve) { VAR *v; time_t then; @@ -406,9 +380,7 @@ lstarted(k, ve) } void -wchan(k, ve) - KINFO *k; - VARENT *ve; +wchan(KINFO *k, VARENT *ve) { VAR *v; @@ -429,9 +401,7 @@ wchan(k, ve) #endif void -vsize(k, ve) - KINFO *k; - VARENT *ve; +vsize(KINFO *k, VARENT *ve) { VAR *v; @@ -441,9 +411,7 @@ vsize(k, ve) } void -rssize(k, ve) - KINFO *k; - VARENT *ve; +rssize(KINFO *k, VARENT *ve) { VAR *v; @@ -454,9 +422,7 @@ rssize(k, ve) } void -p_rssize(k, ve) /* doesn't account for text */ - KINFO *k; - VARENT *ve; +p_rssize(KINFO *k, VARENT *ve) /* doesn't account for text */ { VAR *v; @@ -465,9 +431,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; @@ -511,8 +475,7 @@ cputime(k, ve) } double -getpcpu(k) - KINFO *k; +getpcpu(KINFO *k) { struct proc *p; static int failure; @@ -535,9 +498,7 @@ getpcpu(k) } void -pcpu(k, ve) - KINFO *k; - VARENT *ve; +pcpu(KINFO *k, VARENT *ve) { VAR *v; @@ -546,9 +507,7 @@ pcpu(k, ve) } void -pnice(k, ve) - KINFO *k; - VARENT *ve; +pnice(KINFO *k, VARENT *ve) { VAR *v; int nice; @@ -573,8 +532,7 @@ pnice(k, ve) double -getpmem(k) - KINFO *k; +getpmem(KINFO *k) { static int failure; struct proc *p; @@ -599,9 +557,7 @@ getpmem(k) } void -pmem(k, ve) - KINFO *k; - VARENT *ve; +pmem(KINFO *k, VARENT *ve) { VAR *v; @@ -610,9 +566,7 @@ pmem(k, ve) } void -pagein(k, ve) - KINFO *k; - VARENT *ve; +pagein(KINFO *k, VARENT *ve) { VAR *v; @@ -622,9 +576,7 @@ pagein(k, ve) } void -maxrss(k, ve) - KINFO *k; - VARENT *ve; +maxrss(KINFO *k, VARENT *ve) { VAR *v; @@ -634,9 +586,7 @@ maxrss(k, ve) } void -tsize(k, ve) - KINFO *k; - VARENT *ve; +tsize(KINFO *k, VARENT *ve) { VAR *v; @@ -645,9 +595,7 @@ tsize(k, ve) } void -rtprior(k, ve) - KINFO *k; - VARENT *ve; +rtprior(KINFO *k, VARENT *ve) { VAR *v; struct rtprio *prtp; @@ -681,9 +629,7 @@ rtprior(k, ve) * structures. */ static void -printval(bp, v) - char *bp; - VAR *v; +printval(char *bp, VAR *v) { static char ofmt[32] = "%"; char *fcp, *cp; @@ -729,9 +675,7 @@ printval(bp, v) } void -pvar(k, ve) - KINFO *k; - VARENT *ve; +pvar(KINFO *k, VARENT *ve) { VAR *v; @@ -740,9 +684,7 @@ pvar(k, ve) } void -tvar(k, ve) - KINFO *k; - VARENT *ve; +tvar(KINFO *k, VARENT *ve) { VAR *v; @@ -751,9 +693,7 @@ tvar(k, ve) } void -evar(k, ve) - KINFO *k; - VARENT *ve; +evar(KINFO *k, VARENT *ve) { VAR *v; @@ -762,9 +702,7 @@ evar(k, ve) } void -uvar(k, ve) - KINFO *k; - VARENT *ve; +uvar(KINFO *k, VARENT *ve) { VAR *v; @@ -776,9 +714,7 @@ uvar(k, ve) } void -rvar(k, ve) - KINFO *k; - VARENT *ve; +rvar(KINFO *k, VARENT *ve) { VAR *v; diff --git a/bin/ps/ps.c b/bin/ps/ps.c index c68bb795a8..88db4101fe 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1990, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)ps.c 8.4 (Berkeley) 4/2/94 * $FreeBSD: src/bin/ps/ps.c,v 1.30.2.6 2002/07/04 08:30:37 sobomax Exp $ - * $DragonFly: src/bin/ps/ps.c,v 1.4 2003/09/21 04:24:47 drhodus Exp $ + * $DragonFly: src/bin/ps/ps.c,v 1.5 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -107,9 +107,7 @@ char vfmt[] = "pid state time sl re pagein vsz rss lim tsiz %cpu %mem command"; kvm_t *kd; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct kinfo_proc *kp; struct varent *vent; @@ -438,7 +436,7 @@ getuids(const char *arg, int *nuids) } static void -scanvars() +scanvars(void) { struct varent *vent; VAR *v; @@ -457,8 +455,7 @@ scanvars() } static void -dynsizevars(ki) - KINFO *ki; +dynsizevars(KINFO *ki) { struct varent *vent; VAR *v; @@ -477,7 +474,7 @@ dynsizevars(ki) } static void -sizevars() +sizevars(void) { struct varent *vent; VAR *v; @@ -494,11 +491,8 @@ sizevars() } static char * -fmt(fn, ki, comm, maxlen) - char **(*fn) (kvm_t *, const struct kinfo_proc *, int); - KINFO *ki; - char *comm; - int maxlen; +fmt(char **(*fn) (kvm_t *, const struct kinfo_proc *, int), KINFO *ki, char + *comm, int maxlen) { char *s; @@ -511,8 +505,7 @@ fmt(fn, ki, comm, maxlen) #define UREADOK(ki) (forceuread || (KI_PROC(ki)->p_flag & P_INMEM)) static void -saveuser(ki) - KINFO *ki; +saveuser(KINFO *ki) { struct usave *usp; @@ -554,8 +547,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 + \ @@ -583,8 +575,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; @@ -637,7 +628,7 @@ kludge_oldps_options(s) } static void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n", diff --git a/bin/rmdir/rmdir.c b/bin/rmdir/rmdir.c index 8b5eea6837..cd25c03740 100644 --- a/bin/rmdir/rmdir.c +++ b/bin/rmdir/rmdir.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)rmdir.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/rmdir/rmdir.c,v 1.9.2.2 2001/08/01 05:16:47 obrien Exp $ - * $DragonFly: src/bin/rmdir/rmdir.c,v 1.3 2003/09/21 04:25:36 drhodus Exp $ + * $DragonFly: src/bin/rmdir/rmdir.c,v 1.4 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -48,9 +48,7 @@ int rm_path (char *); void usage (void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, errors; int pflag; @@ -83,8 +81,7 @@ main(argc, argv) } int -rm_path(path) - char *path; +rm_path(char *path) { char *p; @@ -108,7 +105,7 @@ rm_path(path) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: rmdir [-p] directory ...\n"); diff --git a/bin/sleep/sleep.c b/bin/sleep/sleep.c index e06bdf3685..7a05255e42 100644 --- a/bin/sleep/sleep.c +++ b/bin/sleep/sleep.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)sleep.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/sleep/sleep.c,v 1.9.2.1 2001/08/01 05:23:25 obrien Exp $ - * $DragonFly: src/bin/sleep/sleep.c,v 1.3 2003/09/21 04:26:06 drhodus Exp $ + * $DragonFly: src/bin/sleep/sleep.c,v 1.4 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -47,9 +47,7 @@ int main (int, char *[]); void usage (void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct timespec time_to_sleep; long l; @@ -120,7 +118,7 @@ main(argc, argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: sleep seconds\n"); diff --git a/bin/stty/cchar.c b/bin/stty/cchar.c index 281e84871d..4925fd8751 100644 --- a/bin/stty/cchar.c +++ b/bin/stty/cchar.c @@ -32,7 +32,7 @@ * * @(#)cchar.c 8.5 (Berkeley) 4/2/94 * $FreeBSD: src/bin/stty/cchar.c,v 1.9.2.2 2001/07/04 22:40:00 kris Exp $ - * $DragonFly: src/bin/stty/cchar.c,v 1.3 2003/09/21 04:26:26 drhodus Exp $ + * $DragonFly: src/bin/stty/cchar.c,v 1.4 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -86,17 +86,14 @@ struct cchar cchars2[] = { }; static int -c_cchar(a, b) - const void *a, *b; +c_cchar(const void *a, const void *b) { return (strcmp(((const struct cchar *)a)->name, ((const 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 5eea8f8864..ca33b5f236 100644 --- a/bin/stty/gfmt.c +++ b/bin/stty/gfmt.c @@ -32,7 +32,7 @@ * * @(#)gfmt.c 8.6 (Berkeley) 4/2/94 * $FreeBSD: src/bin/stty/gfmt.c,v 1.10.2.2 2001/08/01 05:26:12 obrien Exp $ - * $DragonFly: src/bin/stty/gfmt.c,v 1.3 2003/09/21 04:26:26 drhodus Exp $ + * $DragonFly: src/bin/stty/gfmt.c,v 1.4 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -47,8 +47,7 @@ static void gerr (const char *s); static void -gerr(s) - const char *s; +gerr(const char *s) { if (s) errx(1, "illegal gfmt1 option -- %s", s); @@ -57,10 +56,7 @@ gerr(s) } void -gprint(tp, wp, ldisc) - struct termios *tp; - struct winsize *wp __unused; - int ldisc __unused; +gprint(struct termios *tp, struct winsize *wp __unused, int ldisc __unused) { struct cchar *cp; @@ -74,9 +70,7 @@ gprint(tp, wp, ldisc) } void -gread(tp, s) - struct termios *tp; - char *s; +gread(struct termios *tp, char *s) { struct cchar *cp; char *ep, *p; diff --git a/bin/stty/key.c b/bin/stty/key.c index c584609ef4..0168195fbe 100644 --- a/bin/stty/key.c +++ b/bin/stty/key.c @@ -32,7 +32,7 @@ * * @(#)key.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/stty/key.c,v 1.11.2.2 2001/10/15 13:45:05 dd Exp $ - * $DragonFly: src/bin/stty/key.c,v 1.3 2003/09/21 04:26:26 drhodus Exp $ + * $DragonFly: src/bin/stty/key.c,v 1.4 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -96,17 +96,14 @@ static struct key { }; static int -c_key(a, b) - const void *a, *b; +c_key(const void *a, const void *b) { return (strcmp(((const struct key *)a)->name, ((const 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; @@ -135,15 +132,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) @@ -158,8 +153,7 @@ f_cbreak(ip) } void -f_columns(ip) - struct info *ip; +f_columns(struct info *ip) { ip->win.ws_col = atoi(ip->arg); @@ -167,8 +161,7 @@ f_columns(ip) } void -f_dec(ip) - struct info *ip; +f_dec(struct info *ip) { ip->t.c_cc[VERASE] = (u_char)0177; @@ -181,8 +174,7 @@ f_dec(ip) } void -f_ek(ip) - struct info *ip; +f_ek(struct info *ip) { ip->t.c_cc[VERASE] = CERASE; @@ -191,16 +183,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) { @@ -213,8 +203,7 @@ f_extproc(ip) } void -f_ispeed(ip) - struct info *ip; +f_ispeed(struct info *ip) { cfsetispeed(&ip->t, (speed_t)atoi(ip->arg)); @@ -222,8 +211,7 @@ f_ispeed(ip) } void -f_nl(ip) - struct info *ip; +f_nl(struct info *ip) { if (ip->off) { @@ -237,8 +225,7 @@ f_nl(ip) } void -f_ospeed(ip) - struct info *ip; +f_ospeed(struct info *ip) { cfsetospeed(&ip->t, (speed_t)atoi(ip->arg)); @@ -246,8 +233,7 @@ f_ospeed(ip) } void -f_raw(ip) - struct info *ip; +f_raw(struct info *ip) { if (ip->off) @@ -261,8 +247,7 @@ f_raw(ip) } void -f_rows(ip) - struct info *ip; +f_rows(struct info *ip) { ip->win.ws_row = atoi(ip->arg); @@ -270,8 +255,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); @@ -285,24 +269,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("%lu\n", (u_long)cfgetospeed(&ip->t)); } void -f_tty(ip) - struct info *ip; +f_tty(struct info *ip) { int tmp; diff --git a/bin/stty/modes.c b/bin/stty/modes.c index 0768a30413..92fb08ac48 100644 --- a/bin/stty/modes.c +++ b/bin/stty/modes.c @@ -32,7 +32,7 @@ * * @(#)modes.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/stty/modes.c,v 1.8.2.2 2001/07/04 22:40:00 kris Exp $ - * $DragonFly: src/bin/stty/modes.c,v 1.3 2003/09/21 04:26:26 drhodus Exp $ + * $DragonFly: src/bin/stty/modes.c,v 1.4 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -205,9 +205,7 @@ struct modes omodes[] = { #define CHK(s) (*name == s[0] && !strcmp(name, s)) int -msearch(argvp, ip) - char ***argvp; - struct info *ip; +msearch(char ***argvp, struct info *ip) { struct modes *mp; char *name; diff --git a/bin/stty/print.c b/bin/stty/print.c index 969637b1b8..87d6b0c932 100644 --- a/bin/stty/print.c +++ b/bin/stty/print.c @@ -32,7 +32,7 @@ * * @(#)print.c 8.6 (Berkeley) 4/16/94 * $FreeBSD: src/bin/stty/print.c,v 1.12.2.2 2001/07/04 22:40:00 kris Exp $ - * $DragonFly: src/bin/stty/print.c,v 1.3 2003/09/21 04:26:26 drhodus Exp $ + * $DragonFly: src/bin/stty/print.c,v 1.4 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -51,11 +51,7 @@ static void bput (const char *); static const char *ccval (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) { struct cchar *p; long tmp; @@ -224,8 +220,7 @@ static int col; static const char *label; static void -binit(lb) - const char *lb; +binit(const char *lb) { if (col) { @@ -236,8 +231,7 @@ binit(lb) } static void -bput(s) - const char *s; +bput(const char *s) { if (col == 0) { @@ -253,9 +247,7 @@ bput(s) } static const char * -ccval(p, c) - struct cchar *p; - int c; +ccval(struct cchar *p, int c) { static char buf[5]; char *bp; diff --git a/bin/stty/stty.c b/bin/stty/stty.c index aecf3a6352..d9a048832a 100644 --- a/bin/stty/stty.c +++ b/bin/stty/stty.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1989, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)stty.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/stty/stty.c,v 1.13.2.2 2001/07/04 22:40:00 kris Exp $ - * $DragonFly: src/bin/stty/stty.c,v 1.3 2003/09/21 04:26:26 drhodus Exp $ + * $DragonFly: src/bin/stty/stty.c,v 1.4 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -53,9 +53,7 @@ int main (int, char *[]); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct info i; enum FMT fmt; @@ -151,7 +149,7 @@ args: argc -= optind; } void -usage() +usage(void) { (void)fprintf(stderr, "usage: stty [-a|-e|-g] [-f file] [options]\n"); diff --git a/bin/stty/util.c b/bin/stty/util.c index 5d454e716d..735925a077 100644 --- a/bin/stty/util.c +++ b/bin/stty/util.c @@ -32,7 +32,7 @@ * * @(#)util.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/bin/stty/util.c,v 1.8 1999/08/27 23:15:43 peter Exp $ - * $DragonFly: src/bin/stty/util.c,v 1.2 2003/06/17 04:22:50 dillon Exp $ + * $DragonFly: src/bin/stty/util.c,v 1.3 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -53,7 +53,7 @@ * redirected. */ void -checkredirect() +checkredirect(void) { struct stat sb1, sb2; diff --git a/bin/sync/sync.c b/bin/sync/sync.c index 9773c3dfd8..1e6ab56ef2 100644 --- a/bin/sync/sync.c +++ b/bin/sync/sync.c @@ -33,16 +33,14 @@ * @(#) Copyright (c) 1987, 1993 The Regents of the University of California. All rights reserved. * @(#)sync.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/bin/sync/sync.c,v 1.9.2.2 2001/08/01 05:43:30 obrien Exp $ - * $DragonFly: src/bin/sync/sync.c,v 1.3 2003/09/21 04:26:45 drhodus Exp $ + * $DragonFly: src/bin/sync/sync.c,v 1.4 2003/09/28 14:39:15 hmp Exp $ */ #include #include -int main (void); - int -main() +main(void) { sync(); exit(0); diff --git a/bin/test/test.c b/bin/test/test.c index 7e292739fc..fcbcd9cddf 100644 --- a/bin/test/test.c +++ b/bin/test/test.c @@ -10,7 +10,7 @@ * This program is in the Public Domain. * * $FreeBSD: src/bin/test/test.c,v 1.29.2.7 2002/09/10 09:10:57 maxim Exp $ - * $DragonFly: src/bin/test/test.c,v 1.3 2003/09/21 04:27:16 drhodus Exp $ + * $DragonFly: src/bin/test/test.c,v 1.4 2003/09/28 14:39:15 hmp Exp $ */ #include @@ -190,9 +190,7 @@ static void syntax (const char *, const char *); static enum token t_lex (char *); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { gid_t egid, gid; uid_t euid, uid; @@ -234,9 +232,7 @@ main(argc, argv) } static void -syntax(op, msg) - const char *op; - const char *msg; +syntax(const char *op, const char *msg) { if (op && *op) @@ -246,8 +242,7 @@ syntax(op, msg) } static int -oexpr(n) - enum token n; +oexpr(enum token n) { int res; @@ -261,8 +256,7 @@ oexpr(n) } static int -aexpr(n) - enum token n; +aexpr(enum token n) { int res; @@ -276,8 +270,7 @@ aexpr(n) } static int -nexpr(n) - enum token n; /* token */ +nexpr(enum token n) { if (n == UNOT) return !nexpr(t_lex(nargc > 0 ? (--nargc, *++t_wp) : NULL)); @@ -285,8 +278,7 @@ nexpr(n) } static int -primary(n) - enum token n; +primary(enum token n) { enum token nn; int res; @@ -327,7 +319,7 @@ primary(n) } static int -binop() +binop(void) { const char *opnd1, *opnd2; struct t_op const *op; @@ -373,9 +365,7 @@ binop() } static int -filstat(nm, mode) - char *nm; - enum token mode; +filstat(char *nm, enum token mode) { struct stat s; @@ -428,8 +418,7 @@ filstat(nm, mode) } static enum token -t_lex(s) - char *s; +t_lex(char *s) { struct t_op const *op = ops; @@ -452,7 +441,7 @@ t_lex(s) } static int -isoperand() +isoperand(void) { struct t_op const *op = ops; char *s; @@ -475,8 +464,7 @@ isoperand() /* atoi with error detection */ static int -getn(s) - const char *s; +getn(const char *s) { char *p; long r; @@ -499,8 +487,7 @@ getn(s) /* atoi with error detection and 64 bit range */ static quad_t -getq(s) - const char *s; +getq(const char *s) { char *p; quad_t r; @@ -522,8 +509,7 @@ getq(s) } static int -intcmp (s1, s2) - const char *s1, *s2; +intcmp (const char *s1, const char *s2) { quad_t q1, q2; @@ -541,8 +527,7 @@ intcmp (s1, s2) } static int -newerf (f1, f2) - const char *f1, *f2; +newerf (const char *f1, const char *f2) { struct stat b1, b2; @@ -558,15 +543,13 @@ newerf (f1, f2) } static int -olderf (f1, f2) - const char *f1, *f2; +olderf (const char *f1, const char *f2) { return (newerf(f2, f1)); } static int -equalf (f1, f2) - const char *f1, *f2; +equalf (const char *f1, const char *f2) { struct stat b1, b2; diff --git a/sbin/adjkerntz/adjkerntz.c b/sbin/adjkerntz/adjkerntz.c index 73f707a7aa..c69bead8da 100644 --- a/sbin/adjkerntz/adjkerntz.c +++ b/sbin/adjkerntz/adjkerntz.c @@ -25,7 +25,7 @@ * * @(#)Copyright (C) 1993-1996 by Andrey A. Chernov, Moscow, Russia. All rights reserved. * $FreeBSD: src/sbin/adjkerntz/adjkerntz.c,v 1.25.2.1 2001/07/30 10:38:04 dd Exp $ - * $DragonFly: src/sbin/adjkerntz/adjkerntz.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * $DragonFly: src/sbin/adjkerntz/adjkerntz.c,v 1.3 2003/09/28 14:39:16 hmp Exp $ */ /* @@ -62,16 +62,13 @@ static void fake __P((int)); static void usage __P((void)); static void -fake(unused) - int unused __unused; +fake(int unused __unused) { /* Do nothing. */ } -int main(argc, argv) - int argc; - char **argv; +int main(int argc, char **argv) { struct tm local; struct timeval tv, *stv; @@ -369,7 +366,7 @@ recalculate: } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: adjkerntz -i", diff --git a/sbin/atacontrol/atacontrol.c b/sbin/atacontrol/atacontrol.c index 813265290b..0341e03743 100644 --- a/sbin/atacontrol/atacontrol.c +++ b/sbin/atacontrol/atacontrol.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/atacontrol/atacontrol.c,v 1.11.2.5 2002/08/21 13:18:17 sos Exp $ - * $DragonFly: src/sbin/atacontrol/atacontrol.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * $DragonFly: src/sbin/atacontrol/atacontrol.c,v 1.3 2003/09/28 14:39:16 hmp Exp $ */ #include @@ -81,7 +81,7 @@ str2mode(char *str) void -usage() +usage(void) { fprintf(stderr, "usage: atacontrol channel [args]\n"); exit(1); diff --git a/sbin/atm/atm/atm.c b/sbin/atm/atm/atm.c index 239a743902..67143c39be 100644 --- a/sbin/atm/atm/atm.c +++ b/sbin/atm/atm/atm.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/atm/atm.c,v 1.3.2.1 2000/07/01 06:02:14 ps Exp $ - * @(#) $DragonFly: src/sbin/atm/atm/atm.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * @(#) $DragonFly: src/sbin/atm/atm/atm.c,v 1.3 2003/09/28 14:39:16 hmp Exp $ */ /* @@ -213,9 +213,7 @@ char prefix[128] = ""; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int error; @@ -256,10 +254,7 @@ main(argc, argv) * */ int -do_cmd(descp, argc, argv) - struct cmd *descp; - int argc; - char **argv; +do_cmd(struct cmd *descp, int argc, char **argv) { struct cmd *cmdp = 0; @@ -338,9 +333,7 @@ do_cmd(descp, argc, argv) * */ void -usage(cmdp, pref) - struct cmd *cmdp; - char *pref; +usage(struct cmd *cmdp, char *pref) { fprintf(stderr, "usage: %s command [arg] [arg]...\n", prog); fprintf(stderr, USAGE_STR); @@ -363,10 +356,7 @@ usage(cmdp, pref) * */ void -attach(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +attach(int argc, char **argv, struct cmd *cmdp) { struct atmcfgreq aar; struct proto *prp; @@ -462,10 +452,7 @@ attach(argc, argv, cmdp) * */ void -detach(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +detach(int argc, char **argv, struct cmd *cmdp) { struct atmcfgreq adr; int s; @@ -531,10 +518,7 @@ detach(argc, argv, cmdp) * */ void -pvc_add(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +pvc_add(int argc, char **argv, struct cmd *cmdp) { struct atmaddreq apr; struct atminfreq air; @@ -715,10 +699,7 @@ pvc_add(argc, argv, cmdp) * */ void -arp_add(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +arp_add(int argc, char **argv, struct cmd *cmdp) { int len, s; struct atmaddreq apr; @@ -824,10 +805,7 @@ arp_add(argc, argv, cmdp) * */ void -pvc_dlt(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +pvc_dlt(int argc, char **argv, struct cmd *cmdp) { struct atmdelreq apr; @@ -859,10 +837,7 @@ pvc_dlt(argc, argv, cmdp) * */ void -svc_dlt(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +svc_dlt(int argc, char **argv, struct cmd *cmdp) { struct atmdelreq apr; @@ -892,11 +867,7 @@ svc_dlt(argc, argv, cmdp) * */ void -vcc_dlt(argc, argv, cmdp, apr) - int argc; - char **argv; - struct cmd *cmdp; - struct atmdelreq *apr; +vcc_dlt(int argc, char **argv, struct cmd *cmdp, struct atmdelreq *apr) { char *cp; long v; @@ -983,10 +954,7 @@ vcc_dlt(argc, argv, cmdp, apr) * */ void -arp_dlt(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +arp_dlt(int argc, char **argv, struct cmd *cmdp) { int s; struct atmdelreq apr; @@ -1059,10 +1027,7 @@ arp_dlt(argc, argv, cmdp) * */ void -help(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +help(int argc, char **argv, struct cmd *cmdp) { usage(cmds, ""); } diff --git a/sbin/atm/atm/atm_eni.c b/sbin/atm/atm/atm_eni.c index 65be6e0cf3..a9a6a4cdf7 100644 --- a/sbin/atm/atm/atm_eni.c +++ b/sbin/atm/atm/atm_eni.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/atm/atm_eni.c,v 1.3.2.1 2000/07/01 06:02:14 ps Exp $ - * @(#) $DragonFly: src/sbin/atm/atm/atm_eni.c,v 1.3 2003/08/08 04:18:36 dillon Exp $ + * @(#) $DragonFly: src/sbin/atm/atm/atm_eni.c,v 1.4 2003/09/28 14:39:16 hmp Exp $ */ /* @@ -120,10 +120,7 @@ Errs Errs Errs Errs Errs Errs Errs\n" * */ void -show_eni_stats(intf, argc, argv) - char *intf; - int argc; - char **argv; +show_eni_stats(char *intf, int argc, char **argv) { int buf_len, stats_type; struct atminfreq air; @@ -216,8 +213,7 @@ show_eni_stats(intf, argc, argv) * */ void -print_eni_oc3(vi) - struct air_vinfo_rsp *vi; +print_eni_oc3(struct air_vinfo_rsp *vi) { Eni_stats *stats; @@ -257,8 +253,7 @@ print_eni_oc3(vi) * */ void -print_eni_atm(vi) - struct air_vinfo_rsp *vi; +print_eni_atm(struct air_vinfo_rsp *vi) { Eni_stats *stats; @@ -293,8 +288,7 @@ print_eni_atm(vi) * */ void -print_eni_aal0(vi) - struct air_vinfo_rsp *vi; +print_eni_aal0(struct air_vinfo_rsp *vi) { Eni_stats *stats; @@ -330,8 +324,7 @@ print_eni_aal0(vi) * */ void -print_eni_aal5(vi) - struct air_vinfo_rsp *vi; +print_eni_aal5(struct air_vinfo_rsp *vi) { Eni_stats *stats; @@ -372,8 +365,7 @@ print_eni_aal5(vi) * */ void -print_eni_driver(vi) - struct air_vinfo_rsp *vi; +print_eni_driver(struct air_vinfo_rsp *vi) { Eni_stats *stats; diff --git a/sbin/atm/atm/atm_fore200.c b/sbin/atm/atm/atm_fore200.c index b3ce297c7a..031e28af98 100644 --- a/sbin/atm/atm/atm_fore200.c +++ b/sbin/atm/atm/atm_fore200.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/atm/atm_fore200.c,v 1.3.2.1 2000/07/01 06:02:14 ps Exp $ - * @(#) $DragonFly: src/sbin/atm/atm/atm_fore200.c,v 1.3 2003/08/08 04:18:36 dillon Exp $ + * @(#) $DragonFly: src/sbin/atm/atm/atm_fore200.c,v 1.4 2003/09/28 14:39:16 hmp Exp $ */ /* @@ -133,10 +133,7 @@ Errs Errs Errs Errs Errs Errs Errs\n" * */ void -show_fore200_stats(intf, argc, argv) - char *intf; - int argc; - char **argv; +show_fore200_stats(char *intf, int argc, char **argv) { int buf_len, stats_type; struct air_cfg_rsp *cfg; @@ -280,8 +277,7 @@ show_fore200_stats(intf, argc, argv) * */ void -print_fore200_taxi(vi) - struct air_vinfo_rsp *vi; +print_fore200_taxi(struct air_vinfo_rsp *vi) { Fore_stats *stats; @@ -316,8 +312,7 @@ print_fore200_taxi(vi) * */ void -print_fore200_oc3(vi) - struct air_vinfo_rsp *vi; +print_fore200_oc3(struct air_vinfo_rsp *vi) { Fore_stats *stats; @@ -357,8 +352,7 @@ print_fore200_oc3(vi) * */ void -print_fore200_dev(vi) - struct air_vinfo_rsp *vi; +print_fore200_dev(struct air_vinfo_rsp *vi) { Fore_stats *stats; @@ -397,8 +391,7 @@ print_fore200_dev(vi) * */ void -print_fore200_atm(vi) - struct air_vinfo_rsp *vi; +print_fore200_atm(struct air_vinfo_rsp *vi) { Fore_stats *stats; @@ -437,8 +430,7 @@ print_fore200_atm(vi) * */ void -print_fore200_aal0(vi) - struct air_vinfo_rsp *vi; +print_fore200_aal0(struct air_vinfo_rsp *vi) { Fore_stats *stats; @@ -474,8 +466,7 @@ print_fore200_aal0(vi) * */ void -print_fore200_aal4(vi) - struct air_vinfo_rsp *vi; +print_fore200_aal4(struct air_vinfo_rsp *vi) { Fore_stats *stats; @@ -517,8 +508,7 @@ print_fore200_aal4(vi) * */ void -print_fore200_aal5(vi) - struct air_vinfo_rsp *vi; +print_fore200_aal5(struct air_vinfo_rsp *vi) { Fore_stats *stats; @@ -560,8 +550,7 @@ print_fore200_aal5(vi) * */ void -print_fore200_driver(vi) - struct air_vinfo_rsp *vi; +print_fore200_driver(struct air_vinfo_rsp *vi) { Fore_stats *stats; diff --git a/sbin/atm/atm/atm_inet.c b/sbin/atm/atm/atm_inet.c index 099e1739af..f462f9460d 100644 --- a/sbin/atm/atm/atm_inet.c +++ b/sbin/atm/atm/atm_inet.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/atm/atm_inet.c,v 1.3.2.1 2000/07/01 06:02:14 ps Exp $ - * @(#) $DragonFly: src/sbin/atm/atm/atm_inet.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * @(#) $DragonFly: src/sbin/atm/atm/atm_inet.c,v 1.3 2003/09/28 14:39:16 hmp Exp $ */ /* @@ -74,12 +74,8 @@ * */ void -ip_pvcadd(argc, argv, cmdp, app, intp) - int argc; - char **argv; - struct cmd *cmdp; - struct atmaddreq *app; - struct air_int_rsp *intp; +ip_pvcadd(int argc, char **argv, struct cmd *cmdp, struct atmaddreq *app, + struct air_int_rsp *intp) { char *cp; char nhelp[128]; diff --git a/sbin/atm/atm/atm_print.c b/sbin/atm/atm/atm_print.c index 9950bac1ba..6fdece0391 100644 --- a/sbin/atm/atm/atm_print.c +++ b/sbin/atm/atm/atm_print.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/atm/atm_print.c,v 1.3.2.1 2000/07/01 06:02:14 ps Exp $ - * @(#) $DragonFly: src/sbin/atm/atm/atm_print.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * @(#) $DragonFly: src/sbin/atm/atm/atm_print.c,v 1.3 2003/09/28 14:39:16 hmp Exp $ */ /* @@ -259,8 +259,7 @@ struct state arp_origins[] = { * */ void -print_arp_info(ai) - struct air_arp_rsp *ai; +print_arp_info(struct air_arp_rsp *ai) { int i; char *atm_addr, *ip_addr, *origin; @@ -339,8 +338,7 @@ print_arp_info(ai) * */ void -print_asrv_info(si) - struct air_asrv_rsp *si; +print_asrv_info(struct air_asrv_rsp *si) { int i; char *atm_addr, *state; @@ -410,8 +408,7 @@ print_asrv_info(si) * */ void -print_cfg_info(si) - struct air_cfg_rsp *si; +print_cfg_info(struct air_cfg_rsp *si) { char *adapter, *bus, *media, *vendor; @@ -463,8 +460,7 @@ print_cfg_info(si) * */ void -print_intf_info(ni) - struct air_int_rsp *ni; +print_intf_info(struct air_int_rsp *ni) { int i; char nif_names[(IFNAMSIZ *2)+4]; @@ -544,8 +540,7 @@ print_intf_info(ni) * */ void -print_ip_vcc_info(ai) - struct air_ip_vcc_rsp *ai; +print_ip_vcc_info(struct air_ip_vcc_rsp *ai) { int i; char *ip_addr, *state; diff --git a/sbin/atm/atm/atm_set.c b/sbin/atm/atm/atm_set.c index 274648e197..830ee4f78f 100644 --- a/sbin/atm/atm/atm_set.c +++ b/sbin/atm/atm/atm_set.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/atm/atm_set.c,v 1.3.2.1 2000/07/01 06:02:14 ps Exp $ - * @(#) $DragonFly: src/sbin/atm/atm/atm_set.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * @(#) $DragonFly: src/sbin/atm/atm/atm_set.c,v 1.3 2003/09/28 14:39:16 hmp Exp $ */ /* @@ -72,10 +72,7 @@ * */ void -set_arpserver(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +set_arpserver(int argc, char **argv, struct cmd *cmdp) { int i, len, prefix_len = 0, rc, s; char *intf; @@ -271,10 +268,7 @@ set_arpserver(argc, argv, cmdp) * */ void -set_macaddr(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +set_macaddr(int argc, char **argv, struct cmd *cmdp) { int s; char *intf; @@ -367,10 +361,7 @@ set_macaddr(argc, argv, cmdp) * */ void -set_netif(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +set_netif(int argc, char **argv, struct cmd *cmdp) { struct atmsetreq anr; char str[16]; @@ -455,10 +446,7 @@ set_netif(argc, argv, cmdp) * */ void -set_prefix(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +set_prefix(int argc, char **argv, struct cmd *cmdp) { int s; char *intf; diff --git a/sbin/atm/atm/atm_show.c b/sbin/atm/atm/atm_show.c index 8795f5d240..805d41df04 100644 --- a/sbin/atm/atm/atm_show.c +++ b/sbin/atm/atm/atm_show.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/atm/atm_show.c,v 1.3.2.1 2000/07/01 06:02:14 ps Exp $ - * @(#) $DragonFly: src/sbin/atm/atm/atm_show.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * @(#) $DragonFly: src/sbin/atm/atm/atm_show.c,v 1.3 2003/09/28 14:39:16 hmp Exp $ */ /* @@ -79,10 +79,7 @@ static int arp_compare __P((const void *, const void *)); * */ void -show_arp(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +show_arp(int argc, char **argv, struct cmd *cmdp) { int buf_len, arp_info_len; struct atminfreq air; @@ -177,10 +174,7 @@ show_arp(argc, argv, cmdp) * */ void -show_arpserv(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +show_arpserv(int argc, char **argv, struct cmd *cmdp) { int asrv_info_len, buf_len = sizeof(struct air_asrv_rsp) * 3; struct atminfreq air; @@ -257,10 +251,7 @@ show_arpserv(argc, argv, cmdp) * */ void -show_config(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +show_config(int argc, char **argv, struct cmd *cmdp) { int buf_len = sizeof(struct air_asrv_rsp) * 3; struct atminfreq air; @@ -332,10 +323,7 @@ show_config(argc, argv, cmdp) * */ void -show_intf(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +show_intf(int argc, char **argv, struct cmd *cmdp) { int buf_len = sizeof(struct air_int_rsp) * 3; struct atminfreq air; @@ -407,10 +395,7 @@ show_intf(argc, argv, cmdp) * */ void -show_ip_vcc(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +show_ip_vcc(int argc, char **argv, struct cmd *cmdp) { int buf_len, ip_info_len, rc; char *if_name = (char *)0; @@ -535,10 +520,7 @@ show_ip_vcc(argc, argv, cmdp) * */ void -show_netif(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +show_netif(int argc, char **argv, struct cmd *cmdp) { int buf_len = sizeof(struct air_netif_rsp) * 3; struct atminfreq air; @@ -609,10 +591,7 @@ show_netif(argc, argv, cmdp) * */ void -show_intf_stats(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +show_intf_stats(int argc, char **argv, struct cmd *cmdp) { int buf_len; char intf[IFNAMSIZ]; @@ -739,10 +718,7 @@ show_intf_stats(argc, argv, cmdp) * */ void -show_vcc_stats(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +show_vcc_stats(int argc, char **argv, struct cmd *cmdp) { int vcc_info_len; int vpi = -1, vci = -1; @@ -851,10 +827,7 @@ show_vcc_stats(argc, argv, cmdp) * */ void -show_vcc(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +show_vcc(int argc, char **argv, struct cmd *cmdp) { int vcc_info_len; int vpi = -1, vci = -1, show_pvc = 0, show_svc = 0; @@ -974,10 +947,7 @@ show_vcc(argc, argv, cmdp) * */ void -show_version(argc, argv, cmdp) - int argc; - char **argv; - struct cmd *cmdp; +show_version(int argc, char **argv, struct cmd *cmdp) { int buf_len = sizeof(struct air_version_rsp); struct atminfreq air; @@ -1032,8 +1002,7 @@ show_version(argc, argv, cmdp) * */ static int -vcc_compare(p1, p2) - const void *p1, *p2; +vcc_compare(const void *p1, const void *p2) { int rc; struct air_vcc_rsp *c1, *c2; @@ -1084,8 +1053,7 @@ vcc_compare(p1, p2) * */ static int -ip_vcc_compare(p1, p2) - const void *p1, *p2; +ip_vcc_compare(const void *p1, const void *p2) { int rc; struct air_ip_vcc_rsp *c1, *c2; @@ -1129,8 +1097,7 @@ ip_vcc_compare(p1, p2) * */ static int -arp_compare(p1, p2) - const void *p1, *p2; +arp_compare(const void *p1, const void *p2) { int rc; struct air_arp_rsp *c1, *c2; diff --git a/sbin/atm/atm/atm_subr.c b/sbin/atm/atm/atm_subr.c index fd97b2c74c..749c252a2f 100644 --- a/sbin/atm/atm/atm_subr.c +++ b/sbin/atm/atm/atm_subr.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/atm/atm_subr.c,v 1.3.2.1 2000/07/01 06:02:14 ps Exp $ - * @(#) $DragonFly: src/sbin/atm/atm/atm_subr.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * @(#) $DragonFly: src/sbin/atm/atm/atm_subr.c,v 1.3 2003/09/28 14:39:16 hmp Exp $ */ /* @@ -125,8 +125,7 @@ tbl_ent bus_types[] = { * */ char * -get_vendor(vendor) - int vendor; +get_vendor(int vendor) { int i; @@ -150,8 +149,7 @@ get_vendor(vendor) * */ char * -get_adapter(dev) - int dev; +get_adapter(int dev) { int i; @@ -175,8 +173,7 @@ get_adapter(dev) * */ char * -get_media_type(media) - int media; +get_media_type(int media) { int i; @@ -200,8 +197,7 @@ get_media_type(media) * */ char * -get_bus_type(bus) - int bus; +get_bus_type(int bus) { int i; @@ -227,8 +223,7 @@ get_bus_type(bus) * */ char * -get_adapter_name(intf) - char *intf; +get_adapter_name(char *intf) { int buf_len; struct atminfreq air; @@ -275,8 +270,7 @@ get_adapter_name(intf) * */ char * -format_mac_addr(addr) - Mac_addr *addr; +format_mac_addr(Mac_addr *addr) { static char str[256]; @@ -319,9 +313,7 @@ format_mac_addr(addr) * */ int -parse_ip_prefix(cp, op) - char *cp; - struct in_addr *op; +parse_ip_prefix(char *cp, struct in_addr *op) { int len; char *mp; @@ -423,9 +415,7 @@ parse_ip_prefix(cp, op) * */ int -compress_prefix_list(ipp, ilen) - struct in_addr *ipp; - int ilen; +compress_prefix_list(struct in_addr *ipp, int ilen) { int i, j, n; struct in_addr *ip1, *ip2, *m1, *m2; @@ -534,8 +524,7 @@ compress_prefix_list(ipp, ilen) * */ void -check_netif_name(nif) - char *nif; +check_netif_name(char *nif) { int rc; @@ -595,8 +584,7 @@ check_netif_name(nif) * */ void -sock_error(err) - int err; +sock_error(int err) { fprintf(stderr, "%s: ", prog); diff --git a/sbin/atm/fore_dnld/fore_dnld.c b/sbin/atm/fore_dnld/fore_dnld.c index 84d85f683d..1eeed269a9 100644 --- a/sbin/atm/fore_dnld/fore_dnld.c +++ b/sbin/atm/fore_dnld/fore_dnld.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/fore_dnld/fore_dnld.c,v 1.6.2.2 2000/12/11 01:03:24 obrien Exp $ - * @(#) $DragonFly: src/sbin/atm/fore_dnld/fore_dnld.c,v 1.3 2003/08/08 04:18:36 dillon Exp $ + * @(#) $DragonFly: src/sbin/atm/fore_dnld/fore_dnld.c,v 1.4 2003/09/28 14:39:16 hmp Exp $ */ /* @@ -105,8 +105,7 @@ delay(cnt) } unsigned long -CP_READ ( val ) -unsigned long val; +CP_READ ( unsigned long val ) { if ( endian ) return ( ntohl ( val ) ); @@ -115,8 +114,7 @@ unsigned long val; } unsigned long -CP_WRITE ( val ) -unsigned long val; +CP_WRITE ( unsigned long val ) { if ( endian ) return ( htonl ( val ) ); @@ -134,8 +132,7 @@ unsigned long val; * none */ void -error ( msg ) -char *msg; +error ( char *msg ) { printf ( "%s\n", msg ); exit (1); @@ -151,8 +148,7 @@ char *msg; * c Character from uart */ char -getbyte ( prn ) -int prn; +getbyte ( int prn ) { int c; @@ -193,8 +189,7 @@ int prn; * none Line in global string 'line[]' */ void -getline ( prn ) -int prn; +getline ( int prn ) { char c = '\0'; int i = 0; @@ -228,9 +223,7 @@ int prn; * none */ void -xmit_byte ( c, dn ) -unsigned char c; -int dn; +xmit_byte ( unsigned char c, int dn ) { int val; @@ -260,10 +253,7 @@ int dn; * none */ void -xmit_to_i960 ( line, len, dn ) -char *line; -int len; -int dn; +xmit_to_i960 ( char *line, int len, int dn ) { int i; @@ -281,7 +271,7 @@ int dn; * none */ void -autobaud() +autobaud(void) { if ( strncmp ( line, "Mon960", 6 ) == 0 ) xmit_to_i960 ( "\r\n\r\n\r\n\r\n", 8, 0 ); @@ -298,7 +288,7 @@ autobaud() * */ void -finish ( ret ) +finish ( int ret ) { sgtty.c_lflag |= ( ICANON | ECHO ); sgtty.c_cc[VMIN] = vmin; @@ -318,8 +308,7 @@ finish ( ret ) * */ char * -basename ( path ) - char *path; +basename ( char *path ) { char *fname; @@ -411,8 +400,7 @@ unsigned short crctab[1< @@ -102,9 +102,7 @@ static char *resolve_ccdname __P((char *)); static void usage __P((void)); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int ch, options = 0, action = CCD_CONFIG; @@ -195,10 +193,7 @@ main(argc, argv) } static int -do_single(argc, argv, action) - int argc; - char **argv; - int action; +do_single(int argc, char **argv, int action) { struct ccd_ioctl ccio; char *ccd, *cp, *cp2, **disks; @@ -316,8 +311,7 @@ do_single(argc, argv, action) } static int -do_all(action) - int action; +do_all(int action) { FILE *f; char line[_POSIX2_LINE_MAX]; @@ -381,8 +375,7 @@ do_all(action) } static int -checkdev(path) - char *path; +checkdev(char *path) { struct stat st; @@ -396,9 +389,7 @@ checkdev(path) } static int -pathtounit(path, unitp) - char *path; - int *unitp; +pathtounit(char *path, int *unitp) { struct stat st; int maxpartitions; @@ -418,8 +409,7 @@ pathtounit(path, unitp) } static char * -resolve_ccdname(name) - char *name; +resolve_ccdname(char *name) { char c, *path; size_t len, newlen; @@ -451,10 +441,7 @@ resolve_ccdname(name) } static int -do_io(path, cmd, cciop) - char *path; - u_long cmd; - struct ccd_ioctl *cciop; +do_io(char *path, u_long cmd, struct ccd_ioctl *cciop) { int fd; char *cp; @@ -492,9 +479,7 @@ do_io(path, cmd, cciop) } static int -dump_ccd(argc, argv) - int argc; - char **argv; +dump_ccd(int argc, char **argv) { char errbuf[_POSIX2_LINE_MAX], *ccd, *cp; struct ccd_softc *cs, *kcs; @@ -588,9 +573,7 @@ dump_ccd(argc, argv) } static void -print_ccd_info(cs, kd) - struct ccd_softc *cs; - kvm_t *kd; +print_ccd_info(struct ccd_softc *cs, kvm_t *kd) { static int header_printed = 0; struct ccdcinfo *cip; @@ -643,20 +626,19 @@ print_ccd_info(cs, kd) } static int -getmaxpartitions() +getmaxpartitions(void) { return (MAXPARTITIONS); } static int -getrawpartition() +getrawpartition(void) { return (RAW_PART); } static int -flags_to_val(flags) - char *flags; +flags_to_val(char *flags) { char *cp, *tok; int i, tmp, val = ~CCDF_USERMASK; @@ -714,7 +696,7 @@ flags_to_val(flags) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", "usage: ccdconfig [-cv] ccd ileave [flags] dev [...]", diff --git a/sbin/clri/clri.c b/sbin/clri/clri.c index 0101bd57b6..fc4dfbf616 100644 --- a/sbin/clri/clri.c +++ b/sbin/clri/clri.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1990, 1993 The Regents of the University of California. All rights reserved. * @(#)clri.c 8.2 (Berkeley) 9/23/93 * $FreeBSD: src/sbin/clri/clri.c,v 1.4 1999/08/28 00:12:32 peter Exp $ - * $DragonFly: src/sbin/clri/clri.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/clri/clri.c,v 1.4 2003/09/28 14:39:16 hmp Exp $ */ #include @@ -59,9 +59,7 @@ usage(void) } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register struct fs *sbp; register struct dinode *ip; diff --git a/sbin/dmesg/dmesg.c b/sbin/dmesg/dmesg.c index 0a10cc01fe..6743823eee 100644 --- a/sbin/dmesg/dmesg.c +++ b/sbin/dmesg/dmesg.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)dmesg.c 8.1 (Berkeley) 6/5/93 * $FreeBSD: src/sbin/dmesg/dmesg.c,v 1.11.2.3 2001/08/08 22:32:15 obrien Exp $ - * $DragonFly: src/sbin/dmesg/dmesg.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * $DragonFly: src/sbin/dmesg/dmesg.c,v 1.3 2003/09/28 14:39:16 hmp Exp $ */ #include @@ -62,9 +62,7 @@ void usage __P((void)); kvm_read(kd, addr, &var, sizeof(var)) != sizeof(var) int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, newl, skip; char *p, *ep; @@ -183,7 +181,7 @@ main(argc, argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: dmesg [-a] [-M core] [-N system]\n"); exit(1); diff --git a/sbin/dump/dumprmt.c b/sbin/dump/dumprmt.c index 0146468fc2..c7c32a0265 100644 --- a/sbin/dump/dumprmt.c +++ b/sbin/dump/dumprmt.c @@ -32,7 +32,7 @@ * * @(#)dumprmt.c 8.3 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/dump/dumprmt.c,v 1.14.2.1 2000/07/01 06:31:52 ps Exp $ - * $DragonFly: src/sbin/dump/dumprmt.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/dump/dumprmt.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -91,8 +91,7 @@ extern int dokerberos; extern int ntrec; /* blocking factor on tape */ int -rmthost(host) - char *host; +rmthost(char *host) { rmtpeer = malloc(strlen(host) + 1); @@ -108,7 +107,7 @@ rmthost(host) } static void -rmtconnaborted() +rmtconnaborted(void) { msg("Lost connection to remote host.\n"); if (errfd != -1) { @@ -135,7 +134,7 @@ rmtconnaborted() } void -rmtgetconn() +rmtgetconn(void) { register char *cp; register const char *rmt; @@ -202,8 +201,7 @@ rmtgetconn() } static int -okname(cp0) - char *cp0; +okname(char *cp0) { register char *cp; register int c; @@ -219,9 +217,7 @@ okname(cp0) } int -rmtopen(tape, mode) - char *tape; - int mode; +rmtopen(char *tape, int mode) { char buf[256]; @@ -231,7 +227,7 @@ rmtopen(tape, mode) } void -rmtclose() +rmtclose(void) { if (rmtstate != TS_OPEN) @@ -241,9 +237,7 @@ rmtclose() } int -rmtread(buf, count) - char *buf; - int count; +rmtread(char *buf, int count) { char line[30]; int n, i, cc; @@ -262,9 +256,7 @@ rmtread(buf, count) } int -rmtwrite(buf, count) - char *buf; - int count; +rmtwrite(char *buf, int count) { char line[30]; @@ -275,8 +267,7 @@ rmtwrite(buf, count) } void -rmtwrite0(count) - int count; +rmtwrite0(int count) { char line[30]; @@ -285,24 +276,21 @@ rmtwrite0(count) } void -rmtwrite1(buf, count) - char *buf; - int count; +rmtwrite1(char *buf, int count) { write(rmtape, buf, count); } int -rmtwrite2() +rmtwrite2(void) { return (rmtreply("write")); } int -rmtseek(offset, pos) - int offset, pos; +rmtseek(int offset, int pos) { char line[80]; @@ -313,7 +301,7 @@ rmtseek(offset, pos) struct mtget mts; struct mtget * -rmtstatus() +rmtstatus(void) { register int i; register char *cp; @@ -327,8 +315,7 @@ rmtstatus() } int -rmtioctl(cmd, count) - int cmd, count; +rmtioctl(int cmd, int count) { char buf[256]; @@ -339,8 +326,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)) @@ -349,8 +335,7 @@ rmtcall(cmd, buf) } static int -rmtreply(cmd) - char *cmd; +rmtreply(char *cmd) { register char *cp; char code[30], emsg[BUFSIZ]; @@ -378,7 +363,7 @@ rmtreply(cmd) } int -rmtgetb() +rmtgetb(void) { char c; @@ -389,9 +374,7 @@ rmtgetb() /* Get a line (guaranteed to have a trailing newline). */ void -rmtgets(line, len) - char *line; - int len; +rmtgets(char *line, int len) { register char *cp = line; diff --git a/sbin/dump/itime.c b/sbin/dump/itime.c index 6d46618953..f8440a6dd3 100644 --- a/sbin/dump/itime.c +++ b/sbin/dump/itime.c @@ -32,7 +32,7 @@ * * @(#)itime.c 8.1 (Berkeley) 6/5/93 * $FreeBSD: src/sbin/dump/itime.c,v 1.3.2.1 2001/08/01 06:29:35 obrien Exp $ - * $DragonFly: src/sbin/dump/itime.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/dump/itime.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -75,7 +75,7 @@ static int makedumpdate __P((struct dumpdates *, char *)); static void readdumptimes __P((FILE *)); void -initdumptimes() +initdumptimes(void) { FILE *df; @@ -107,8 +107,7 @@ initdumptimes() } static void -readdumptimes(df) - FILE *df; +readdumptimes(FILE *df) { register int i; register struct dumptime *dtwalk; @@ -134,7 +133,7 @@ readdumptimes(df) } void -getdumptime() +getdumptime(void) { register struct dumpdates *ddp; register int i; @@ -166,7 +165,7 @@ getdumptime() } void -putdumptime() +putdumptime(void) { FILE *df; register struct dumpdates *dtwalk; @@ -222,9 +221,7 @@ putdumptime() } static void -dumprecout(file, what) - FILE *file; - struct dumpdates *what; +dumprecout(FILE *file, struct dumpdates *what) { if (fprintf(file, DUMPOUTFMT, @@ -237,9 +234,7 @@ dumprecout(file, what) int recno; static int -getrecord(df, ddatep) - FILE *df; - struct dumpdates *ddatep; +getrecord(FILE *df, struct dumpdates *ddatep) { char tbuf[BUFSIZ]; @@ -259,9 +254,7 @@ getrecord(df, ddatep) } static int -makedumpdate(ddp, tbuf) - struct dumpdates *ddp; - char *tbuf; +makedumpdate(struct dumpdates *ddp, char *tbuf) { char un_buf[128]; diff --git a/sbin/dump/main.c b/sbin/dump/main.c index 2950b55275..3dac438cb8 100644 --- a/sbin/dump/main.c +++ b/sbin/dump/main.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)main.c 8.6 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/dump/main.c,v 1.20.2.9 2003/01/25 18:54:59 dillon Exp $ - * $DragonFly: src/sbin/dump/main.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/dump/main.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -85,9 +85,7 @@ static void obsolete __P((int *, char **[])); static void usage __P((void)); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct stat sb; register ino_t ino; @@ -504,7 +502,7 @@ main(argc, argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: dump [-0123456789ac" @@ -523,9 +521,7 @@ usage() * range (except that a vmax of 0 means unlimited). */ static long -numarg(meaning, vmin, vmax) - char *meaning; - long vmin, vmax; +numarg(char *meaning, long vmin, long vmax) { char *p; long val; @@ -539,8 +535,7 @@ numarg(meaning, vmin, vmax) } void -sig(signo) - int signo; +sig(int signo) { switch(signo) { case SIGALRM: @@ -566,8 +561,7 @@ sig(signo) } char * -rawname(cp) - char *cp; +rawname(char *cp) { static char rawbuf[MAXPATHLEN]; char *dp; @@ -601,9 +595,7 @@ rawname(cp) * getopt(3) will like. */ static void -obsolete(argcp, argvp) - int *argcp; - char **argvp[]; +obsolete(int *argcp, char ***argvp) { int argc, flags; char *ap, **argv, *flagsp, **nargv, *p; diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c index ee4c8c2ad6..c0da541c9e 100644 --- a/sbin/dump/optr.c +++ b/sbin/dump/optr.c @@ -32,7 +32,7 @@ * * @(#)optr.c 8.2 (Berkeley) 1/6/94 * $FreeBSD: src/sbin/dump/optr.c,v 1.9.2.5 2002/02/23 22:32:51 iedowse Exp $ - * $DragonFly: src/sbin/dump/optr.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * $DragonFly: src/sbin/dump/optr.c,v 1.3 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -72,8 +72,7 @@ static int timeout; static char *attnmessage; /* attention message */ int -query(question) - char *question; +query(char *question) { char replybuffer[64]; int back, errcount; @@ -146,8 +145,7 @@ alarmcatch() * Here if an inquisitive operator interrupts the dump program */ void -interrupt(signo) - int signo; +interrupt(int signo) { msg("Interrupt received.\n"); if (query("Do you want to abort dump?")) @@ -158,8 +156,7 @@ interrupt(signo) * We now use wall(1) to do the actual broadcasting. */ void -broadcast(message) - char *message; +broadcast(char *message) { FILE *fp; char buf[sizeof(_PATH_WALL) + sizeof(OPGRENT) + 3]; @@ -187,7 +184,7 @@ broadcast(message) time_t tschedule = 0; void -timeest() +timeest(void) { double percent; time_t tnow; @@ -215,20 +212,13 @@ timeest() * Schedule a printout of the estimate in the next call to timeest(). */ void -infosch(signal) - int signal; +infosch(int signal) { tschedule = 0; } void -#if __STDC__ msg(const char *fmt, ...) -#else -msg(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; @@ -236,11 +226,7 @@ msg(fmt, va_alist) #ifdef TDEBUG (void) fprintf(stderr, "pid=%d ", getpid()); #endif -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif (void) vfprintf(stderr, fmt, ap); (void) fflush(stdout); (void) fflush(stderr); @@ -249,32 +235,17 @@ msg(fmt, va_alist) } void -#if __STDC__ msgtail(const char *fmt, ...) -#else -msgtail(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; -#if __STDC__ + va_start(ap, fmt); -#else - va_start(ap); -#endif (void) vfprintf(stderr, fmt, ap); va_end(ap); } void -#if __STDC__ quit(const char *fmt, ...) -#else -quit(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; @@ -282,11 +253,7 @@ quit(fmt, va_alist) #ifdef TDEBUG (void) fprintf(stderr, "pid=%d ", getpid()); #endif -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif (void) vfprintf(stderr, fmt, ap); va_end(ap); (void) fflush(stdout); @@ -300,8 +267,7 @@ quit(fmt, va_alist) */ struct fstab * -allocfsent(fs) - register struct fstab *fs; +allocfsent(register struct fstab *fs) { register struct fstab *new; @@ -324,7 +290,7 @@ struct pfstab { static SLIST_HEAD(, pfstab) table; void -getfstab() +getfstab(void) { register struct fstab *fs; register struct pfstab *pf; @@ -355,8 +321,7 @@ getfstab() * The file name can omit the leading '/'. */ struct fstab * -fstabsearch(key) - char *key; +fstabsearch(char *key) { register struct pfstab *pf; register struct fstab *fs; @@ -384,10 +349,11 @@ fstabsearch(key) /* * Tell the operator what to do + * + * char arg: w ==> just what to do; W ==> most recent dumps */ void -lastdump(arg) - char arg; /* w ==> just what to do; W ==> most recent dumps */ +lastdump(int arg) { register int i; register struct fstab *dt; @@ -434,8 +400,7 @@ lastdump(arg) } int -datesort(a1, a2) - const void *a1, *a2; +datesort(const void *a1, const void *a2) { struct dumpdates *d1 = *(struct dumpdates **)a1; struct dumpdates *d2 = *(struct dumpdates **)a2; diff --git a/sbin/dump/pathnames.h b/sbin/dump/pathnames.h index 39bd4c395e..a35f28a264 100644 --- a/sbin/dump/pathnames.h +++ b/sbin/dump/pathnames.h @@ -32,12 +32,14 @@ * * @(#)pathnames.h 8.1 (Berkeley) 6/5/93 # $FreeBSD: src/sbin/dump/pathnames.h,v 1.5.6.2 2001/10/05 15:49:11 ru Exp $ - # $DragonFly: src/sbin/dump/pathnames.h,v 1.2 2003/06/17 04:27:32 dillon Exp $ + # $DragonFly: src/sbin/dump/pathnames.h,v 1.3 2003/09/28 14:39:17 hmp Exp $ */ #include +#ifndef _PATH_DEFTAPE #define _PATH_DEFTAPE "/dev/sa0" +#endif #define _PATH_DTMP "/etc/dtmp" #define _PATH_DUMPDATES "/etc/dumpdates" #define _PATH_LOCK "/tmp/dumplockXXXXXX" diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c index aff2ec7ccd..a851c275d8 100644 --- a/sbin/dump/tape.c +++ b/sbin/dump/tape.c @@ -32,7 +32,7 @@ * * @(#)tape.c 8.4 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/dump/tape.c,v 1.12.2.3 2002/02/23 22:32:51 iedowse Exp $ - * $DragonFly: src/sbin/dump/tape.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/dump/tape.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -124,7 +124,7 @@ static jmp_buf jmpbuf; /* where to jump to if we are ready when the */ /* SIGUSR2 arrives from the previous slave */ int -alloctape() +alloctape(void) { int pgoff = getpagesize() - 1; char *buf; @@ -164,9 +164,7 @@ alloctape() } void -writerec(dp, isspcl) - char *dp; - int isspcl; +writerec(char *dp, int isspcl) { slp->req[trecno].dblk = (daddr_t)0; @@ -185,9 +183,7 @@ writerec(dp, isspcl) } void -dumpblock(blkno, size) - daddr_t blkno; - int size; +dumpblock(daddr_t blkno, int size) { int avail, tpblks, dblkno; @@ -208,8 +204,7 @@ dumpblock(blkno, size) int nogripe = 0; void -tperror(signo) - int signo; +tperror(int signo) { if (pipeout) { @@ -230,15 +225,14 @@ tperror(signo) } void -sigpipe(signo) - int signo; +sigpipe(int signo) { quit("Broken pipe\n"); } static void -flushtape() +flushtape(void) { int i, blks, got; long lastfirstrec; @@ -315,7 +309,7 @@ flushtape() } void -trewind() +trewind(void) { struct stat sb; int f; @@ -373,7 +367,7 @@ trewind() } void -close_rewind() +close_rewind(void) { time_t tstart_changevol, tend_changevol; @@ -396,7 +390,7 @@ close_rewind() } void -rollforward() +rollforward(void) { register struct req *p, *q, *prev; register struct slave *tslp; @@ -511,8 +505,7 @@ rollforward() * everything continues as if nothing had happened. */ void -startnewtape(top) - int top; +startnewtape(int top) { int parentpid; int childpid; @@ -648,8 +641,7 @@ restore_check_point: } void -dumpabort(signo) - int signo; +dumpabort(int signo) { if (master != 0 && master != getpid()) @@ -666,8 +658,7 @@ dumpabort(signo) } void -Exit(status) - int status; +Exit(int status) { #ifdef TDEBUG @@ -680,8 +671,7 @@ Exit(status) * proceed - handler for SIGUSR2, used to synchronize IO between the slaves. */ void -proceed(signo) - int signo; +proceed(int signo) { if (ready) @@ -690,7 +680,7 @@ proceed(signo) } void -enslave() +enslave(void) { int cmd[2]; register int i, j; @@ -734,7 +724,7 @@ enslave() } void -killall() +killall(void) { register int i; @@ -753,9 +743,7 @@ killall() * get the lock back for the next cycle by swapping descriptors. */ static void -doslave(cmd, slave_number) - register int cmd; - int slave_number; +doslave(register int cmd, int slave_number) { register int nread; int nextslave, size, wrote, eot_count; @@ -869,11 +857,7 @@ doslave(cmd, slave_number) * loop until the count is satisfied (or error). */ static int -atomic(func, fd, buf, count) - ssize_t (*func)(); - int fd; - char *buf; - int count; +atomic(ssize_t (*func)(), int fd, char *buf, int count) { int got, need = count; diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c index 5e87a0744f..26f1d9859b 100644 --- a/sbin/dump/traverse.c +++ b/sbin/dump/traverse.c @@ -32,7 +32,7 @@ * * @(#)traverse.c 8.7 (Berkeley) 6/15/95 * $FreeBSD: src/sbin/dump/traverse.c,v 1.10.2.6 2003/04/14 20:10:35 johan Exp $ - * $DragonFly: src/sbin/dump/traverse.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/dump/traverse.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -84,8 +84,7 @@ static int searchdir __P((ino_t ino, daddr_t blkno, long size, long filesize, * hence the estimate may be high. */ long -blockest(dp) - register struct dinode *dp; +blockest(register struct dinode *dp) { long blkest, sizeest; @@ -137,9 +136,7 @@ blockest(dp) * the directories in the filesystem. */ int -mapfiles(maxino, tapesize) - ino_t maxino; - long *tapesize; +mapfiles(ino_t maxino, long *tapesize) { register int mode; register ino_t ino; @@ -194,9 +191,7 @@ mapfiles(maxino, tapesize) * pass using this algorithm. */ int -mapdirs(maxino, tapesize) - ino_t maxino; - long *tapesize; +mapdirs(ino_t maxino, long *tapesize) { register struct dinode *dp; register int i, isdir, nodump; @@ -266,13 +261,8 @@ mapdirs(maxino, tapesize) * require the directory to be dumped. */ static int -dirindir(ino, blkno, ind_level, filesize, tapesize, nodump) - ino_t ino; - daddr_t blkno; - int ind_level; - long *filesize; - long *tapesize; - int nodump; +dirindir(ino_t ino, daddr_t blkno, int ind_level, long *filesize, + long *tapesize, int nodump) { int ret = 0; register int i; @@ -308,13 +298,8 @@ dirindir(ino, blkno, ind_level, filesize, tapesize, nodump) * contains any subdirectories. */ static int -searchdir(ino, blkno, size, filesize, tapesize, nodump) - ino_t ino; - daddr_t blkno; - register long size; - long filesize; - long *tapesize; - int nodump; +searchdir(ino_t ino, daddr_t blkno, register long size, long filesize, + long *tapesize, int nodump) { register struct direct *dp; register struct dinode *ip; @@ -373,9 +358,7 @@ searchdir(ino, blkno, size, filesize, tapesize, nodump) * Dump the contents of an inode to tape. */ void -dumpino(dp, ino) - register struct dinode *dp; - ino_t ino; +dumpino(register struct dinode *dp, ino_t ino) { int ind_level, cnt; fsizeT size; @@ -450,11 +433,7 @@ dumpino(dp, ino) * Read indirect blocks, and pass the data blocks to be dumped. */ static void -dmpindir(ino, blk, ind_level, size) - ino_t ino; - daddr_t blk; - int ind_level; - fsizeT *size; +dmpindir(ino_t ino, daddr_t blk, int ind_level, fsizeT *size) { int i, cnt; daddr_t idblk[MAXNINDIR]; @@ -484,10 +463,7 @@ dmpindir(ino, blk, ind_level, size) * Collect up the data into tape record sized buffers and output them. */ void -blksout(blkp, frags, ino) - daddr_t *blkp; - int frags; - ino_t ino; +blksout(daddr_t *blkp, int frags, ino_t ino) { register daddr_t *bp; int i, j, count, blks, tbperdb; @@ -522,10 +498,7 @@ blksout(blkp, frags, ino) * Dump a map to the tape. */ void -dumpmap(map, type, ino) - char *map; - int type; - ino_t ino; +dumpmap(char *map, int type, ino_t ino) { register int i; char *cp; @@ -541,8 +514,7 @@ dumpmap(map, type, ino) * Write a header record to the dump tape. */ void -writeheader(ino) - ino_t ino; +writeheader(ino_t ino) { register int32_t sum, cnt, *lp; @@ -563,8 +535,7 @@ writeheader(ino) } struct dinode * -getino(inum) - ino_t inum; +getino(ino_t inum) { static daddr_t minino, maxino; static struct dinode inoblock[MAXINOPB]; @@ -589,10 +560,7 @@ int breaderrors = 0; #define BREADEMAX 32 void -bread(blkno, buf, size) - daddr_t blkno; - char *buf; - int size; +bread(daddr_t blkno, char *buf, int size) { int cnt, i; diff --git a/sbin/dump/unctime.c b/sbin/dump/unctime.c index bab67713cc..e2a0c613ec 100644 --- a/sbin/dump/unctime.c +++ b/sbin/dump/unctime.c @@ -32,7 +32,7 @@ * * @(#)unctime.c 8.2 (Berkeley) 6/14/94 * $FreeBSD: src/sbin/dump/unctime.c,v 1.3.2.1 2001/09/19 09:29:39 ru Exp $ - * $DragonFly: src/sbin/dump/unctime.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * $DragonFly: src/sbin/dump/unctime.c,v 1.3 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -46,8 +46,7 @@ time_t -unctime(str) - char *str; +unctime(char *str) { struct tm then; diff --git a/sbin/dumpfs/dumpfs.c b/sbin/dumpfs/dumpfs.c index 1cbf6681af..c36cdba203 100644 --- a/sbin/dumpfs/dumpfs.c +++ b/sbin/dumpfs/dumpfs.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1992, 1993 The Regents of the University of California. All rights reserved. * @(#)dumpfs.c 8.5 (Berkeley) 4/29/95 * $FreeBSD: src/sbin/dumpfs/dumpfs.c,v 1.13.2.1 2001/01/22 18:10:11 iedowse Exp $ - * $DragonFly: src/sbin/dumpfs/dumpfs.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/dumpfs/dumpfs.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -68,9 +68,7 @@ void pbits __P((void *, int)); void usage __P((void)); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register struct fstab *fs; int ch, eval; @@ -96,8 +94,7 @@ main(argc, argv) } int -dumpfs(name) - char *name; +dumpfs(char *name) { ssize_t n; int fd, c, i, j, k, size; @@ -235,9 +232,7 @@ err: if (fd != -1) }; int -dumpcg(name, fd, c) - char *name; - int fd, c; +dumpcg(char *name, int fd, int c) { off_t cur; int i, j; @@ -302,9 +297,7 @@ dumpcg(name, fd, c) }; void -pbits(vp, max) - register void *vp; - int max; +pbits(register void *vp, int max) { register int i; register char *p; @@ -326,7 +319,7 @@ pbits(vp, max) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: dumpfs filesys | device\n"); exit(1); diff --git a/sbin/dumpon/dumpon.c b/sbin/dumpon/dumpon.c index 0028983314..b972529886 100644 --- a/sbin/dumpon/dumpon.c +++ b/sbin/dumpon/dumpon.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)swapon.c 8.1 (Berkeley) 6/5/93 * $FreeBSD: src/sbin/dumpon/dumpon.c,v 1.10.2.2 2001/07/30 10:30:05 dd Exp $ - * $DragonFly: src/sbin/dumpon/dumpon.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * $DragonFly: src/sbin/dumpon/dumpon.c,v 1.3 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -109,7 +109,7 @@ main(int argc, char **argv) } void -usage() +usage(void) { fprintf(stderr, "usage: dumpon [-v] special_file\n" diff --git a/sbin/fsck/dir.c b/sbin/fsck/dir.c index b685e91c57..149f94cca2 100644 --- a/sbin/fsck/dir.c +++ b/sbin/fsck/dir.c @@ -32,7 +32,7 @@ * * @(#)dir.c 8.8 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/dir.c,v 1.15 1999/08/28 00:12:45 peter Exp $ - * $DragonFly: src/sbin/fsck/dir.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/fsck/dir.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -72,7 +72,7 @@ static int mkentry __P((struct inodesc *)); * Propagate connected state through the tree. */ void -propagate() +propagate(void) { register struct inoinfo **inpp, *inp; struct inoinfo **inpend; @@ -98,8 +98,7 @@ propagate() * Scan each entry in a directory block. */ int -dirscan(idesc) - register struct inodesc *idesc; +dirscan(register struct inodesc *idesc) { register struct direct *dp; register struct bufarea *bp; @@ -162,8 +161,7 @@ dirscan(idesc) * get next entry in a directory. */ static struct direct * -fsck_readdir(idesc) - register struct inodesc *idesc; +fsck_readdir(register struct inodesc *idesc) { register struct direct *dp, *ndp; register struct bufarea *bp; @@ -224,9 +222,7 @@ dpok: * This is a superset of the checks made in the kernel. */ static int -dircheck(idesc, dp) - struct inodesc *idesc; - register struct direct *dp; +dircheck(struct inodesc *idesc, register struct direct *dp) { register int size; register char *cp; @@ -267,18 +263,14 @@ dircheck(idesc, dp) } void -direrror(ino, errmesg) - ino_t ino; - char *errmesg; +direrror(ino_t ino, char *errmesg) { fileerror(ino, ino, errmesg); } void -fileerror(cwd, ino, errmesg) - ino_t cwd, ino; - char *errmesg; +fileerror(ino_t cwd, ino_t ino, char *errmesg) { register struct dinode *dp; char pathbuf[MAXPATHLEN + 1]; @@ -300,9 +292,7 @@ fileerror(cwd, ino, errmesg) } void -adjust(idesc, lcnt) - register struct inodesc *idesc; - int lcnt; +adjust(register struct inodesc *idesc, int lcnt) { struct dinode *dp; int saveresolved; @@ -359,8 +349,7 @@ adjust(idesc, lcnt) } static int -mkentry(idesc) - struct inodesc *idesc; +mkentry(struct inodesc *idesc) { register struct direct *dirp = idesc->id_dirp; struct direct newent; @@ -404,8 +393,7 @@ mkentry(idesc) } static int -chgino(idesc) - struct inodesc *idesc; +chgino(struct inodesc *idesc) { register struct direct *dirp = idesc->id_dirp; @@ -420,10 +408,7 @@ chgino(idesc) } int -linkup(orphan, parentdir, name) - ino_t orphan; - ino_t parentdir; - char *name; +linkup(ino_t orphan, ino_t parentdir, char *name) { register struct dinode *dp; int lostdir; @@ -538,10 +523,7 @@ linkup(orphan, parentdir, name) * fix an entry in a directory. */ int -changeino(dir, name, newnum) - ino_t dir; - char *name; - ino_t newnum; +changeino(ino_t dir, char *name, ino_t newnum) { struct inodesc idesc; @@ -559,9 +541,7 @@ changeino(dir, name, newnum) * make an entry in a directory */ int -makeentry(parent, ino, name) - ino_t parent, ino; - char *name; +makeentry(ino_t parent, ino_t ino, char *name) { struct dinode *dp; struct inodesc idesc; @@ -595,9 +575,7 @@ makeentry(parent, ino, name) * Attempt to expand the size of a directory */ static int -expanddir(dp, name) - register struct dinode *dp; - char *name; +expanddir(register struct dinode *dp, char *name) { ufs_daddr_t lastbn, newblk; register struct bufarea *bp; @@ -652,9 +630,7 @@ bad: * allocate a new directory */ ino_t -allocdir(parent, request, mode) - ino_t parent, request; - int mode; +allocdir(ino_t parent, ino_t request, int mode) { ino_t ino; char *cp; @@ -709,8 +685,7 @@ allocdir(parent, request, mode) * free a directory inode */ static void -freedir(ino, parent) - ino_t ino, parent; +freedir(ino_t ino, ino_t parent) { struct dinode *dp; @@ -726,9 +701,7 @@ freedir(ino, parent) * generate a temporary name for the lost+found directory. */ static int -lftempname(bufp, ino) - char *bufp; - ino_t ino; +lftempname(char *bufp, ino_t ino) { register ino_t in; register char *cp; @@ -753,9 +726,7 @@ lftempname(bufp, ino) * Insure that it is held until another is requested. */ static struct bufarea * -getdirblk(blkno, size) - ufs_daddr_t blkno; - long size; +getdirblk(ufs_daddr_t blkno, long size) { if (pdirbp != 0) diff --git a/sbin/fsck/fsutil.c b/sbin/fsck/fsutil.c index 643c5e0df8..feba23498d 100644 --- a/sbin/fsck/fsutil.c +++ b/sbin/fsck/fsutil.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/fsck/fsutil.c,v 1.2.2.1 2001/08/01 05:47:55 obrien Exp $ - * $DragonFly: src/sbin/fsck/fsutil.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * $DragonFly: src/sbin/fsck/fsutil.c,v 1.3 2003/09/28 14:39:17 hmp Exp $ * * $NetBSD: fsutil.c,v 1.7 1998/07/30 17:41:03 thorpej Exp $ */ @@ -68,55 +68,38 @@ extern char *__progname; static void vmsg __P((int, const char *, va_list)); void -setcdevname(cd, pr) - const char *cd; - int pr; +setcdevname(const char *cd, int pr) { dev = cd; preen = pr; } const char * -cdevname() +cdevname(void) { return dev; } int -hotroot() +hotroot(void) { return hot; } /*VARARGS*/ void -#if __STDC__ errexit(const char *fmt, ...) -#else -errexit(va_alist) - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - const char *fmt; - - va_start(ap); - fmt = va_arg(ap, const char *); -#endif (void) vfprintf(stderr, fmt, ap); va_end(ap); exit(8); } static void -vmsg(fatal, fmt, ap) - int fatal; - const char *fmt; - va_list ap; +vmsg(int fatal, const char *fmt, va_list ap) { if (!fatal && preen) (void) printf("%s: ", dev); @@ -136,82 +119,44 @@ vmsg(fatal, fmt, ap) /*VARARGS*/ void -#if __STDC__ pfatal(const char *fmt, ...) -#else -pfatal(va_alist) - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - const char *fmt; - - va_start(ap); - fmt = va_arg(ap, const char *); -#endif vmsg(1, fmt, ap); va_end(ap); } /*VARARGS*/ void -#if __STDC__ pwarn(const char *fmt, ...) -#else -pwarn(va_alist) - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - const char *fmt; - - va_start(ap); - fmt = va_arg(ap, const char *); -#endif vmsg(0, fmt, ap); va_end(ap); } void -perror(s) - const char *s; +perror(const char *s) { pfatal("%s (%s)", s, strerror(errno)); } void -#if __STDC__ panic(const char *fmt, ...) -#else -panic(va_alist) - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - const char *fmt; - - va_start(ap); - fmt = va_arg(ap, const char *); -#endif vmsg(1, fmt, ap); va_end(ap); exit(8); } const char * -unrawname(name) - const char *name; +unrawname(const char *name) { static char unrawbuf[32]; const char *dp; @@ -230,8 +175,7 @@ unrawname(name) } const char * -rawname(name) - const char *name; +rawname(const char *name) { static char rawbuf[32]; const char *dp; @@ -243,8 +187,7 @@ rawname(name) } const char * -devcheck(origname) - const char *origname; +devcheck(const char *origname) { struct stat stslash, stchar; @@ -269,8 +212,7 @@ devcheck(origname) * Get the mount point information for name. */ struct statfs * -getmntpt(name) - const char *name; +getmntpt(const char *name) { struct stat devstat, mntdevstat; char device[sizeof(_PATH_DEV) - 1 + MNAMELEN]; @@ -312,8 +254,7 @@ getmntpt(name) * don't have blockdevs. I don't think its needed. */ const char * -blockcheck(origname) - const char *origname; +blockcheck(const char *origname) { struct stat stslash, stblock, stchar; const char *newname, *raw; @@ -367,8 +308,7 @@ retry: void * -emalloc(s) - size_t s; +emalloc(size_t s) { void *p; @@ -380,9 +320,7 @@ emalloc(s) void * -erealloc(p, s) - void *p; - size_t s; +erealloc(void *p, size_t s) { void *q; @@ -394,8 +332,7 @@ erealloc(p, s) char * -estrdup(s) - const char *s; +estrdup(const char *s) { char *p; diff --git a/sbin/fsck/inode.c b/sbin/fsck/inode.c index b07c7ac63d..2ebf3685ee 100644 --- a/sbin/fsck/inode.c +++ b/sbin/fsck/inode.c @@ -32,7 +32,7 @@ * * @(#)inode.c 8.8 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/inode.c,v 1.20 2000/02/28 20:02:41 mckusick Exp $ - * $DragonFly: src/sbin/fsck/inode.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/fsck/inode.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -53,9 +53,7 @@ static ino_t startinum; static int iblock __P((struct inodesc *, long ilevel, quad_t isize)); int -ckinode(dp, idesc) - struct dinode *dp; - register struct inodesc *idesc; +ckinode(struct dinode *dp, register struct inodesc *idesc) { ufs_daddr_t *ap; int ret; @@ -144,10 +142,7 @@ ckinode(dp, idesc) } static int -iblock(idesc, ilevel, isize) - struct inodesc *idesc; - long ilevel; - quad_t isize; +iblock(struct inodesc *idesc, long ilevel, quad_t isize) { ufs_daddr_t *ap; ufs_daddr_t *aplim; @@ -230,9 +225,7 @@ iblock(idesc, ilevel, isize) * Return 0 if in range, 1 if out of range. */ int -chkrange(blk, cnt) - ufs_daddr_t blk; - int cnt; +chkrange(ufs_daddr_t blk, int cnt) { register int c; @@ -276,8 +269,7 @@ chkrange(blk, cnt) * General purpose interface for reading inodes. */ struct dinode * -ginode(inumber) - ino_t inumber; +ginode(ino_t inumber) { ufs_daddr_t iblk; @@ -303,8 +295,7 @@ long readcnt, readpercg, fullcnt, inobufsize, partialcnt, partialsize; struct dinode *inodebuf; struct dinode * -getnextinode(inumber) - ino_t inumber; +getnextinode(ino_t inumber) { long size; ufs_daddr_t dblk; @@ -333,8 +324,7 @@ getnextinode(inumber) } void -setinodebuf(inum) - ino_t inum; +setinodebuf(ino_t inum) { if (inum % sblock.fs_ipg != 0) @@ -361,7 +351,7 @@ setinodebuf(inum) } void -freeinodebuf() +freeinodebuf(void) { if (inodebuf != NULL) @@ -377,9 +367,7 @@ freeinodebuf() * Enter inodes into the cache. */ void -cacheino(dp, inumber) - register struct dinode *dp; - ino_t inumber; +cacheino(register struct dinode *dp, ino_t inumber) { register struct inoinfo *inp; struct inoinfo **inpp; @@ -415,8 +403,7 @@ cacheino(dp, inumber) * Look up an inode cache structure. */ struct inoinfo * -getinoinfo(inumber) - ino_t inumber; +getinoinfo(ino_t inumber) { register struct inoinfo *inp; @@ -433,7 +420,7 @@ getinoinfo(inumber) * Clean up all the inode cache structure. */ void -inocleanup() +inocleanup(void) { register struct inoinfo **inpp; @@ -447,17 +434,14 @@ inocleanup() } void -inodirty() +inodirty(void) { dirty(pbp); } void -clri(idesc, type, flag) - register struct inodesc *idesc; - char *type; - int flag; +clri(register struct inodesc *idesc, char *type, int flag) { register struct dinode *dp; @@ -479,8 +463,7 @@ clri(idesc, type, flag) } int -findname(idesc) - struct inodesc *idesc; +findname(struct inodesc *idesc) { register struct direct *dirp = idesc->id_dirp; @@ -493,8 +476,7 @@ findname(idesc) } int -findino(idesc) - struct inodesc *idesc; +findino(struct inodesc *idesc) { register struct direct *dirp = idesc->id_dirp; @@ -509,8 +491,7 @@ findino(idesc) } int -clearentry(idesc) - struct inodesc *idesc; +clearentry(struct inodesc *idesc) { register struct direct *dirp = idesc->id_dirp; @@ -523,8 +504,7 @@ clearentry(idesc) } void -pinode(ino) - ino_t ino; +pinode(ino_t ino) { register struct dinode *dp; register char *p; @@ -550,10 +530,7 @@ pinode(ino) } void -blkerror(ino, type, blk) - ino_t ino; - char *type; - ufs_daddr_t blk; +blkerror(ino_t ino, char *type, ufs_daddr_t blk) { pfatal("%ld %s I=%lu", blk, type, ino); @@ -582,9 +559,7 @@ blkerror(ino, type, blk) * allocate an unused inode */ ino_t -allocino(request, type) - ino_t request; - int type; +allocino(ino_t request, int type) { register ino_t ino; register struct dinode *dp; @@ -643,8 +618,7 @@ allocino(request, type) * deallocate an inode */ void -freeino(ino) - ino_t ino; +freeino(ino_t ino) { struct inodesc idesc; struct dinode *dp; diff --git a/sbin/fsck/main.c b/sbin/fsck/main.c index 8fc6911662..7aa410dc10 100644 --- a/sbin/fsck/main.c +++ b/sbin/fsck/main.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1986, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.6 (Berkeley) 5/14/95 * $FreeBSD: src/sbin/fsck/main.c,v 1.21.2.1 2001/01/23 23:11:07 iedowse Exp $ - * $DragonFly: src/sbin/fsck/main.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/fsck/main.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -61,9 +61,7 @@ static struct statfs *getmntpt __P((const char *)); int main __P((int argc, char *argv[])); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch; int ret, maxrun = 0; @@ -154,10 +152,7 @@ main(argc, argv) } static int -argtoi(flag, req, str, base) - int flag; - char *req, *str; - int base; +argtoi(int flag, char *req, char *str, int base) { char *cp; int ret; @@ -172,8 +167,7 @@ argtoi(flag, req, str, base) * Determine whether a filesystem should be checked. */ static int -docheck(fsp) - register struct fstab *fsp; +docheck(register struct fstab *fsp) { if (strcmp(fsp->fs_vfstype, "ufs") || @@ -189,10 +183,7 @@ docheck(fsp) */ /* ARGSUSED */ static int -checkfilesys(filesys, mntpt, auxdata, child) - char *filesys, *mntpt; - long auxdata; - int child; +checkfilesys(char *filesys, char *mntpt, long auxdata, int child) { ufs_daddr_t n_ffree, n_bfree; struct dups *dp; @@ -380,8 +371,7 @@ checkfilesys(filesys, mntpt, auxdata, child) * Get the directory that the device is mounted on. */ static struct statfs * -getmntpt(name) - const char *name; +getmntpt(const char *name) { struct stat devstat, mntdevstat; char device[sizeof(_PATH_DEV) - 1 + MNAMELEN]; diff --git a/sbin/fsck/pass1.c b/sbin/fsck/pass1.c index 2dddb3767a..f324b19c93 100644 --- a/sbin/fsck/pass1.c +++ b/sbin/fsck/pass1.c @@ -32,7 +32,7 @@ * * @(#)pass1.c 8.6 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/pass1.c,v 1.16.2.5 2002/06/23 22:34:58 iedowse Exp $ - * $DragonFly: src/sbin/fsck/pass1.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/fsck/pass1.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -53,7 +53,7 @@ static ino_t lastino; /* last inode in use */ static void checkinode __P((ino_t inumber, struct inodesc *)); void -pass1() +pass1(void) { u_int8_t *cp; ino_t inumber; @@ -348,8 +348,7 @@ unknown: } int -pass1check(idesc) - register struct inodesc *idesc; +pass1check(register struct inodesc *idesc) { int res = KEEPON; int anyout, nfrags; diff --git a/sbin/fsck/pass1b.c b/sbin/fsck/pass1b.c index 65c92a9703..40ef7a6da1 100644 --- a/sbin/fsck/pass1b.c +++ b/sbin/fsck/pass1b.c @@ -32,7 +32,7 @@ * * @(#)pass1b.c 8.4 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/pass1b.c,v 1.7.2.1 2001/01/23 23:11:07 iedowse Exp $ - * $DragonFly: src/sbin/fsck/pass1b.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/fsck/pass1b.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -48,7 +48,7 @@ static struct dups *duphead; static int pass1bcheck __P((struct inodesc *)); void -pass1b() +pass1b(void) { register int c, i; register struct dinode *dp; @@ -82,8 +82,7 @@ pass1b() } static int -pass1bcheck(idesc) - register struct inodesc *idesc; +pass1bcheck(register struct inodesc *idesc) { register struct dups *dlp; int nfrags, res = KEEPON; diff --git a/sbin/fsck/pass2.c b/sbin/fsck/pass2.c index 86f58c2c71..312f480d49 100644 --- a/sbin/fsck/pass2.c +++ b/sbin/fsck/pass2.c @@ -32,7 +32,7 @@ * * @(#)pass2.c 8.9 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/pass2.c,v 1.10.2.2 2001/11/24 15:14:59 iedowse Exp $ - * $DragonFly: src/sbin/fsck/pass2.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/fsck/pass2.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -51,7 +51,7 @@ static int blksort __P((const void *, const void *)); static int pass2check __P((struct inodesc *)); void -pass2() +pass2(void) { register struct dinode *dp; register struct inoinfo **inpp, *inp; @@ -215,8 +215,7 @@ pass2() } static int -pass2check(idesc) - struct inodesc *idesc; +pass2check(struct inodesc *idesc) { register struct direct *dirp = idesc->id_dirp; register struct inoinfo *inp; @@ -481,8 +480,7 @@ again: * Routine to sort disk blocks. */ static int -blksort(arg1, arg2) - const void *arg1, *arg2; +blksort(const void *arg1, const void *arg2) { return ((*(struct inoinfo **)arg1)->i_blks[0] - diff --git a/sbin/fsck/pass3.c b/sbin/fsck/pass3.c index 6d08a320b3..d475029c5e 100644 --- a/sbin/fsck/pass3.c +++ b/sbin/fsck/pass3.c @@ -32,7 +32,7 @@ * * @(#)pass3.c 8.2 (Berkeley) 4/27/95 * $FreeBSD: src/sbin/fsck/pass3.c,v 1.7.2.1 2001/01/23 23:11:07 iedowse Exp $ - * $DragonFly: src/sbin/fsck/pass3.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/fsck/pass3.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -46,7 +46,7 @@ #include "fsck.h" void -pass3() +pass3(void) { struct inoinfo *inp; int loopcnt, inpindex, state; diff --git a/sbin/fsck/pass4.c b/sbin/fsck/pass4.c index 1d536fe913..a6041dc903 100644 --- a/sbin/fsck/pass4.c +++ b/sbin/fsck/pass4.c @@ -32,7 +32,7 @@ * * @(#)pass4.c 8.4 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/pass4.c,v 1.7.2.1 2001/01/23 23:11:07 iedowse Exp $ - * $DragonFly: src/sbin/fsck/pass4.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/fsck/pass4.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -46,7 +46,7 @@ #include "fsck.h" void -pass4() +pass4(void) { register ino_t inumber; register struct zlncnt *zlnp; @@ -117,8 +117,7 @@ pass4() } int -pass4check(idesc) - register struct inodesc *idesc; +pass4check(register struct inodesc *idesc) { register struct dups *dlp; int nfrags, res = KEEPON; diff --git a/sbin/fsck/pass5.c b/sbin/fsck/pass5.c index 9146d61abf..f85a84ec79 100644 --- a/sbin/fsck/pass5.c +++ b/sbin/fsck/pass5.c @@ -32,7 +32,7 @@ * * @(#)pass5.c 8.9 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/pass5.c,v 1.17.2.2 2002/11/26 04:46:59 julian Exp $ - * $DragonFly: src/sbin/fsck/pass5.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/fsck/pass5.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -46,7 +46,7 @@ #include "fsck.h" void -pass5() +pass5(void) { int c, blk, frags, basesize, sumsize, mapsize, savednrpos = 0; int inomapsize, blkmapsize; diff --git a/sbin/fsck/preen.c b/sbin/fsck/preen.c index 9864bf2d34..2a8fd56a53 100644 --- a/sbin/fsck/preen.c +++ b/sbin/fsck/preen.c @@ -32,7 +32,7 @@ * * @(#)preen.c 8.5 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/preen.c,v 1.16 1999/12/30 16:32:40 peter Exp $ - * $DragonFly: src/sbin/fsck/preen.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/fsck/preen.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -70,11 +70,8 @@ static int startdisk __P((struct disk *dk, int (*checkit)(char *, char *, long, int))); int -checkfstab(preen, maxrun, docheck, chkit) - int preen; - int maxrun; - int (*docheck)(struct fstab *); - int (*chkit)(char *, char *, long, int); +checkfstab(int preen, int maxrun, int (*docheck)(struct fstab *), + int (*chkit)(char *, char *, long, int)) { register struct fstab *fsp; register struct disk *dk, *nextdisk; @@ -197,8 +194,7 @@ checkfstab(preen, maxrun, docheck, chkit) } static struct disk * -finddisk(name) - char *name; +finddisk(char *name) { register struct disk *dk, **dkp; register char *p; @@ -235,9 +231,7 @@ finddisk(name) } static void -addpart(name, fsname, auxdata) - char *name, *fsname; - long auxdata; +addpart(char *name, char *fsname, long auxdata) { struct disk *dk = finddisk(name); register struct part *pt, **ppt = &dk->part; @@ -267,9 +261,7 @@ addpart(name, fsname, auxdata) } static int -startdisk(dk, checkit) - register struct disk *dk; - int (*checkit)(char *, char *, long, int); +startdisk(register struct disk *dk, int (*checkit)(char *, char *, long ,int)) { register struct part *pt = dk->part; @@ -285,8 +277,7 @@ startdisk(dk, checkit) } char * -blockcheck(origname) - char *origname; +blockcheck(char *origname) { struct stat stslash, stblock, stchar; char *newname, *raw; diff --git a/sbin/fsck/setup.c b/sbin/fsck/setup.c index 3bddb8bd6f..3ad403e5eb 100644 --- a/sbin/fsck/setup.c +++ b/sbin/fsck/setup.c @@ -32,7 +32,7 @@ * * @(#)setup.c 8.10 (Berkeley) 5/9/95 * $FreeBSD: src/sbin/fsck/setup.c,v 1.17.2.4 2002/06/24 05:10:41 dillon Exp $ - * $DragonFly: src/sbin/fsck/setup.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/fsck/setup.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #define DKTYPENAMES @@ -66,8 +66,7 @@ static int readsb __P((int listerr)); * is already clean (preen mode only). */ int -setup(dev) - char *dev; +setup(char *dev) { long cg, size, asked, i, j; long skipclean, bmapsize; @@ -316,8 +315,7 @@ badsb: * Read in the super block and its summary info. */ static int -readsb(listerr) - int listerr; +readsb(int listerr) { ufs_daddr_t super = bflag ? bflag : SBOFF / dev_bsize; @@ -391,9 +389,7 @@ readsb(listerr) } static void -badsb(listerr, s) - int listerr; - char *s; +badsb(int listerr, char *s) { if (!listerr) @@ -410,10 +406,7 @@ badsb(listerr, s) * their needed information is available! */ static int -calcsb(dev, devfd, fs) - char *dev; - int devfd; - register struct fs *fs; +calcsb(char *dev, int devfd, register struct fs *fs) { register struct disklabel *lp; register struct partition *pp; @@ -471,9 +464,7 @@ calcsb(dev, devfd, fs) } static struct disklabel * -getdisklabel(s, fd) - char *s; - int fd; +getdisklabel(char *s, int fd) { static struct disklabel lab; diff --git a/sbin/fsck/utilities.c b/sbin/fsck/utilities.c index 64ebb6b222..17a51edf36 100644 --- a/sbin/fsck/utilities.c +++ b/sbin/fsck/utilities.c @@ -32,7 +32,7 @@ * * @(#)utilities.c 8.6 (Berkeley) 5/19/95 * $FreeBSD: src/sbin/fsck/utilities.c,v 1.11.2.3 2001/01/23 23:11:07 iedowse Exp $ - * $DragonFly: src/sbin/fsck/utilities.c,v 1.3 2003/08/08 04:18:37 dillon Exp $ + * $DragonFly: src/sbin/fsck/utilities.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -51,8 +51,7 @@ long diskreads, totalreads; /* Disk cache statistics */ static void rwerror __P((char *mesg, ufs_daddr_t blk)); int -ftypeok(dp) - struct dinode *dp; +ftypeok(struct dinode *dp) { switch (dp->di_mode & IFMT) { @@ -73,8 +72,7 @@ ftypeok(dp) } int -reply(question) - char *question; +reply(char *question) { int persevere; char c; @@ -114,8 +112,7 @@ reply(question) * Look up state information for an inode. */ struct inostat * -inoinfo(inum) - ino_t inum; +inoinfo(ino_t inum) { static struct inostat unallocated = { USTATE, 0, 0 }; struct inostatlist *ilp; @@ -134,7 +131,7 @@ inoinfo(inum) * Malloc buffers and set up cache. */ void -bufinit() +bufinit(void) { register struct bufarea *bp; long bufcnt, i; @@ -172,9 +169,7 @@ bufinit() * Manage a cache of directory blocks. */ struct bufarea * -getdatablk(blkno, size) - ufs_daddr_t blkno; - long size; +getdatablk(ufs_daddr_t blkno, long size) { register struct bufarea *bp; @@ -201,10 +196,7 @@ foundit: } void -getblk(bp, blk, size) - register struct bufarea *bp; - ufs_daddr_t blk; - long size; +getblk(register struct bufarea *bp, ufs_daddr_t blk, long size) { ufs_daddr_t dblk; @@ -219,9 +211,7 @@ getblk(bp, blk, size) } void -flush(fd, bp) - int fd; - register struct bufarea *bp; +flush(int fd, register struct bufarea *bp) { register int i, j; @@ -245,9 +235,7 @@ flush(fd, bp) } static void -rwerror(mesg, blk) - char *mesg; - ufs_daddr_t blk; +rwerror(char *mesg, ufs_daddr_t blk) { if (preen == 0) @@ -258,8 +246,7 @@ rwerror(mesg, blk) } void -ckfini(markclean) - int markclean; +ckfini(int markclean) { register struct bufarea *bp, *nbp; int ofsmodified, cnt = 0; @@ -311,11 +298,7 @@ ckfini(markclean) } int -bread(fd, buf, blk, size) - int fd; - char *buf; - ufs_daddr_t blk; - long size; +bread(int fd, char *buf, ufs_daddr_t blk, long size) { char *cp; int i, errs; @@ -352,11 +335,7 @@ bread(fd, buf, blk, size) } void -bwrite(fd, buf, blk, size) - int fd; - char *buf; - ufs_daddr_t blk; - long size; +bwrite(int fd, char *buf, ufs_daddr_t blk, long size) { int i; char *cp; @@ -390,8 +369,7 @@ bwrite(fd, buf, blk, size) * allocate a data block with the specified number of fragments */ ufs_daddr_t -allocblk(frags) - long frags; +allocblk(long frags) { int i, j, k, cg, baseblk; struct cg *cgp = &cgrp; @@ -434,9 +412,7 @@ allocblk(frags) * Free a previously allocated block */ void -freeblk(blkno, frags) - ufs_daddr_t blkno; - long frags; +freeblk(ufs_daddr_t blkno, long frags) { struct inodesc idesc; @@ -449,9 +425,7 @@ freeblk(blkno, frags) * Find a pathname */ void -getpathname(namebuf, curdir, ino) - char *namebuf; - ino_t curdir, ino; +getpathname(char *namebuf, ino_t curdir, ino_t ino) { int len; register char *cp; @@ -506,8 +480,7 @@ getpathname(namebuf, curdir, ino) } void -catch(sig) - int sig; +catch(int sig) { if (!doinglevel2) ckfini(0); @@ -520,8 +493,7 @@ catch(sig) * so that reboot sequence may be interrupted. */ void -catchquit(sig) - int sig; +catchquit(int sig) { printf("returning to single-user after filesystem check\n"); returntosingle = 1; @@ -533,8 +505,7 @@ catchquit(sig) * Used by child processes in preen. */ void -voidquit(sig) - int sig; +voidquit(int sig) { sleep(1); @@ -543,8 +514,7 @@ voidquit(sig) } void -infohandler(sig) - int sig; +infohandler(int sig) { got_siginfo = 1; } @@ -553,9 +523,7 @@ infohandler(sig) * determine whether an inode should be fixed. */ int -dofix(idesc, msg) - register struct inodesc *idesc; - char *msg; +dofix(register struct inodesc *idesc, char *msg) { switch (idesc->id_fix) { @@ -591,11 +559,7 @@ dofix(idesc, msg) return (0); } -#if __STDC__ #include -#else -#include -#endif /* * An unexpected inconsistency occured. @@ -603,20 +567,10 @@ dofix(idesc, msg) * otherwise just print message and continue. */ void -#if __STDC__ pfatal(const char *fmt, ...) -#else -pfatal(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif if (!preen) { (void)vfprintf(stderr, fmt, ap); va_end(ap); @@ -641,20 +595,10 @@ pfatal(fmt, va_alist) * protocol, or a warning (preceded by filename) when preening. */ void -#if __STDC__ pwarn(const char *fmt, ...) -#else -pwarn(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif if (preen) (void)fprintf(stderr, "%s: ", cdevname); (void)vfprintf(stderr, fmt, ap); @@ -665,20 +609,11 @@ pwarn(fmt, va_alist) * Stub for routines from kernel. */ void -#if __STDC__ panic(const char *fmt, ...) -#else -panic(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; -#if __STDC__ + va_start(ap, fmt); -#else - va_start(ap); -#endif pfatal("INTERNAL INCONSISTENCY:"); (void)vfprintf(stderr, fmt, ap); va_end(ap); diff --git a/sbin/fsck_msdosfs/boot.c b/sbin/fsck_msdosfs/boot.c index 067fc89fce..2df6a21d8d 100644 --- a/sbin/fsck_msdosfs/boot.c +++ b/sbin/fsck_msdosfs/boot.c @@ -31,7 +31,7 @@ * * $NetBSD: boot.c,v 1.5 1997/10/17 11:19:23 ws Exp $ * $FreeBSD: src/sbin/fsck_msdosfs/boot.c,v 1.1.2.1 2001/08/01 05:47:55 obrien Exp $ - * $DragonFly: src/sbin/fsck_msdosfs/boot.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * $DragonFly: src/sbin/fsck_msdosfs/boot.c,v 1.3 2003/09/28 14:39:17 hmp Exp $ */ @@ -47,9 +47,7 @@ #include "fsutil.h" int -readboot(dosfs, boot) - int dosfs; - struct bootblock *boot; +readboot(int dosfs, struct bootblock *boot) { u_char block[DOSBOOTBLOCKSIZE]; u_char fsinfo[2 * DOSBOOTBLOCKSIZE]; @@ -225,9 +223,7 @@ readboot(dosfs, boot) } int -writefsinfo(dosfs, boot) - int dosfs; - struct bootblock *boot; +writefsinfo(int dosfs, struct bootblock *boot) { u_char fsinfo[2 * DOSBOOTBLOCKSIZE]; diff --git a/sbin/fsck_msdosfs/check.c b/sbin/fsck_msdosfs/check.c index 700ebfdda4..db37ebd27d 100644 --- a/sbin/fsck_msdosfs/check.c +++ b/sbin/fsck_msdosfs/check.c @@ -31,7 +31,7 @@ * * $NetBSD: check.c,v 1.10 2000/04/25 23:02:51 jdolecek Exp $ * $FreeBSD: src/sbin/fsck_msdosfs/check.c,v 1.1.2.1 2001/08/01 05:47:55 obrien Exp $ - * $DragonFly: src/sbin/fsck_msdosfs/check.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * $DragonFly: src/sbin/fsck_msdosfs/check.c,v 1.3 2003/09/28 14:39:17 hmp Exp $ */ @@ -48,8 +48,7 @@ #include "fsutil.h" int -checkfilesys(fname) - const char *fname; +checkfilesys(const char *fname) { int dosfs; struct bootblock boot; diff --git a/sbin/fsck_msdosfs/dir.c b/sbin/fsck_msdosfs/dir.c index 9029a9902e..9755b35837 100644 --- a/sbin/fsck_msdosfs/dir.c +++ b/sbin/fsck_msdosfs/dir.c @@ -33,7 +33,7 @@ * * $NetBSD: dir.c,v 1.14 1998/08/25 19:18:15 ross Exp $ * $FreeBSD: src/sbin/fsck_msdosfs/dir.c,v 1.1.2.1 2001/08/01 05:47:55 obrien Exp $ - * $DragonFly: src/sbin/fsck_msdosfs/dir.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * $DragonFly: src/sbin/fsck_msdosfs/dir.c,v 1.3 2003/09/28 14:39:17 hmp Exp $ */ @@ -113,7 +113,7 @@ static int readDosDirSection __P((int, struct bootblock *, struct fatEntry *, static struct dosDirEntry *freede; static struct dosDirEntry * -newDosDirEntry() +newDosDirEntry(void) { struct dosDirEntry *de; @@ -126,8 +126,7 @@ newDosDirEntry() } static void -freeDosDirEntry(de) - struct dosDirEntry *de; +freeDosDirEntry(struct dosDirEntry *de) { de->next = freede; freede = de; @@ -139,7 +138,7 @@ freeDosDirEntry(de) static struct dirTodoNode *freedt; static struct dirTodoNode * -newDirTodo() +newDirTodo(void) { struct dirTodoNode *dt; @@ -152,8 +151,7 @@ newDirTodo() } static void -freeDirTodo(dt) - struct dirTodoNode *dt; +freeDirTodo(struct dirTodoNode *dt) { dt->next = freedt; freedt = dt; @@ -168,8 +166,7 @@ struct dirTodoNode *pendingDirectories = NULL; * Return the full pathname for a directory entry. */ static char * -fullpath(dir) - struct dosDirEntry *dir; +fullpath(struct dosDirEntry *dir) { static char namebuf[MAXPATHLEN + 1]; char *cp, *np; @@ -196,8 +193,7 @@ fullpath(dir) * Calculate a checksum over an 8.3 alias name */ static u_char -calcShortSum(p) - u_char *p; +calcShortSum(u_char *p) { u_char sum = 0; int i; @@ -224,9 +220,7 @@ static struct dosDirEntry *lostDir; * Init internal state for a new directory scan. */ int -resetDosDirSection(boot, fat) - struct bootblock *boot; - struct fatEntry *fat; +resetDosDirSection(struct bootblock *boot, struct fatEntry *fat) { int b1, b2; cl_t cl; @@ -279,7 +273,7 @@ resetDosDirSection(boot, fat) * Cleanup after a directory scan */ void -finishDosDirSection() +finishDosDirSection(void) { struct dirTodoNode *p, *np; struct dosDirEntry *d, *nd; @@ -309,15 +303,8 @@ finishDosDirSection() * Delete directory entries between startcl, startoff and endcl, endoff. */ static int -delete(f, boot, fat, startcl, startoff, endcl, endoff, notlast) - int f; - struct bootblock *boot; - struct fatEntry *fat; - cl_t startcl; - int startoff; - cl_t endcl; - int endoff; - int notlast; +delete(int f, struct bootblock *boot, struct fatEntry *fat, cl_t startcl, + int startoff, cl_t endcl, int endoff, int notlast) { u_char *s, *e; off_t off; @@ -356,17 +343,9 @@ delete(f, boot, fat, startcl, startoff, endcl, endoff, notlast) } static int -removede(f, boot, fat, start, end, startcl, endcl, curcl, path, type) - int f; - struct bootblock *boot; - struct fatEntry *fat; - u_char *start; - u_char *end; - cl_t startcl; - cl_t endcl; - cl_t curcl; - char *path; - int type; +removede(int f, struct bootblock *boot, struct fatEntry *fat, u_char *start, + u_char *end, cl_t startcl, cl_t endcl, cl_t curcl, char *path, + int type) { switch (type) { case 0: @@ -400,11 +379,8 @@ removede(f, boot, fat, start, end, startcl, endcl, curcl, path, type) * Check an in-memory file entry */ static int -checksize(boot, fat, p, dir) - struct bootblock *boot; - struct fatEntry *fat; - u_char *p; - struct dosDirEntry *dir; +checksize(struct bootblock *boot, struct fatEntry *fat, u_char *p, + struct dosDirEntry *dir) { /* * Check size on ordinary files @@ -455,11 +431,8 @@ checksize(boot, fat, p, dir) * - push directories onto the todo-stack */ static int -readDosDirSection(f, boot, fat, dir) - int f; - struct bootblock *boot; - struct fatEntry *fat; - struct dosDirEntry *dir; +readDosDirSection(int f, struct bootblock *boot, struct fatEntry *fat, + struct dosDirEntry *dir) { struct dosDirEntry dirent, *d; u_char *p, *vallfn, *invlfn, *empty; @@ -878,10 +851,7 @@ readDosDirSection(f, boot, fat, dir) } int -handleDirTree(dosfs, boot, fat) - int dosfs; - struct bootblock *boot; - struct fatEntry *fat; +handleDirTree(int dosfs, struct bootblock *boot, struct fatEntry *fat) { int mod; @@ -922,11 +892,7 @@ static cl_t lfcl; static off_t lfoff; int -reconnect(dosfs, boot, fat, head) - int dosfs; - struct bootblock *boot; - struct fatEntry *fat; - cl_t head; +reconnect(int dosfs, struct bootblock *boot, struct fatEntry *fat, cl_t head) { struct dosDirEntry d; u_char *p; @@ -1008,7 +974,7 @@ reconnect(dosfs, boot, fat, head) } void -finishlf() +finishlf(void) { if (lfbuf) free(lfbuf); diff --git a/sbin/fsck_msdosfs/fat.c b/sbin/fsck_msdosfs/fat.c index a1bf719050..f0f2fb63c5 100644 --- a/sbin/fsck_msdosfs/fat.c +++ b/sbin/fsck_msdosfs/fat.c @@ -31,7 +31,7 @@ * * $NetBSD: fat.c,v 1.12 2000/10/10 20:24:52 is Exp $ * $FreeBSD: src/sbin/fsck_msdosfs/fat.c,v 1.1.2.1 2001/08/01 05:47:56 obrien Exp $ - * $DragonFly: src/sbin/fsck_msdosfs/fat.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * $DragonFly: src/sbin/fsck_msdosfs/fat.c,v 1.3 2003/09/28 14:39:17 hmp Exp $ */ @@ -55,11 +55,7 @@ static int _readfat __P((int, struct bootblock *, int, u_char **)); * Check a cluster number for valid value */ static int -checkclnum(boot, fat, cl, next) - struct bootblock *boot; - int fat; - cl_t cl; - cl_t *next; +checkclnum(struct bootblock *boot, int fat, cl_t cl, cl_t *next) { if (*next >= (CLUST_RSRVD&boot->ClustMask)) *next |= ~boot->ClustMask; @@ -90,11 +86,7 @@ checkclnum(boot, fat, cl, next) * Read a FAT from disk. Returns 1 if successful, 0 otherwise. */ static int -_readfat(fs, boot, no, buffer) - int fs; - struct bootblock *boot; - int no; - u_char **buffer; +_readfat(int fs, struct bootblock *boot, int no, u_char **buffer) { off_t off; @@ -129,11 +121,7 @@ _readfat(fs, boot, no, buffer) * Read a FAT and decode it into internal format */ int -readfat(fs, boot, no, fp) - int fs; - struct bootblock *boot; - int no; - struct fatEntry **fp; +readfat(int fs, struct bootblock *boot, int no, struct fatEntry **fp) { struct fatEntry *fat; u_char *buffer, *p; @@ -251,8 +239,7 @@ readfat(fs, boot, no, fp) * Get type of reserved cluster */ char * -rsrvdcltype(cl) - cl_t cl; +rsrvdcltype(cl_t cl) { if (cl == CLUST_FREE) return "free"; @@ -264,11 +251,7 @@ rsrvdcltype(cl) } static int -clustdiffer(cl, cp1, cp2, fatnum) - cl_t cl; - cl_t *cp1; - cl_t *cp2; - int fatnum; +clustdiffer(cl_t cl, cl_t *cp1, cl_t *cp2, int fatnum) { if (*cp1 == CLUST_FREE || *cp1 >= CLUST_RSRVD) { if (*cp2 == CLUST_FREE || *cp2 >= CLUST_RSRVD) { @@ -338,11 +321,8 @@ clustdiffer(cl, cp1, cp2, fatnum) * into the first one. */ int -comparefat(boot, first, second, fatnum) - struct bootblock *boot; - struct fatEntry *first; - struct fatEntry *second; - int fatnum; +comparefat(struct bootblock *boot, struct fatEntry *first, + struct fatEntry *second, int fatnum) { cl_t cl; int ret = FSOK; @@ -354,10 +334,7 @@ comparefat(boot, first, second, fatnum) } void -clearchain(boot, fat, head) - struct bootblock *boot; - struct fatEntry *fat; - cl_t head; +clearchain(struct bootblock *boot, struct fatEntry *fat, cl_t head) { cl_t p, q; @@ -371,11 +348,7 @@ clearchain(boot, fat, head) } int -tryclear(boot, fat, head, trunc) - struct bootblock *boot; - struct fatEntry *fat; - cl_t head; - cl_t *trunc; +tryclear(struct bootblock *boot, struct fatEntry *fat, cl_t head, cl_t *trunc) { if (ask(0, "Clear chain starting at %u", head)) { clearchain(boot, fat, head); @@ -391,9 +364,7 @@ tryclear(boot, fat, head, trunc) * Check a complete FAT in-memory for crosslinks */ int -checkfat(boot, fat) - struct bootblock *boot; - struct fatEntry *fat; +checkfat(struct bootblock *boot, struct fatEntry *fat) { cl_t head, p, h, n; u_int len; @@ -487,11 +458,7 @@ checkfat(boot, fat) * Write out FATs encoding them from the internal format */ int -writefat(fs, boot, fat, correct_fat) - int fs; - struct bootblock *boot; - struct fatEntry *fat; - int correct_fat; +writefat(int fs, struct bootblock *boot, struct fatEntry *fat, int correct_fat) { u_char *buffer, *p; cl_t cl; @@ -599,10 +566,7 @@ writefat(fs, boot, fat, correct_fat) * Check a complete in-memory FAT for lost cluster chains */ int -checklost(dosfs, boot, fat) - int dosfs; - struct bootblock *boot; - struct fatEntry *fat; +checklost(int dosfs, struct bootblock *boot, struct fatEntry *fat) { cl_t head; int mod = FSOK; diff --git a/sbin/fsck_msdosfs/main.c b/sbin/fsck_msdosfs/main.c index 4cb8fcd31f..b15a63f46c 100644 --- a/sbin/fsck_msdosfs/main.c +++ b/sbin/fsck_msdosfs/main.c @@ -31,7 +31,7 @@ * * $NetBSD: main.c,v 1.10 1997/10/01 02:18:14 enami Exp $ * $FreeBSD: src/sbin/fsck_msdosfs/main.c,v 1.4.2.1 2001/08/01 05:47:56 obrien Exp $ - * $DragonFly: src/sbin/fsck_msdosfs/main.c,v 1.2 2003/06/17 04:27:32 dillon Exp $ + * $DragonFly: src/sbin/fsck_msdosfs/main.c,v 1.3 2003/09/28 14:39:17 hmp Exp $ */ @@ -61,15 +61,13 @@ static void usage __P((void)); int main __P((int, char **)); static void -usage() +usage(void) { errexit("Usage: fsck_msdos [-fnpy] filesystem ... \n"); } int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int ret = 0, erg; int ch; @@ -124,14 +122,7 @@ main(argc, argv) /*VARARGS*/ int -#if __STDC__ ask(int def, const char *fmt, ...) -#else -ask(def, fmt, va_alist) - int def; - char *fmt; - va_dcl -#endif { va_list ap; @@ -146,11 +137,7 @@ ask(def, fmt, va_alist) return def; } -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif vsnprintf(prompt, sizeof(prompt), fmt, ap); if (alwaysyes || rdonly) { printf("%s? %s\n", prompt, rdonly ? "no" : "yes"); diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c index 62a5b56791..2932a207bd 100644 --- a/sbin/fsdb/fsdb.c +++ b/sbin/fsdb/fsdb.c @@ -28,7 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/fsdb/fsdb.c,v 1.13.2.3 2002/03/20 13:39:02 joerg Exp $ - * $DragonFly: src/sbin/fsdb/fsdb.c,v 1.4 2003/08/29 18:40:03 hmp Exp $ + * $DragonFly: src/sbin/fsdb/fsdb.c,v 1.5 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -51,7 +51,7 @@ static void usage __P((void)); int cmdloop __P((void)); static void -usage() +usage(void) { fprintf(stderr, "usage: fsdb [-d] [-f] [-r] fsname\n"); exit(1); @@ -67,9 +67,7 @@ char nflag = 0; * the file system. */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, rval; char *fsys = NULL; @@ -114,10 +112,8 @@ main(argc, argv) exit(rval); } -#define CMDFUNC(func) int func __P((int argc, char *argv[])) -#define CMDFUNCSTART(func) int func(argc, argv) \ - int argc; \ - char *argv[]; +#define CMDFUNC(func) int func (int argc, char **argv) +#define CMDFUNCSTART(func) int func(int argc, char **argv) CMDFUNC(helpfn); CMDFUNC(focus); /* focus on inode */ @@ -183,9 +179,7 @@ struct cmdtable cmds[] = { }; int -helpfn(argc, argv) - int argc; - char *argv[]; +helpfn(int argc, char **argv) { register struct cmdtable *cmdtp; @@ -199,8 +193,7 @@ helpfn(argc, argv) } char * -prompt(el) - EditLine *el; +prompt(EditLine *el) { static char pstring[64]; snprintf(pstring, sizeof(pstring), "fsdb (inum: %d)> ", curinum); @@ -209,7 +202,7 @@ prompt(el) int -cmdloop() +cmdloop(void) { char *line; const char *elline; @@ -383,8 +376,7 @@ const char *typename[] = { int slot; int -scannames(idesc) - struct inodesc *idesc; +scannames(struct inodesc *idesc) { register struct direct *dirp = idesc->id_dirp; @@ -414,8 +406,7 @@ int findino __P((struct inodesc *idesc)); /* from fsck */ static int dolookup __P((char *name)); static int -dolookup(name) - char *name; +dolookup(char *name) { struct inodesc idesc; @@ -505,8 +496,7 @@ CMDFUNCSTART(rm) long slotcount, desired; int -chinumfunc(idesc) - struct inodesc *idesc; +chinumfunc(struct inodesc *idesc) { register struct direct *dirp = idesc->id_dirp; @@ -549,8 +539,7 @@ CMDFUNCSTART(chinum) } int -chnamefunc(idesc) - struct inodesc *idesc; +chnamefunc(struct inodesc *idesc) { register struct direct *dirp = idesc->id_dirp; struct direct testdir; @@ -813,9 +802,7 @@ CMDFUNCSTART(chgroup) } int -dotime(name, rts) - char *name; - struct timespec *rts; +dotime(char *name, struct timespec *rts) { char *p, *val; struct tm t; diff --git a/sbin/fsdb/fsdbutil.c b/sbin/fsdb/fsdbutil.c index 4811aa1e8d..105b34821f 100644 --- a/sbin/fsdb/fsdbutil.c +++ b/sbin/fsdb/fsdbutil.c @@ -28,7 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/fsdb/fsdbutil.c,v 1.9.2.2 2002/03/20 13:39:02 joerg Exp $ - * $DragonFly: src/sbin/fsdb/fsdbutil.c,v 1.3 2003/08/08 04:18:38 dillon Exp $ + * $DragonFly: src/sbin/fsdb/fsdbutil.c,v 1.4 2003/09/28 14:39:17 hmp Exp $ */ #include @@ -52,9 +52,7 @@ static int printindir __P((ufs_daddr_t blk, int level, char *bufp)); static void printblocks __P((ino_t inum, struct dinode *dp)); char ** -crack(line, argc) - char *line; - int *argc; +crack(char *line, int *argc) { static char *argv[8]; int i; @@ -72,10 +70,7 @@ crack(line, argc) } int -argcount(cmdp, argc, argv) - struct cmdtable *cmdp; - int argc; - char *argv[]; +argcount(struct cmdtable *cmdp, int argc, char **argv) { if (cmdp->minargc == cmdp->maxargc) warnx("command `%s' takes %u arguments", cmdp->cmd, cmdp->minargc-1); @@ -88,10 +83,7 @@ argcount(cmdp, argc, argv) } void -printstat(cp, inum, dp) - const char *cp; - ino_t inum; - struct dinode *dp; +printstat(const char *cp, ino_t inum, struct dinode *dp) { struct group *grp; struct passwd *pw; @@ -163,7 +155,7 @@ printstat(cp, inum, dp) */ static int -charsperline() +charsperline(void) { int columns; char *cp; @@ -184,10 +176,7 @@ charsperline() * Recursively print a list of indirect blocks. */ static int -printindir(blk, level, bufp) - ufs_daddr_t blk; - int level; - char *bufp; +printindir(ufs_daddr_t blk, int level, char *bufp) { struct bufarea buf, *bp; char tempbuf[32]; /* enough to print an ufs_daddr_t */ @@ -241,9 +230,7 @@ printindir(blk, level, bufp) * Print the block pointers for one inode. */ static void -printblocks(inum, dp) - ino_t inum; - struct dinode *dp; +printblocks(ino_t inum, struct dinode *dp) { char *bufp; int i, j, nfrags; @@ -281,7 +268,7 @@ printblocks(inum, dp) int -checkactive() +checkactive(void) { if (!curinode) { warnx("no current inode\n"); @@ -291,7 +278,7 @@ checkactive() } int -checkactivedir() +checkactivedir(void) { if (!curinode) { warnx("no current inode\n"); @@ -305,8 +292,7 @@ checkactivedir() } int -printactive(doblocks) - int doblocks; +printactive(int doblocks) { if (!checkactive()) return 1; diff --git a/sbin/fsirand/fsirand.c b/sbin/fsirand/fsirand.c index 38a2919424..5ac9776cfc 100644 --- a/sbin/fsirand/fsirand.c +++ b/sbin/fsirand/fsirand.c @@ -30,7 +30,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/fsirand/fsirand.c,v 1.7.2.1 2000/07/01 06:23:36 ps Exp $ - * $DragonFly: src/sbin/fsirand/fsirand.c,v 1.3 2003/08/08 04:18:38 dillon Exp $ + * $DragonFly: src/sbin/fsirand/fsirand.c,v 1.4 2003/09/28 14:39:18 hmp Exp $ */ #include @@ -55,9 +55,7 @@ int fsirand __P((char *)); int printonly = 0, force = 0, ignorelabel = 0; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int n, ex = 0; struct rlimit rl; @@ -102,8 +100,7 @@ main(argc, argv) } int -fsirand(device) - char *device; +fsirand(char *device) { static struct dinode *inodebuf; static size_t oldibufsize; @@ -280,7 +277,7 @@ fsirand(device) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: fsirand [-b] [-f] [-p] special [special ...]\n"); diff --git a/sbin/i386/cxconfig/cxconfig.c b/sbin/i386/cxconfig/cxconfig.c index c2fcef733d..70906ce9ec 100644 --- a/sbin/i386/cxconfig/cxconfig.c +++ b/sbin/i386/cxconfig/cxconfig.c @@ -22,7 +22,7 @@ * -- set channel options * * $FreeBSD: src/sbin/i386/cxconfig/cxconfig.c,v 1.4 1999/08/28 00:13:00 peter Exp $ - * $DragonFly: src/sbin/i386/cxconfig/cxconfig.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/i386/cxconfig/cxconfig.c,v 1.3 2003/09/28 14:39:18 hmp Exp $ */ #include @@ -70,7 +70,7 @@ unsigned char atosym (char *s) return (*s); } -void usage () +void usage (void) { fprintf (stderr, "Cronyx-Sigma Adapter Configuration Utility, Version 1.0\n"); @@ -141,7 +141,7 @@ int printstats (int channel, int hflag) return (0); } -void printallstats () +void printallstats (void) { int b, c; @@ -163,7 +163,7 @@ void setchan (int channel) close (s); } -void printopt () +void printopt (void) { /* Common channel options */ /* channel option register 4 */ @@ -395,7 +395,7 @@ void printchan (int channel) printopt (); } -void printall () +void printall (void) { struct ifconf ifc; struct ifreq *ifr; diff --git a/sbin/i386/fdisk/fdisk.c b/sbin/i386/fdisk/fdisk.c index 0b61e8e86a..35d6da5b1f 100644 --- a/sbin/i386/fdisk/fdisk.c +++ b/sbin/i386/fdisk/fdisk.c @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * $FreeBSD: src/sbin/i386/fdisk/fdisk.c,v 1.36.2.11 2002/04/25 21:02:21 trhodes Exp $ - * $DragonFly: src/sbin/i386/fdisk/fdisk.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/i386/fdisk/fdisk.c,v 1.3 2003/09/28 14:39:18 hmp Exp $ */ #include @@ -579,7 +579,7 @@ struct dos_partition *partp = ((struct dos_partition *) &mboot.parts) + i - 1; } static void -print_params() +print_params(void) { printf("parameters extracted from in-core disklabel are:\n"); printf("cylinders=%d heads=%d sectors/track=%d (%d blks/cyl)\n\n" @@ -630,14 +630,14 @@ setactive: } static void -change_code() +change_code(void) { if (ok("Do you want to change the boot code?")) init_boot(); } void -get_params_to_use() +get_params_to_use(void) { int tmp; print_params(); @@ -747,7 +747,7 @@ write_disk(off_t sector, void *buf) } static int -get_params() +get_params(void) { if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) { @@ -771,7 +771,7 @@ get_params() static int -read_s0() +read_s0(void) { mboot.bootinst_size = secsize; if (mboot.bootinst != NULL) @@ -795,7 +795,7 @@ read_s0() } static int -write_s0() +write_s0(void) { #ifdef NOT_NOW int flag; diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 33f4598081..2cb55d843d 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1993 The Regents of the University of California. All rights reserved. * @(#)ifconfig.c 8.2 (Berkeley) 2/16/94 * $FreeBSD: src/sbin/ifconfig/ifconfig.c,v 1.51.2.19 2003/01/28 11:02:56 fjoe Exp $ - * $DragonFly: src/sbin/ifconfig/ifconfig.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/ifconfig/ifconfig.c,v 1.3 2003/09/28 14:39:18 hmp Exp $ */ #include @@ -369,9 +369,7 @@ struct afswtch { #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) void -rt_xaddrs(cp, cplim, rtinfo) - caddr_t cp, cplim; - struct rt_addrinfo *rtinfo; +rt_xaddrs(caddr_t cp, caddr_t cplim, struct rt_addrinfo *rtinfo) { struct sockaddr *sa; int i; @@ -387,7 +385,7 @@ rt_xaddrs(cp, cplim, rtinfo) void -usage() +usage(void) { #ifndef INET6 fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n", @@ -412,9 +410,7 @@ usage() } int -main(argc, argv) - int argc; - char *const *argv; +main(int argc, const char **argv) { int c; int all, namesonly, downonly, uponly; @@ -647,10 +643,7 @@ main(argc, argv) int -ifconfig(argc, argv, afp) - int argc; - char *const *argv; - const struct afswtch *afp; +ifconfig(int argc, char *const *argv, const struct afswtch *afp) { int s; @@ -762,11 +755,7 @@ ifconfig(argc, argv, afp) /*ARGSUSED*/ void -setifaddr(addr, param, s, afp) - const char *addr; - int param; - int s; - const struct afswtch *afp; +setifaddr(const char *addr, int param, int s, const struct afswtch *afp) { if (*afp->af_getaddr == NULL) return; @@ -782,10 +771,7 @@ setifaddr(addr, param, s, afp) } void -settunnel(src, dst, s, afp) - const char *src, *dst; - int s; - const struct afswtch *afp; +settunnel(const char *src, const char *dst, int s, const struct afswtch *afp) { struct addrinfo hints, *srcres, *dstres; struct ifaliasreq addreq; @@ -846,11 +832,7 @@ settunnel(src, dst, s, afp) /* ARGSUSED */ void -deletetunnel(vname, param, s, afp) - const char *vname; - int param; - int s; - const struct afswtch *afp; +deletetunnel(const char *vname, int param, int s, const struct afswtch *afp) { if (ioctl(s, SIOCDIFPHYADDR, &ifr) < 0) @@ -858,11 +840,8 @@ deletetunnel(vname, param, s, afp) } void -setifnetmask(addr, dummy, s, afp) - const char *addr; - int dummy __unused; - int s; - const struct afswtch *afp; +setifnetmask(const char *addr, int dummy __unused, int s, + const struct afswtch *afp) { if (*afp->af_getaddr == NULL) return; @@ -872,11 +851,8 @@ setifnetmask(addr, dummy, s, afp) #ifdef INET6 void -setifprefixlen(addr, dummy, s, afp) - const char *addr; - int dummy __unused; - int s; - const struct afswtch *afp; +setifprefixlen(const char *addr, int dummy __unused, int s, + const struct afswtch *afp) { if (*afp->af_getprefix) (*afp->af_getprefix)(addr, MASK); @@ -884,11 +860,8 @@ setifprefixlen(addr, dummy, s, afp) } void -setip6flags(dummyaddr, flag, dummysoc, afp) - const char *dummyaddr __unused; - int flag; - int dummysoc __unused; - const struct afswtch *afp; +setip6flags(const char *dummyaddr __unused, int flag, int dummysoc __unused, + const struct afswtch *afp) { if (afp->af_af != AF_INET6) err(1, "address flags can be set only for inet6 addresses"); @@ -900,31 +873,22 @@ setip6flags(dummyaddr, flag, dummysoc, afp) } void -setip6pltime(seconds, dummy, s, afp) - const char *seconds; - int dummy __unused; - int s; - const struct afswtch *afp; +setip6pltime(const char *seconds, int dummy __unused, int s, + const struct afswtch *afp) { setip6lifetime("pltime", seconds, s, afp); } void -setip6vltime(seconds, dummy, s, afp) - const char *seconds; - int dummy __unused; - int s; - const struct afswtch *afp; +setip6vltime(const char *seconds, int dummy __unused, int s, + const struct afswtch *afp) { setip6lifetime("vltime", seconds, s, afp); } void -setip6lifetime(cmd, val, s, afp) - const char *cmd; - const char *val; - int s; - const struct afswtch *afp; +setip6lifetime(const char *cmd, const char *val, int s, + const struct afswtch *afp) { time_t newval, t; char *ep; @@ -945,11 +909,8 @@ setip6lifetime(cmd, val, s, afp) } void -setip6eui64(cmd, dummy, s, afp) - const char *cmd; - int dummy __unused; - int s; - const struct afswtch *afp; +setip6eui64(const char *cmd, int dummy __unused, int s, + const struct afswtch *afp) { struct ifaddrs *ifap, *ifa; const struct sockaddr_in6 *sin6 = NULL; @@ -983,11 +944,8 @@ setip6eui64(cmd, dummy, s, afp) #endif void -setifbroadaddr(addr, dummy, s, afp) - const char *addr; - int dummy __unused; - int s; - const struct afswtch *afp; +setifbroadaddr(const char *addr, int dummy __unused, int s, + const struct afswtch *afp) { if (*afp->af_getaddr == NULL) return; @@ -995,11 +953,8 @@ setifbroadaddr(addr, dummy, s, afp) } void -setifipdst(addr, dummy, s, afp) - const char *addr; - int dummy __unused; - int s; - const struct afswtch *afp; +setifipdst(const char *addr, int dummy __unused, int s, + const struct afswtch *afp) { in_getaddr(addr, DSTADDR); setipdst++; @@ -1009,11 +964,7 @@ setifipdst(addr, dummy, s, afp) #define rqtosa(x) (&(((struct ifreq *)(afp->x))->ifr_addr)) void -notealias(addr, param, s, afp) - const char *addr; - int param; - int s; - const struct afswtch *afp; +notealias(const char *addr, int param, int s, const struct afswtch *afp) { if (setaddr && doalias == 0 && param < 0) bcopy((caddr_t)rqtosa(af_addreq), @@ -1029,11 +980,8 @@ notealias(addr, param, s, afp) /*ARGSUSED*/ void -setifdstaddr(addr, param, s, afp) - const char *addr; - int param __unused; - int s; - const struct afswtch *afp; +setifdstaddr(const char *addr, int param __unused, int s, + const struct afswtch *afp) { if (*afp->af_getaddr == NULL) return; @@ -1046,11 +994,7 @@ setifdstaddr(addr, param, s, afp) * Make a private copy so we can avoid that. */ void -setifflags(vname, value, s, afp) - const char *vname; - int value; - int s; - const struct afswtch *afp; +setifflags(const char *vname, int value, int s, const struct afswtch *afp) { struct ifreq my_ifr; @@ -1075,11 +1019,7 @@ setifflags(vname, value, s, afp) } void -setifcap(vname, value, s, afp) - const char *vname; - int value; - int s; - const struct afswtch *afp; +setifcap(const char *vname, int value, int s, const struct afswtch *afp) { if (ioctl(s, SIOCGIFCAP, (caddr_t)&ifr) < 0) { @@ -1098,11 +1038,8 @@ setifcap(vname, value, s, afp) } void -setifmetric(val, dummy, s, afp) - const char *val; - int dummy __unused; - int s; - const struct afswtch *afp; +setifmetric(const char *val, int dummy __unused, int s, + const struct afswtch *afp) { strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_metric = atoi(val); @@ -1111,11 +1048,7 @@ setifmetric(val, dummy, s, afp) } void -setifmtu(val, dummy, s, afp) - const char *val; - int dummy __unused; - int s; - const struct afswtch *afp; +setifmtu(const char *val, int dummy __unused, int s, const struct afswtch *afp) { strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_mtu = atoi(val); @@ -1136,12 +1069,8 @@ setifmtu(val, dummy, s, afp) * specified, show it and it only; otherwise, show them all. */ void -status(afp, addrcount, sdl, ifm, ifam) - const struct afswtch *afp; - int addrcount; - struct sockaddr_dl *sdl; - struct if_msghdr *ifm; - struct ifa_msghdr *ifam; +status(const struct afswtch *afp, int addrcount, struct sockaddr_dl *sdl, + struct if_msghdr *ifm, struct ifa_msghdr *ifam) { const struct afswtch *p = NULL; struct rt_addrinfo info; @@ -1233,8 +1162,7 @@ status(afp, addrcount, sdl, ifm, ifam) } void -tunnel_status(s) - int s; +tunnel_status(int s) { char psrcaddr[NI_MAXHOST]; char pdstaddr[NI_MAXHOST]; @@ -1300,9 +1228,7 @@ tunnel_status(s) } void -in_status(s, info) - int s __unused; - struct rt_addrinfo * info; +in_status(int s __unused, struct rt_addrinfo *info) { struct sockaddr_in *sin, null_sin; @@ -1335,8 +1261,7 @@ in_status(s, info) #ifdef INET6 void -in6_fillscopeid(sin6) - struct sockaddr_in6 *sin6; +in6_fillscopeid(struct sockaddr_in6 *sin6) { #if defined(__KAME__) && defined(KAME_SCOPEID) if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { @@ -1348,9 +1273,7 @@ in6_fillscopeid(sin6) } void -in6_status(s, info) - int s __unused; - struct rt_addrinfo * info; +in6_status(int s __unused, struct rt_addrinfo *info) { struct sockaddr_in6 *sin, null_sin; struct in6_ifreq ifr6; @@ -1484,9 +1407,7 @@ in6_status(s, info) #ifndef NO_IPX void -ipx_status(s, info) - int s __unused; - struct rt_addrinfo * info; +ipx_status(int s __unused, struct rt_addrinfo *info) { struct sockaddr_ipx *sipx, null_sipx; @@ -1506,9 +1427,7 @@ ipx_status(s, info) #endif void -at_status(s, info) - int s __unused; - struct rt_addrinfo * info; +at_status(int s __unused, struct rt_addrinfo *info) { struct sockaddr_at *sat, null_sat; struct netrange *nr; @@ -1542,9 +1461,7 @@ at_status(s, info) #ifdef NS void -xns_status(s, info) - int s __unused; - struct rt_addrinfo * info; +xns_status(int s __unused, struct rt_addrinfo *info) { struct sockaddr_ns *sns, null_sns; @@ -1567,9 +1484,7 @@ xns_status(s, info) void -link_status(s, info) - int s __unused; - struct rt_addrinfo *info; +link_status(int s __unused, struct rt_addrinfo *info) { struct sockaddr_dl *sdl = (struct sockaddr_dl *)info; @@ -1587,8 +1502,7 @@ link_status(s, info) } void -Perror(cmd) - const char *cmd; +Perror(const char *cmd) { switch (errno) { @@ -1611,9 +1525,7 @@ SIN(ridreq.ifr_addr), SIN(addreq.ifra_addr), SIN(addreq.ifra_mask), SIN(addreq.ifra_broadaddr)}; void -in_getaddr(s, which) - const char *s; - int which; +in_getaddr(const char *s, int which) { register struct sockaddr_in *sin = sintab[which]; struct hostent *hp; @@ -1661,9 +1573,7 @@ SIN6(in6_ridreq.ifr_addr), SIN6(in6_addreq.ifra_addr), SIN6(in6_addreq.ifra_prefixmask), SIN6(in6_addreq.ifra_dstaddr)}; void -in6_getaddr(s, which) - const char *s; - int which; +in6_getaddr(const char *s, int which) { register struct sockaddr_in6 *sin = sin6tab[which]; struct addrinfo hints, *res; @@ -1697,9 +1607,7 @@ in6_getaddr(s, which) } void -in6_getprefix(plen, which) - const char *plen; - int which; +in6_getprefix(const char *plen, int which) { register struct sockaddr_in6 *sin = sin6tab[which]; register u_char *cp; @@ -1725,10 +1633,7 @@ in6_getprefix(plen, which) * Print a value a la the %b format of the kernel's printf */ void -printb(s, v, bits) - const char *s; - register unsigned v; - register const char *bits; +printb(const char *s, register unsigned v, register const char *bits) { register int i, any = 0; register char c; @@ -1762,9 +1667,7 @@ SIPX(ridreq.ifr_addr), SIPX(addreq.ifra_addr), SIPX(addreq.ifra_mask), SIPX(addreq.ifra_broadaddr)}; void -ipx_getaddr(addr, which) - const char *addr; - int which; +ipx_getaddr(const char *addr, int which) { struct sockaddr_ipx *sipx = sipxtab[which]; @@ -1777,9 +1680,7 @@ ipx_getaddr(addr, which) #endif void -at_getaddr(addr, which) - const char *addr; - int which; +at_getaddr(const char *addr, int which) { struct sockaddr_at *sat = (struct sockaddr_at *) &addreq.ifra_addr; u_int net, node; @@ -1796,9 +1697,7 @@ at_getaddr(addr, which) } void -link_getaddr(addr, which) - const char *addr; - int which; +link_getaddr(const char *addr, int which) { char *temp; struct sockaddr_dl sdl; @@ -1822,11 +1721,8 @@ link_getaddr(addr, which) /* XXX FIXME -- should use strtoul for better parsing. */ void -setatrange(range, dummy, s, afp) - const char *range; - int dummy __unused; - int s; - const struct afswtch *afp; +setatrange(const char *range, int dummy __unused, int s, + const struct afswtch *afp) { u_short first = 123, last = 123; @@ -1839,11 +1735,8 @@ setatrange(range, dummy, s, afp) } void -setatphase(phase, dummy, s, afp) - const char *phase; - int dummy __unused; - int s; - const struct afswtch *afp; +setatphase(const char *phase, int dummy __unused, int s, + const struct afswtch *afp) { if (!strcmp(phase, "1")) at_nr.nr_phase = 1; @@ -1879,9 +1772,7 @@ SNS(ridreq.ifr_addr), SNS(addreq.ifra_addr), SNS(addreq.ifra_mask), SNS(addreq.ifra_broadaddr)}; void -xns_getaddr(addr, which) - const char *addr; - int which; +xns_getaddr(const char *addr, int which) { struct sockaddr_ns *sns = snstab[which]; @@ -1895,9 +1786,7 @@ xns_getaddr(addr, which) #ifdef INET6 int -prefix(val, size) - void *val; - int size; +prefix(void *val, int size) { register u_char *name = (u_char *)val; register int byte, bit, plen = 0; @@ -1921,8 +1810,7 @@ prefix(val, size) } static char * -sec2str(total) - time_t total; +sec2str(time_t total) { static char result[256]; int days, hours, mins, secs; @@ -1956,8 +1844,7 @@ sec2str(total) #endif /*INET6*/ void -ifmaybeload(name) - char *name; +ifmaybeload(char *name) { struct module_stat mstat; int fileid, modid; @@ -2039,7 +1926,7 @@ list_cloners(void) } void -clone_create() +clone_create(void) { int s; @@ -2061,11 +1948,7 @@ clone_create() } void -clone_destroy(val, d, s, rafp) - const char *val; - int d; - int s; - const struct afswtch *rafp; +clone_destroy(const char *val, int d, int s, const struct afswtch *rafp) { (void) strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index ced8372765..568ab63923 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/ifconfig/ifieee80211.c,v 1.1.2.3 2002/02/07 15:12:37 ambrisko Exp $ - * $DragonFly: src/sbin/ifconfig/ifieee80211.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/ifconfig/ifieee80211.c,v 1.3 2003/09/28 14:39:18 hmp Exp $ */ /*- @@ -280,9 +280,7 @@ set80211nwkey(const char *val, int d, int s, const struct afswtch *rafp) } void -ieee80211_status (s, info) - int s; - struct rt_addrinfo *info __unused; +ieee80211_status (int s, struct rt_addrinfo *info __unused) { int i; int num; diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c index 95542d228e..0db9940468 100644 --- a/sbin/ifconfig/ifmedia.c +++ b/sbin/ifconfig/ifmedia.c @@ -1,6 +1,6 @@ /* $NetBSD: ifconfig.c,v 1.34 1997/04/21 01:17:58 lukem Exp $ */ /* $FreeBSD: src/sbin/ifconfig/ifmedia.c,v 1.6.2.3 2001/11/14 04:35:07 yar Exp $ */ -/* $DragonFly: src/sbin/ifconfig/ifmedia.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ */ +/* $DragonFly: src/sbin/ifconfig/ifmedia.c,v 1.3 2003/09/28 14:39:18 hmp Exp $ */ /* * Copyright (c) 1997 Jason R. Thorpe. @@ -103,9 +103,7 @@ static struct ifmedia_description *get_subtype_desc __P((int, struct ifmedia_type_to_subtype *ttos)); void -media_status(s, info) - int s; - struct rt_addrinfo *info __unused; +media_status(int s, struct rt_addrinfo *info __unused) { struct ifmediareq ifmr; int *media_list, i; @@ -185,11 +183,7 @@ media_status(s, info) } void -setmedia(val, d, s, afp) - const char *val; - int d; - int s; - const struct afswtch *afp; +setmedia(const char *val, int d, int s, const struct afswtch *afp) { struct ifmediareq ifmr; int first_type, subtype; @@ -231,32 +225,21 @@ setmedia(val, d, s, afp) } void -setmediaopt(val, d, s, afp) - const char *val; - int d; - int s; - const struct afswtch *afp; +setmediaopt(const char *val, int d, int s, const struct afswtch *afp) { domediaopt(val, 0, s); } void -unsetmediaopt(val, d, s, afp) - const char *val; - int d; - int s; - const struct afswtch *afp; +unsetmediaopt(const char *val, int d, int s, const struct afswtch *afp) { domediaopt(val, 1, s); } static void -domediaopt(val, clear, s) - const char *val; - int clear; - int s; +domediaopt(const char *val, int clear, int s) { struct ifmediareq ifmr; int *mwords, options; @@ -423,9 +406,7 @@ static struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = { }; static int -get_media_subtype(type, val) - int type; - const char *val; +get_media_subtype(int type, const char *val) { struct ifmedia_description *desc; struct ifmedia_type_to_subtype *ttos; @@ -449,9 +430,7 @@ get_media_subtype(type, val) } static int -get_media_options(type, val) - int type; - const char *val; +get_media_options(int type, const char *val) { struct ifmedia_description *desc; struct ifmedia_type_to_subtype *ttos; @@ -492,9 +471,7 @@ get_media_options(type, val) } static int -lookup_media_word(desc, val) - struct ifmedia_description *desc; - const char *val; +lookup_media_word(struct ifmedia_description *desc, const char *val) { for (; desc->ifmt_string != NULL; desc++) @@ -504,8 +481,7 @@ lookup_media_word(desc, val) return (-1); } -static struct ifmedia_description *get_toptype_desc(ifmw) - int ifmw; +static struct ifmedia_description *get_toptype_desc(int ifmw) { struct ifmedia_description *desc; @@ -516,8 +492,7 @@ static struct ifmedia_description *get_toptype_desc(ifmw) return desc; } -static struct ifmedia_type_to_subtype *get_toptype_ttos(ifmw) - int ifmw; +static struct ifmedia_type_to_subtype *get_toptype_ttos(int ifmw) { struct ifmedia_description *desc; struct ifmedia_type_to_subtype *ttos; @@ -530,9 +505,8 @@ static struct ifmedia_type_to_subtype *get_toptype_ttos(ifmw) return ttos; } -static struct ifmedia_description *get_subtype_desc(ifmw, ttos) - int ifmw; - struct ifmedia_type_to_subtype *ttos; +static struct ifmedia_description *get_subtype_desc(int ifmw, + struct ifmedia_type_to_subtype *ttos) { int i; struct ifmedia_description *desc; @@ -551,9 +525,7 @@ static struct ifmedia_description *get_subtype_desc(ifmw, ttos) } static void -print_media_word(ifmw, print_toptype) - int ifmw; - int print_toptype; +print_media_word(int ifmw, int print_toptype) { struct ifmedia_description *desc; struct ifmedia_type_to_subtype *ttos; @@ -607,8 +579,7 @@ print_media_word(ifmw, print_toptype) } static void -print_media_word_ifconfig(ifmw) - int ifmw; +print_media_word_ifconfig(int ifmw) { struct ifmedia_description *desc; struct ifmedia_type_to_subtype *ttos; diff --git a/sbin/ifconfig/ifvlan.c b/sbin/ifconfig/ifvlan.c index 5a1f1fd31b..0d6fcc2ee5 100644 --- a/sbin/ifconfig/ifvlan.c +++ b/sbin/ifconfig/ifvlan.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/ifconfig/ifvlan.c,v 1.2 1999/08/28 00:13:09 peter Exp $ - * $DragonFly: src/sbin/ifconfig/ifvlan.c,v 1.3 2003/08/08 04:18:38 dillon Exp $ + * $DragonFly: src/sbin/ifconfig/ifvlan.c,v 1.4 2003/09/28 14:39:18 hmp Exp $ * * $FreeBSD: src/sbin/ifconfig/ifvlan.c,v 1.2 1999/08/28 00:13:09 peter Exp $ */ @@ -63,9 +63,7 @@ static int __tag = 0; static int __have_tag = 0; -void vlan_status(s, info) - int s; - struct rt_addrinfo *info __unused; +void vlan_status(int s, struct rt_addrinfo *info __unused) { struct vlanreq vreq; @@ -82,10 +80,7 @@ void vlan_status(s, info) return; } -void setvlantag(val, d, s, afp) - const char *val; - int d, s; - const struct afswtch *afp; +void setvlantag(const char *val, int d, int s, const struct afswtch *afp) { u_int16_t tag; struct vlanreq vreq; @@ -107,10 +102,7 @@ void setvlantag(val, d, s, afp) return; } -void setvlandev(val, d, s, afp) - const char *val; - int d, s; - const struct afswtch *afp; +void setvlandev(const char *val, int d, int s, const struct afswtch *afp) { struct vlanreq vreq; @@ -132,10 +124,7 @@ void setvlandev(val, d, s, afp) return; } -void unsetvlandev(val, d, s, afp) - const char *val; - int d, s; - const struct afswtch *afp; +void unsetvlandev(const char *val, int d, int s, const struct afswtch *afp) { struct vlanreq vreq; diff --git a/sbin/init/init.c b/sbin/init/init.c index f8b2a27f77..3c51175d06 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)init.c 8.1 (Berkeley) 7/15/93 * $FreeBSD: src/sbin/init/init.c,v 1.38.2.8 2001/10/22 11:27:32 des Exp $ - * $DragonFly: src/sbin/init/init.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/init/init.c,v 1.3 2003/09/28 14:39:18 hmp Exp $ */ #include @@ -180,9 +180,7 @@ DB *session_db; * The mother of all processes. */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int c; struct sigaction sa; @@ -315,25 +313,14 @@ invalid: * Associate a function with a signal handler. */ void -#ifdef __STDC__ handle(sig_t handler, ...) -#else -handle(va_alist) - va_dcl -#endif { int sig; struct sigaction sa; sigset_t mask_everything; va_list ap; -#ifndef __STDC__ - sig_t handler; - va_start(ap); - handler = va_arg(ap, sig_t); -#else va_start(ap, handler); -#endif sa.sa_handler = handler; sigfillset(&mask_everything); @@ -351,23 +338,12 @@ handle(va_alist) * Delete a set of signals from a mask. */ void -#ifdef __STDC__ delset(sigset_t *maskp, ...) -#else -delset(va_alist) - va_dcl -#endif { int sig; va_list ap; -#ifndef __STDC__ - sigset_t *maskp; - va_start(ap); - maskp = va_arg(ap, sigset_t *); -#else va_start(ap, maskp); -#endif while ((sig = va_arg(ap, int)) != NULL) sigdelset(maskp, sig); @@ -380,22 +356,11 @@ delset(va_alist) * NB: should send a message to the session logger to avoid blocking. */ void -#ifdef __STDC__ stall(char *message, ...) -#else -stall(va_alist) - va_dcl -#endif { va_list ap; -#ifndef __STDC__ - char *message; - va_start(ap); - message = va_arg(ap, char *); -#else va_start(ap, message); -#endif vsyslog(LOG_ALERT, message, ap); va_end(ap); @@ -408,22 +373,11 @@ stall(va_alist) * NB: should send a message to the session logger to avoid blocking. */ void -#ifdef __STDC__ warning(char *message, ...) -#else -warning(va_alist) - va_dcl -#endif { va_list ap; -#ifndef __STDC__ - char *message; - va_start(ap); - message = va_arg(ap, char *); -#else va_start(ap, message); -#endif vsyslog(LOG_ALERT, message, ap); va_end(ap); @@ -434,22 +388,11 @@ warning(va_alist) * NB: should send a message to the session logger to avoid blocking. */ void -#ifdef __STDC__ emergency(char *message, ...) -#else -emergency(va_alist) - va_dcl -#endif { va_list ap; -#ifndef __STDC__ - char *message; - va_start(ap); - message = va_arg(ap, char *); -#else va_start(ap, message); -#endif vsyslog(LOG_EMERG, message, ap); va_end(ap); @@ -462,8 +405,7 @@ emergency(va_alist) * We tolerate up to 25 of these, then throw in the towel. */ void -badsys(sig) - int sig; +badsys(int sig) { static int badcount = 0; @@ -476,8 +418,7 @@ badsys(sig) * Catch an unexpected signal. */ void -disaster(sig) - int sig; +disaster(int sig) { emergency("fatal signal: %s", (unsigned)sig < NSIG ? sys_siglist[sig] : "unknown signal"); @@ -490,7 +431,7 @@ disaster(sig) * Get the security level of the kernel. */ int -getsecuritylevel() +getsecuritylevel(void) { #ifdef KERN_SECURELVL int name[2], curlevel; @@ -514,8 +455,7 @@ getsecuritylevel() * Set the security level of the kernel. */ void -setsecuritylevel(newlevel) - int newlevel; +setsecuritylevel(int newlevel) { #ifdef KERN_SECURELVL int name[2], curlevel; @@ -543,8 +483,7 @@ setsecuritylevel(newlevel) * The initial state is passed as an argument. */ void -transition(s) - state_t s; +transition(state_t s) { for (;;) s = (state_t) (*s)(); @@ -555,8 +494,7 @@ transition(s) * NB: should send a message to the session logger to avoid blocking. */ void -clear_session_logs(sp) - session_t *sp; +clear_session_logs(session_t *sp) { char *line = sp->se_device + sizeof(_PATH_DEV) - 1; @@ -569,8 +507,7 @@ clear_session_logs(sp) * Only called by children of init after forking. */ void -setctty(name) - char *name; +setctty(char *name) { int fd; @@ -589,7 +526,7 @@ setctty(name) * Bring the system up single user. */ state_func_t -single_user() +single_user(void) { pid_t pid, wpid; int status; @@ -740,7 +677,7 @@ single_user() * Run the system startup script. */ state_func_t -runcom() +runcom(void) { pid_t pid, wpid; int status; @@ -835,7 +772,7 @@ runcom() * NB: We could pass in the size here; is it necessary? */ int -start_session_db() +start_session_db(void) { if (session_db && (*session_db->close)(session_db)) emergency("session database close: %s", strerror(errno)); @@ -851,8 +788,7 @@ start_session_db() * Add a new login session. */ void -add_session(sp) - session_t *sp; +add_session(session_t *sp) { DBT key; DBT data; @@ -870,8 +806,7 @@ add_session(sp) * Delete an old login session. */ void -del_session(sp) - session_t *sp; +del_session(session_t *sp) { DBT key; @@ -886,12 +821,7 @@ del_session(sp) * Look up a login session by pid. */ session_t * -#ifdef __STDC__ find_session(pid_t pid) -#else -find_session(pid) - pid_t pid; -#endif { DBT key; DBT data; @@ -909,8 +839,7 @@ find_session(pid) * Construct an argument vector from a command line. */ char ** -construct_argv(command) - char *command; +construct_argv(char *command) { char *strk (char *); register int argc = 0; @@ -930,8 +859,7 @@ construct_argv(command) * Deallocate a session descriptor. */ void -free_session(sp) - register session_t *sp; +free_session(register session_t *sp) { free(sp->se_device); if (sp->se_getty) { @@ -954,10 +882,7 @@ free_session(sp) * Mark it SE_PRESENT. */ session_t * -new_session(sprev, session_index, typ) - session_t *sprev; - int session_index; - register struct ttyent *typ; +new_session(session_t *sprev, int session_index, register struct ttyent *typ) { register session_t *sp; int fd; @@ -1008,9 +933,7 @@ new_session(sprev, session_index, typ) * Calculate getty and if useful window argv vectors. */ int -setupargv(sp, typ) - session_t *sp; - struct ttyent *typ; +setupargv(session_t *sp, struct ttyent *typ) { if (sp->se_getty) { @@ -1059,7 +982,7 @@ setupargv(sp, typ) * Walk the list of ttys and create sessions for each active line. */ state_func_t -read_ttys() +read_ttys(void) { int session_index = 0; register session_t *sp, *snext; @@ -1096,8 +1019,7 @@ read_ttys() * Start a window system running. */ void -start_window_system(sp) - session_t *sp; +start_window_system(session_t *sp) { pid_t pid; sigset_t mask; @@ -1141,8 +1063,7 @@ start_window_system(sp) * Start a login session running. */ pid_t -start_getty(sp) - session_t *sp; +start_getty(session_t *sp) { pid_t pid; sigset_t mask; @@ -1207,12 +1128,7 @@ start_getty(sp) * If an exiting login, start a new login running. */ void -#ifdef __STDC__ collect_child(pid_t pid) -#else -collect_child(pid) - pid_t pid; -#endif { register session_t *sp, *sprev, *snext; @@ -1252,8 +1168,7 @@ collect_child(pid) * Catch a signal and request a state transition. */ void -transition_handler(sig) - int sig; +transition_handler(int sig) { switch (sig) { @@ -1282,7 +1197,7 @@ transition_handler(sig) * Take the system multiuser. */ state_func_t -multi_user() +multi_user(void) { pid_t pid; register session_t *sp; @@ -1322,7 +1237,7 @@ multi_user() * This is an (n*2)+(n^2) algorithm. We hope it isn't run often... */ state_func_t -clean_ttys() +clean_ttys(void) { register session_t *sp, *sprev; register struct ttyent *typ; @@ -1420,7 +1335,7 @@ clean_ttys() * Block further logins. */ state_func_t -catatonia() +catatonia(void) { register session_t *sp; @@ -1434,8 +1349,7 @@ catatonia() * Note SIGALRM. */ void -alrm_handler(sig) - int sig; +alrm_handler(int sig) { (void)sig; clang = 1; @@ -1445,7 +1359,7 @@ alrm_handler(sig) * Bring the system down to single user. */ state_func_t -death() +death(void) { register session_t *sp; register int i; @@ -1493,7 +1407,7 @@ death() * >0 some error (exit code) */ int -runshutdown() +runshutdown(void) { pid_t pid, wpid; int status; @@ -1668,8 +1582,7 @@ strk (char *p) #ifdef LOGIN_CAP void -setprocresources(cname) - const char *cname; +setprocresources(const char *cname) { login_cap_t *lc; if ((lc = login_getclassbyname(cname, NULL)) != NULL) { diff --git a/sbin/ip6fw/ip6fw.c b/sbin/ip6fw/ip6fw.c index ba536a37aa..b5d406edd4 100644 --- a/sbin/ip6fw/ip6fw.c +++ b/sbin/ip6fw/ip6fw.c @@ -49,7 +49,7 @@ * * $Id: ip6fw.c,v 1.1.2.2.2.2 1999/05/14 05:13:50 shin Exp $ * $FreeBSD: src/sbin/ip6fw/ip6fw.c,v 1.1.2.9 2003/04/05 10:54:51 ume Exp $ - * $DragonFly: src/sbin/ip6fw/ip6fw.c,v 1.3 2003/08/08 04:18:38 dillon Exp $ + * $DragonFly: src/sbin/ip6fw/ip6fw.c,v 1.4 2003/09/28 14:39:18 hmp Exp $ */ #include @@ -158,10 +158,7 @@ struct in6_addr *plen2mask(int n) } void -print_port(prot, port, comma) - u_char prot; - u_short port; - const char *comma; +print_port(u_char prot, u_short port, const char *comma) { struct servent *se; struct protoent *pe; @@ -442,9 +439,7 @@ show_ip6fw(struct ip6_fw *chain) } void -list(ac, av) - int ac; - char **av; +list(int ac, char **av) { struct ip6_fw *r, *rules; int l,i; @@ -544,9 +539,7 @@ show_usage(const char *fmt, ...) } static int -lookup_host (host, addr, family) - char *host; - u_char *addr; +lookup_host (char *host, u_char *addr, int family) { struct hostent *he; @@ -559,10 +552,7 @@ lookup_host (host, addr, family) } void -fill_ip6(ipno, mask, acp, avp) - struct in6_addr *ipno, *mask; - int *acp; - char ***avp; +fill_ip6(struct in6_addr *ipno, struct in6_addr *mask, int *acp, char ***avp) { int ac = *acp; char **av = *avp; @@ -624,8 +614,7 @@ fill_reject_code6(u_short *codep, char *str) } static void -add_port(cnt, ptr, off, port) - u_short *cnt, *ptr, off, port; +add_port(u_short *cnt, u_short *ptr, u_short off, u_short port) { if (off + *cnt >= IPV6_FW_MAX_PORTS) errx(1, "too many ports (max is %d)", IPV6_FW_MAX_PORTS); @@ -665,9 +654,7 @@ lookup_port(const char *arg, int test, int nodash) } int -fill_port(cnt, ptr, off, arg) - u_short *cnt, *ptr, off; - char *arg; +fill_port(u_short *cnt, u_short *ptr, u_short off, char *arg) { char *s; int initial_range = 0; @@ -697,9 +684,7 @@ fill_port(cnt, ptr, off, arg) } void -fill_tcpflag(set, reset, vp) - u_char *set, *reset; - char **vp; +fill_tcpflag(u_char *set, u_char *reset, char **vp) { char *p = *vp,*q; u_char *d; @@ -766,10 +751,7 @@ fill_ip6opt(u_char *set, u_char *reset, char **vp) } void -fill_icmptypes(types, vp, fw_flg) - u_long *types; - char **vp; - u_short *fw_flg; +fill_icmptypes(u_long *types, char **vp, u_short *fw_flg) { char *c = *vp; @@ -795,9 +777,7 @@ fill_icmptypes(types, vp, fw_flg) } void -delete(ac,av) - int ac; - char **av; +delete(int ac, char **av) { struct ip6_fw rule; int i; @@ -866,9 +846,7 @@ fill_iface(char *which, union ip6_fw_if *ifu, int *byname, int ac, char *arg) } static void -add(ac,av) - int ac; - char **av; +add(int ac, char **av) { struct ip6_fw rule; int i; @@ -1156,9 +1134,7 @@ badviacombo: } static void -zero (ac, av) - int ac; - char **av; +zero (int ac, char **av) { av++; ac--; @@ -1195,9 +1171,7 @@ zero (ac, av) } int -ip6fw_main(ac,av) - int ac; - char **av; +ip6fw_main(int ac, char **av) { int ch; extern int optind; @@ -1285,9 +1259,7 @@ ip6fw_main(ac,av) } int -main(ac, av) - int ac; - char **av; +main(int ac, char **av) { #define MAX_ARGS 32 #define WHITESP " \t\f\v\n\r" diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index cc2170c235..009adabea9 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -28,7 +28,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/ldconfig/ldconfig.c,v 1.31.2.3 2001/07/11 23:59:10 obrien Exp $ - * $DragonFly: src/sbin/ldconfig/ldconfig.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/ldconfig/ldconfig.c,v 1.3 2003/09/28 14:39:18 hmp Exp $ */ #include @@ -94,9 +94,7 @@ static int readhints __P((void)); static void usage __P((void)); int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char **argv) { int i, c; int rval = 0; @@ -208,7 +206,7 @@ char *argv[]; } static void -usage() +usage(void) { fprintf(stderr, "usage: ldconfig [-aout | -elf] [-Rimrsv] [-f hints_file] [dir | file ...]\n"); @@ -216,9 +214,7 @@ usage() } int -dofile(fname, silent) -char *fname; -int silent; +dofile(char *fname, int silent) { FILE *hfp; char buf[MAXPATHLEN]; @@ -255,9 +251,7 @@ int silent; } int -dodir(dir, silent) -char *dir; -int silent; +dodir(char *dir, int silent) { DIR *dd; struct dirent *dp; @@ -314,9 +308,7 @@ int silent; } static void -enter(dir, file, name, dewey, ndewey) -char *dir, *file, *name; -int dewey[], ndewey; +enter(char *dir, char *file, char *name, int *dewey, int ndewey) { struct shlib_list *shp; @@ -364,9 +356,7 @@ int dewey[], ndewey; int -hinthash(cp, vmajor) -char *cp; -int vmajor; +hinthash(char *cp, int vmajor) { int k = 0; @@ -379,7 +369,7 @@ int vmajor; } int -buildhints() +buildhints(void) { struct hints_header hdr; struct hints_bucket *blist; @@ -511,7 +501,7 @@ buildhints() } static int -readhints() +readhints(void) { int fd; void *addr; @@ -602,7 +592,7 @@ readhints() } static void -listhints() +listhints(void) { struct shlib_list *shp; int i; diff --git a/sbin/mknod/mknod.c b/sbin/mknod/mknod.c index 4142edbec7..f2d12f6581 100644 --- a/sbin/mknod/mknod.c +++ b/sbin/mknod/mknod.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)mknod.c 8.1 (Berkeley) 6/5/93 * $FreeBSD: src/sbin/mknod/mknod.c,v 1.13 2000/01/06 17:51:46 obrien Exp $ - * $DragonFly: src/sbin/mknod/mknod.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/mknod/mknod.c,v 1.3 2003/09/28 14:39:18 hmp Exp $ */ #include @@ -52,7 +52,7 @@ #include static void -usage() +usage(void) { (void)fprintf(stderr, @@ -61,8 +61,7 @@ usage() } static u_long -id(name, type) - char *name, *type; +id(char *name, char *type) { u_long val; char *ep; @@ -81,8 +80,7 @@ id(name, type) } static gid_t -a_gid(s) - char *s; +a_gid(char *s) { struct group *gr; @@ -92,8 +90,7 @@ a_gid(s) } static uid_t -a_uid(s) - char *s; +a_uid(char *s) { struct passwd *pw; @@ -103,9 +100,7 @@ a_uid(s) } int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int range_error; uid_t uid; diff --git a/sbin/mount/getmntopts.c b/sbin/mount/getmntopts.c index ee2a03189f..562104c58f 100644 --- a/sbin/mount/getmntopts.c +++ b/sbin/mount/getmntopts.c @@ -32,7 +32,7 @@ * * @(#)getmntopts.c 8.3 (Berkeley) 3/29/95 * $FreeBSD: src/sbin/mount/getmntopts.c,v 1.9 1999/10/09 11:54:06 phk Exp $ - * $DragonFly: src/sbin/mount/getmntopts.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/mount/getmntopts.c,v 1.3 2003/09/28 14:39:18 hmp Exp $ */ #include @@ -49,11 +49,8 @@ int getmnt_silent = 0; void -getmntopts(options, m0, flagp, altflagp) - const char *options; - const struct mntopt *m0; - int *flagp; - int *altflagp; +getmntopts(const char *options, const struct mntopt *m0, int *flagp, + int *altflagp) { const struct mntopt *m; int negative, len; @@ -106,9 +103,7 @@ getmntopts(options, m0, flagp, altflagp) } void -rmslashes(rrpin, rrpout) - char *rrpin; - char *rrpout; +rmslashes(char *rrpin, char *rrpout) { char *rrpoutstart; @@ -128,9 +123,7 @@ rmslashes(rrpin, rrpout) } void -checkpath(path, resolved) - const char *path; - char *resolved; +checkpath(const char *path, char *resolved) { struct stat sb; diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 1caa632f6e..4ca1665c03 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1989, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount.c 8.25 (Berkeley) 5/8/95 * $FreeBSD: src/sbin/mount/mount.c,v 1.39.2.3 2001/08/01 08:26:23 obrien Exp $ - * $DragonFly: src/sbin/mount/mount.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/mount/mount.c,v 1.3 2003/09/28 14:39:18 hmp Exp $ */ #include @@ -113,9 +113,7 @@ remountable_fs_names[] = { }; int -main(argc, argv) - int argc; - char * const argv[]; +main(int argc, char **argv) { const char *mntfromname, **vfslist, *vfstype; struct fstab *fs; @@ -301,10 +299,7 @@ main(argc, argv) } int -ismounted(fs, mntbuf, mntsize) - struct fstab *fs; - struct statfs *mntbuf; - int mntsize; +ismounted(struct fstab *fs, struct statfs *mntbuf, int mntsize) { int i; @@ -321,8 +316,7 @@ ismounted(fs, mntbuf, mntsize) } int -isremountable(vfsname) - const char *vfsname; +isremountable(const char *vfsname) { const char **cp; @@ -333,8 +327,7 @@ isremountable(vfsname) } int -hasopt(mntopts, option) - const char *mntopts, *option; +hasopt(const char *mntopts, const char *option) { int negative, found; char *opt, *optbuf; @@ -358,9 +351,8 @@ hasopt(mntopts, option) } int -mountfs(vfstype, spec, name, flags, options, mntopts) - const char *vfstype, *spec, *name, *options, *mntopts; - int flags; +mountfs(const char *vfstype, const char *spec, const char *name, int flags, + const char *options, const char *mntopts) { /* List of directories containing mount_xxx subcommands. */ static const char *edirs[] = { @@ -490,8 +482,7 @@ mountfs(vfstype, spec, name, flags, options, mntopts) } void -prmount(sfp) - struct statfs *sfp; +prmount(struct statfs *sfp) { int flags; struct opt *o; @@ -525,8 +516,7 @@ prmount(sfp) } struct statfs * -getmntpt(name) - const char *name; +getmntpt(const char *name) { struct statfs *mntbuf; int i, mntsize; @@ -541,9 +531,7 @@ getmntpt(name) } char * -catopt(s0, s1) - char *s0; - const char *s1; +catopt(char *s0, const char *s1) { size_t i; char *cp; @@ -565,10 +553,7 @@ catopt(s0, s1) } void -mangle(options, argcp, argv) - char *options; - int *argcp; - const char **argv; +mangle(char *options, int *argcp, const char **argv) { char *p, *s; int argc; @@ -594,10 +579,7 @@ mangle(options, argcp, argv) char * -update_options(opts, fstab, curflags) - char *opts; - char *fstab; - int curflags; +update_options(char *opts, char *fstab, int curflags) { char *o, *p; char *cur; @@ -652,9 +634,7 @@ update_options(opts, fstab, curflags) } void -remopt(string, opt) - char *string; - const char *opt; +remopt(char *string, const char *opt) { char *o, *p, *r; @@ -676,7 +656,7 @@ remopt(string, opt) } void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n", @@ -687,8 +667,7 @@ usage() } void -putfsent(ent) - const struct statfs *ent; +putfsent(const struct statfs *ent) { struct fstab *fst; char *opts; @@ -713,8 +692,7 @@ putfsent(ent) char * -flags2opts(flags) - int flags; +flags2opts(int flags) { char *res; diff --git a/sbin/mount/mount_ufs.c b/sbin/mount/mount_ufs.c index 48770df9fb..01301db924 100644 --- a/sbin/mount/mount_ufs.c +++ b/sbin/mount/mount_ufs.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_ufs.c 8.4 (Berkeley) 4/26/95 * $FreeBSD: src/sbin/mount/mount_ufs.c,v 1.16.2.3 2001/08/01 08:27:29 obrien Exp $ - * $DragonFly: src/sbin/mount/mount_ufs.c,v 1.3 2003/08/08 04:18:39 dillon Exp $ + * $DragonFly: src/sbin/mount/mount_ufs.c,v 1.4 2003/09/28 14:39:18 hmp Exp $ */ #include @@ -62,9 +62,7 @@ static struct mntopt mopts[] = { }; int -mount_ufs(argc, argv) - int argc; - char * const argv[]; +mount_ufs(int argc, char *const *argv) { struct ufs_args args; int ch, mntflags; @@ -138,7 +136,7 @@ mount_ufs(argc, argv) } static void -ufs_usage() +ufs_usage(void) { (void)fprintf(stderr, "usage: mount_ufs [-o options] special node\n"); exit(1); diff --git a/sbin/mount/vfslist.c b/sbin/mount/vfslist.c index c473463e2e..d421cd4d8c 100644 --- a/sbin/mount/vfslist.c +++ b/sbin/mount/vfslist.c @@ -32,7 +32,7 @@ * * @(#)vfslist.c 8.1 (Berkeley) 5/8/95 * $FreeBSD: src/sbin/mount/vfslist.c,v 1.4 1999/08/28 00:13:27 peter Exp $ - * $DragonFly: src/sbin/mount/vfslist.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/mount/vfslist.c,v 1.3 2003/09/28 14:39:18 hmp Exp $ */ #include @@ -44,9 +44,7 @@ static int skipvfs; int -checkvfsname(vfsname, vfslist) - const char *vfsname; - const char **vfslist; +checkvfsname(const char *vfsname, const char **vfslist) { if (vfslist == NULL) @@ -60,8 +58,7 @@ checkvfsname(vfsname, vfslist) } const char ** -makevfslist(fslist) - char *fslist; +makevfslist(char *fslist) { const char **av; int i; diff --git a/sbin/mount_ext2fs/mount_ext2fs.c b/sbin/mount_ext2fs/mount_ext2fs.c index 3f7a1eed38..b9716a0d0a 100644 --- a/sbin/mount_ext2fs/mount_ext2fs.c +++ b/sbin/mount_ext2fs/mount_ext2fs.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_lfs.c 8.3 (Berkeley) 3/27/94 * $FreeBSD: src/sbin/mount_ext2fs/mount_ext2fs.c,v 1.11 1999/10/09 11:54:09 phk Exp $ - * $DragonFly: src/sbin/mount_ext2fs/mount_ext2fs.c,v 1.3 2003/08/08 04:18:39 dillon Exp $ + * $DragonFly: src/sbin/mount_ext2fs/mount_ext2fs.c,v 1.4 2003/09/28 14:39:19 hmp Exp $ */ #include @@ -61,9 +61,7 @@ struct mntopt mopts[] = { static void usage __P((void)) __dead2; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct ufs_args args; int ch, mntflags; @@ -122,7 +120,7 @@ main(argc, argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: mount_ext2fs [-o options] special node\n"); diff --git a/sbin/mount_hpfs/mount_hpfs.c b/sbin/mount_hpfs/mount_hpfs.c index c1d70594a4..2f05ee6efc 100644 --- a/sbin/mount_hpfs/mount_hpfs.c +++ b/sbin/mount_hpfs/mount_hpfs.c @@ -29,7 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/mount_hpfs/mount_hpfs.c,v 1.1 1999/12/09 19:09:15 semenu Exp $ - * $DragonFly: src/sbin/mount_hpfs/mount_hpfs.c,v 1.3 2003/08/08 04:18:39 dillon Exp $ + * $DragonFly: src/sbin/mount_hpfs/mount_hpfs.c,v 1.4 2003/09/28 14:39:19 hmp Exp $ */ #include @@ -61,9 +61,7 @@ static void usage __P((void)) __dead2; static void load_u2wtable __P((struct hpfs_args *, char *)); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { struct hpfs_args args; struct stat sb; @@ -184,8 +182,7 @@ main(argc, argv) } gid_t -a_gid(s) - char *s; +a_gid(char *s) { struct group *gr; char *gname; @@ -204,8 +201,7 @@ a_gid(s) } uid_t -a_uid(s) - char *s; +a_uid(char *s) { struct passwd *pw; char *uname; @@ -224,8 +220,7 @@ a_uid(s) } mode_t -a_mask(s) - char *s; +a_mask(char *s) { int done, rv=0; char *ep; @@ -241,16 +236,14 @@ a_mask(s) } void -usage() +usage(void) { fprintf(stderr, "usage: mount_hpfs [-u user] [-g group] [-m mask] bdev dir\n"); exit(EX_USAGE); } void -load_u2wtable (pargs, name) - struct hpfs_args *pargs; - char *name; +load_u2wtable (struct hpfs_args *pargs, char *name) { FILE *f; int i, code; diff --git a/sbin/mount_msdos/mount_msdos.c b/sbin/mount_msdos/mount_msdos.c index 5994d004de..710c616c41 100644 --- a/sbin/mount_msdos/mount_msdos.c +++ b/sbin/mount_msdos/mount_msdos.c @@ -30,7 +30,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/mount_msdos/mount_msdos.c,v 1.19.2.1 2000/07/20 10:35:13 kris Exp $ - * $DragonFly: src/sbin/mount_msdos/mount_msdos.c,v 1.3 2003/08/08 04:18:39 dillon Exp $ + * $DragonFly: src/sbin/mount_msdos/mount_msdos.c,v 1.4 2003/09/28 14:39:19 hmp Exp $ */ #include @@ -80,9 +80,7 @@ static void load_u2wtable __P((struct msdosfs_args *, char *)); static void load_ultable __P((struct msdosfs_args *, char *)); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { struct msdosfs_args args; struct stat sb; @@ -188,8 +186,7 @@ main(argc, argv) } gid_t -a_gid(s) - char *s; +a_gid(char *s) { struct group *gr; char *gname; @@ -208,8 +205,7 @@ a_gid(s) } uid_t -a_uid(s) - char *s; +a_uid(char *s) { struct passwd *pw; char *uname; @@ -228,8 +224,7 @@ a_uid(s) } mode_t -a_mask(s) - char *s; +a_mask(char *s) { int done, rv; char *ep; @@ -246,7 +241,7 @@ a_mask(s) } void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n", "usage: mount_msdos [-o options] [-u user] [-g group] [-m mask]", @@ -255,9 +250,7 @@ usage() } void -load_u2wtable (pargs, name) - struct msdosfs_args *pargs; - char *name; +load_u2wtable (struct msdosfs_args *pargs, char *name) { FILE *f; int i, j, code[8]; @@ -322,9 +315,7 @@ code, code + 1, code + 2, code + 3, code + 4, code + 5, code + 6, code + 7) != 8 } void -load_ultable (pargs, name) - struct msdosfs_args *pargs; - char *name; +load_ultable (struct msdosfs_args *pargs, char *name) { int i; diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 603ddd8f49..b68c6fe8aa 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_nfs.c 8.11 (Berkeley) 5/4/95 * $FreeBSD: src/sbin/mount_nfs/mount_nfs.c,v 1.36.2.6 2003/05/13 14:45:40 trhodes Exp $ - * $DragonFly: src/sbin/mount_nfs/mount_nfs.c,v 1.4 2003/08/08 04:18:39 dillon Exp $ + * $DragonFly: src/sbin/mount_nfs/mount_nfs.c,v 1.5 2003/09/28 14:39:19 hmp Exp $ */ #include @@ -237,9 +237,7 @@ set_flags(int* altflags, int* nfsflags, int dir) } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register int c; register struct nfs_args *nfsargsp; @@ -565,9 +563,7 @@ main(argc, argv) } int -getnfsargs(spec, nfsargsp) - char *spec; - struct nfs_args *nfsargsp; +getnfsargs(char *spec, struct nfs_args *nfsargsp) { struct hostent *hp; struct sockaddr_in saddr; @@ -879,17 +875,13 @@ returncode(enum clnt_stat stat, struct rpc_err *rpcerr) * xdr routines for mount rpc's */ int -xdr_dir(xdrsp, dirp) - XDR *xdrsp; - char *dirp; +xdr_dir(XDR *xdrsp, char *dirp) { return (xdr_string(xdrsp, &dirp, RPCMNT_PATHLEN)); } int -xdr_fh(xdrsp, np) - XDR *xdrsp; - register struct nfhret *np; +xdr_fh(XDR *xdrsp, register struct nfhret *np) { register int i; long auth, authcnt, authfnd = 0; @@ -929,7 +921,7 @@ xdr_fh(xdrsp, np) } void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: mount_nfs [-23KNPTUbcdilqs] [-D deadthresh] [-I readdirsize]", diff --git a/sbin/mount_ntfs/mount_ntfs.c b/sbin/mount_ntfs/mount_ntfs.c index a89f37a07f..45d8d94bd2 100644 --- a/sbin/mount_ntfs/mount_ntfs.c +++ b/sbin/mount_ntfs/mount_ntfs.c @@ -29,7 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/mount_ntfs/mount_ntfs.c,v 1.3.2.2 2001/10/12 22:08:43 semenu Exp $ - * $DragonFly: src/sbin/mount_ntfs/mount_ntfs.c,v 1.3 2003/08/08 04:18:40 dillon Exp $ + * $DragonFly: src/sbin/mount_ntfs/mount_ntfs.c,v 1.4 2003/09/28 14:39:19 hmp Exp $ * */ @@ -65,9 +65,7 @@ static void usage __P((void)) __dead2; static void load_u2wtable __P((struct ntfs_args *, char *)); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { struct ntfs_args args; struct stat sb; @@ -182,8 +180,7 @@ main(argc, argv) } gid_t -a_gid(s) - char *s; +a_gid(char *s) { struct group *gr; char *gname; @@ -202,8 +199,7 @@ a_gid(s) } uid_t -a_uid(s) - char *s; +a_uid(char *s) { struct passwd *pw; char *uname; @@ -222,8 +218,7 @@ a_uid(s) } mode_t -a_mask(s) - char *s; +a_mask(char *s) { int done, rv=0; char *ep; @@ -239,16 +234,14 @@ a_mask(s) } void -usage() +usage(void) { fprintf(stderr, "usage: mount_ntfs [-a] [-i] [-u user] [-g group] [-m mask] [-W u2wtable] bdev dir\n"); exit(EX_USAGE); } void -load_u2wtable (pargs, name) - struct ntfs_args *pargs; - char *name; +load_u2wtable (struct ntfs_args *pargs, char *name) { FILE *f; int i, j, code[8]; diff --git a/sbin/mount_null/mount_null.c b/sbin/mount_null/mount_null.c index 4c1a349b12..11ce4948b6 100644 --- a/sbin/mount_null/mount_null.c +++ b/sbin/mount_null/mount_null.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_null.c 8.6 (Berkeley) 4/26/95 * $FreeBSD: src/sbin/mount_null/mount_null.c,v 1.13 1999/10/09 11:54:11 phk Exp $ - * $DragonFly: src/sbin/mount_null/mount_null.c,v 1.3 2003/08/08 04:18:40 dillon Exp $ + * $DragonFly: src/sbin/mount_null/mount_null.c,v 1.4 2003/09/28 14:39:19 hmp Exp $ */ #include @@ -61,9 +61,7 @@ int subdir __P((const char *, const char *)); static void usage __P((void)) __dead2; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct null_args args; int ch, mntflags; @@ -114,9 +112,7 @@ main(argc, argv) } int -subdir(p, dir) - const char *p; - const char *dir; +subdir(const char *p, const char *dir) { int l; @@ -131,7 +127,7 @@ subdir(p, dir) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: mount_null [-o options] target_fs mount_point\n"); diff --git a/sbin/mount_portal/activate.c b/sbin/mount_portal/activate.c index cace210f0e..b0024b6d0f 100644 --- a/sbin/mount_portal/activate.c +++ b/sbin/mount_portal/activate.c @@ -37,7 +37,7 @@ * @(#)activate.c 8.3 (Berkeley) 4/28/95 * * $FreeBSD: src/sbin/mount_portal/activate.c,v 1.7 1999/08/28 00:13:35 peter Exp $ - * $DragonFly: src/sbin/mount_portal/activate.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/mount_portal/activate.c,v 1.3 2003/09/28 14:39:19 hmp Exp $ */ #include @@ -55,12 +55,8 @@ * Scan the providers list and call the * appropriate function. */ -static int activate_argv(pcr, key, v, so, fdp) -struct portal_cred *pcr; -char *key; -char **v; -int so; -int *fdp; +static int activate_argv(struct portal_cred *pcr, char *key, char **v, int so, + int *fdp) { provider *pr; @@ -71,11 +67,7 @@ int *fdp; return (ENOENT); } -static int get_request(so, pcr, key, klen) -int so; -struct portal_cred *pcr; -char *key; -int klen; +static int get_request(int so, struct portal_cred *pcr, char *key, int klen) { struct iovec iov[2]; struct msghdr msg; @@ -103,10 +95,7 @@ int klen; return (0); } -static void send_reply(so, fd, error) -int so; -int fd; -int error; +static void send_reply(int so, int fd, int error) { int n; struct iovec iov; @@ -162,9 +151,7 @@ int error; (void) close(fd); } -void activate(q, so) -qelem *q; -int so; +void activate(qelem *q, int so) { struct portal_cred pcred; char key[MAXPATHLEN+1]; diff --git a/sbin/mount_portal/conf.c b/sbin/mount_portal/conf.c index 1f61f8f5dc..e80d08ba0a 100644 --- a/sbin/mount_portal/conf.c +++ b/sbin/mount_portal/conf.c @@ -37,7 +37,7 @@ * @(#)conf.c 8.2 (Berkeley) 3/27/94 * * $FreeBSD: src/sbin/mount_portal/conf.c,v 1.8 1999/08/28 00:13:35 peter Exp $ - * $DragonFly: src/sbin/mount_portal/conf.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/mount_portal/conf.c,v 1.3 2003/09/28 14:39:19 hmp Exp $ */ #include @@ -74,8 +74,7 @@ static path *curp; /* XXX for regerror */ * Add an element to a 2-way list, * just after (pred) */ -static void ins_que(elem, pred) -qelem *elem, *pred; +static void ins_que(qelem *elem, qelem *pred) { qelem *p = pred->q_forw; elem->q_back = pred; @@ -87,8 +86,7 @@ qelem *elem, *pred; /* * Remove an element from a 2-way list */ -static void rem_que(elem) -qelem *elem; +static void rem_que(qelem *elem) { qelem *p = elem->q_forw; qelem *p2 = elem->q_back; @@ -99,8 +97,7 @@ qelem *elem; /* * Error checking malloc */ -static void *xmalloc(siz) -unsigned siz; +static void *xmalloc(unsigned siz) { void *p = malloc(siz); if (p) @@ -116,9 +113,7 @@ unsigned siz; * not found then the path is added to the end of the list * and 1 is returned. */ -static int pinsert(p0, q0) -path *p0; -qelem *q0; +static int pinsert(path *p0, qelem *q0) { qelem *q; @@ -135,9 +130,7 @@ qelem *q0; } -static path *palloc(cline, lno) -char *cline; -int lno; +static path *palloc(char *cline, int lno) { int c; char *s; @@ -223,8 +216,7 @@ int lno; /* * Free a path structure */ -static void pfree(p) -path *p; +static void pfree(path *p) { free(p->p_args); if (p->p_rxvalid) { @@ -238,9 +230,7 @@ path *p; * Discard all currently held path structures on q0. * and add all the ones on xq. */ -static void preplace(q0, xq) -qelem *q0; -qelem *xq; +static void preplace(qelem *q0, qelem *xq) { /* * While the list is not empty, @@ -263,9 +253,7 @@ qelem *xq; * Read the lines from the configuration file and * add them to the list of paths. */ -static void readfp(q0, fp) -qelem *q0; -FILE *fp; +static void readfp(qelem *q0, FILE *fp) { char cline[LINE_MAX]; int nread = 0; @@ -300,9 +288,7 @@ FILE *fp; * the existing path list with the new version. * If the file is not readable, then no changes take place */ -void conf_read(q, conf) -qelem *q; -char *conf; +void conf_read(qelem *q, char *conf) { FILE *fp = fopen(conf, "r"); if (fp) { @@ -316,9 +302,7 @@ char *conf; } -char **conf_match(q0, key) -qelem *q0; -char *key; +char **conf_match(qelem *q0, char *key) { qelem *q; diff --git a/sbin/mount_portal/mount_portal.c b/sbin/mount_portal/mount_portal.c index 01cfb1e98e..689aac6c13 100644 --- a/sbin/mount_portal/mount_portal.c +++ b/sbin/mount_portal/mount_portal.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_portal.c 8.6 (Berkeley) 4/26/95 * $FreeBSD: src/sbin/mount_portal/mount_portal.c,v 1.16 1999/10/09 11:54:11 phk Exp $ - * $DragonFly: src/sbin/mount_portal/mount_portal.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/mount_portal/mount_portal.c,v 1.3 2003/09/28 14:39:19 hmp Exp $ */ #include @@ -68,14 +68,12 @@ static void usage __P((void)) __dead2; static sig_atomic_t readcf; /* Set when SIGHUP received */ -static void sighup(sig) -int sig; +static void sighup(int sig) { readcf ++; } -static void sigchld(sig) -int sig; +static void sigchld(int sig) { pid_t pid; @@ -89,9 +87,7 @@ int sig; } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct portal_args args; struct sockaddr_un un; @@ -278,7 +274,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: mount_portal [-o options] config mount-point\n"); diff --git a/sbin/mount_portal/pt_exec.c b/sbin/mount_portal/pt_exec.c index f939a0195e..f7e32623df 100644 --- a/sbin/mount_portal/pt_exec.c +++ b/sbin/mount_portal/pt_exec.c @@ -37,7 +37,7 @@ * @(#)pt_exec.c 8.1 (Berkeley) 6/5/93 * * $FreeBSD: src/sbin/mount_portal/pt_exec.c,v 1.5 1999/08/28 00:13:37 peter Exp $ - * $DragonFly: src/sbin/mount_portal/pt_exec.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/mount_portal/pt_exec.c,v 1.3 2003/09/28 14:39:19 hmp Exp $ */ #include @@ -46,12 +46,7 @@ #include "portald.h" -int portal_exec(pcr, key, v, so, fdp) -struct portal_cred *pcr; -char *key; -char **v; -int so; -int *fdp; +int portal_exec(struct portal_cred *pcr, char *key, char **v, int so, int *fdp) { return (ENOEXEC); } diff --git a/sbin/mount_portal/pt_file.c b/sbin/mount_portal/pt_file.c index 8192dfa5e8..d3d5fa361e 100644 --- a/sbin/mount_portal/pt_file.c +++ b/sbin/mount_portal/pt_file.c @@ -37,7 +37,7 @@ * @(#)pt_file.c 8.3 (Berkeley) 7/3/94 * * $FreeBSD: src/sbin/mount_portal/pt_file.c,v 1.8 1999/08/28 00:13:38 peter Exp $ - * $DragonFly: src/sbin/mount_portal/pt_file.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/mount_portal/pt_file.c,v 1.3 2003/09/28 14:39:19 hmp Exp $ */ #include @@ -50,12 +50,7 @@ #include "portald.h" -int portal_file(pcr, key, v, so, fdp) -struct portal_cred *pcr; -char *key; -char **v; -int so; -int *fdp; +int portal_file(struct portal_cred *pcr, char *key, char **v, int so, int *fdp) { int fd; char pbuf[MAXPATHLEN]; diff --git a/sbin/mount_portal/pt_tcp.c b/sbin/mount_portal/pt_tcp.c index 9fb46d597e..f198364693 100644 --- a/sbin/mount_portal/pt_tcp.c +++ b/sbin/mount_portal/pt_tcp.c @@ -37,7 +37,7 @@ * @(#)pt_tcp.c 8.5 (Berkeley) 4/28/95 * * $FreeBSD: src/sbin/mount_portal/pt_tcp.c,v 1.9 1999/08/28 00:13:38 peter Exp $ - * $DragonFly: src/sbin/mount_portal/pt_tcp.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/mount_portal/pt_tcp.c,v 1.3 2003/09/28 14:39:19 hmp Exp $ */ #include @@ -61,12 +61,7 @@ * Some trailing suffix values have special meanings. * An unrecognized suffix is an error. */ -int portal_tcp(pcr, key, v, kso, fdp) - struct portal_cred *pcr; - char *key; - char **v; - int kso; - int *fdp; +int portal_tcp(struct portal_cred *pcr, char *key, char **v, int kso, int *fdp) { char host[MAXHOSTNAMELEN]; char port[MAXHOSTNAMELEN]; diff --git a/sbin/mount_portal/pt_tcplisten.c b/sbin/mount_portal/pt_tcplisten.c index 43a20c5aa9..86a1fc9f92 100644 --- a/sbin/mount_portal/pt_tcplisten.c +++ b/sbin/mount_portal/pt_tcplisten.c @@ -38,6 +38,7 @@ * * @(#)pt_tcp.c 8.3 (Berkeley) 3/27/94 * + * $DragonFly: src/sbin/mount_portal/pt_tcplisten.c,v 1.2 2003/09/28 14:39:19 hmp Exp $ * pt_tcp.c,v 1.1.1.1 1994/05/26 06:34:34 rgrimes Exp */ @@ -68,12 +69,8 @@ * may cause remote auth (identd) to return unexpected results. * */ -int portal_tcplisten(pcr, key, v, kso, fdp) - struct portal_cred *pcr; - char *key; - char **v; - int kso; - int *fdp; +int portal_tcplisten(struct portal_cred *pcr, char *key, char **v, int kso, + int *fdp) { char host[MAXHOSTNAMELEN]; char port[MAXHOSTNAMELEN]; diff --git a/sbin/mount_std/mount_std.c b/sbin/mount_std/mount_std.c index 348d510838..98b63f53b2 100644 --- a/sbin/mount_std/mount_std.c +++ b/sbin/mount_std/mount_std.c @@ -36,7 +36,7 @@ * * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * $FreeBSD: src/sbin/mount_std/mount_std.c,v 1.10.2.1 2001/07/30 10:30:07 dd Exp $ - * $DragonFly: src/sbin/mount_std/mount_std.c,v 1.2 2003/06/17 04:27:33 dillon Exp $ + * $DragonFly: src/sbin/mount_std/mount_std.c,v 1.3 2003/09/28 14:39:19 hmp Exp $ */ #include @@ -60,9 +60,7 @@ static void usage __P((void)) __dead2; static const char *fsname; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, mntflags; char mntpath[MAXPATHLEN]; @@ -120,7 +118,7 @@ main(argc, argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: mount_%s [-o options] what_to_mount mount_point\n", diff --git a/sbin/mount_umap/mount_umap.c b/sbin/mount_umap/mount_umap.c index 72e0dadab1..c62f40599e 100644 --- a/sbin/mount_umap/mount_umap.c +++ b/sbin/mount_umap/mount_umap.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_umap.c 8.5 (Berkeley) 4/26/95 * $FreeBSD: src/sbin/mount_umap/mount_umap.c,v 1.15 1999/10/09 11:54:13 phk Exp $ - * $DragonFly: src/sbin/mount_umap/Attic/mount_umap.c,v 1.3 2003/08/08 04:18:40 dillon Exp $ + * $DragonFly: src/sbin/mount_umap/Attic/mount_umap.c,v 1.4 2003/09/28 14:39:20 hmp Exp $ */ #include @@ -79,9 +79,7 @@ static struct mntopt mopts[] = { static void usage __P((void)) __dead2; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { static char not[] = "; not mounted"; struct stat statbuf; @@ -233,7 +231,7 @@ main(argc, argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: mount_umap [-o options] -u usermap -g groupmap target_fs mount_point\n"); diff --git a/sbin/mount_union/mount_union.c b/sbin/mount_union/mount_union.c index cb17070dd0..8ce5eab8ed 100644 --- a/sbin/mount_union/mount_union.c +++ b/sbin/mount_union/mount_union.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_union.c 8.5 (Berkeley) 3/27/94 * $FreeBSD: src/sbin/mount_union/mount_union.c,v 1.12 1999/10/09 11:54:14 phk Exp $ - * $DragonFly: src/sbin/mount_union/mount_union.c,v 1.3 2003/08/08 04:18:40 dillon Exp $ + * $DragonFly: src/sbin/mount_union/mount_union.c,v 1.4 2003/09/28 14:39:20 hmp Exp $ */ #include @@ -62,9 +62,7 @@ static int subdir __P((const char *, const char *)); static void usage __P((void)) __dead2; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct union_args args; int ch, mntflags; @@ -125,9 +123,7 @@ main(argc, argv) } int -subdir(p, dir) - const char *p; - const char *dir; +subdir(const char *p, const char *dir) { int l; @@ -142,7 +138,7 @@ subdir(p, dir) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: mount_union [-br] [-o options] target_fs mount_point\n"); diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index 8ccf1547ec..87b6eb86e7 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)mountd.c 8.15 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/mountd/mountd.c,v 1.39.2.5 2002/09/13 15:57:43 joerg Exp $ - * $DragonFly: src/sbin/mountd/mountd.c,v 1.3 2003/08/08 04:18:40 dillon Exp $ + * $DragonFly: src/sbin/mountd/mountd.c,v 1.4 2003/09/28 14:39:20 hmp Exp $ */ #include @@ -225,9 +225,7 @@ int debug = 0; * and "-n" to allow nonroot mount. */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { SVCXPRT *udptransp, *tcptransp; int c, error, mib[3]; @@ -328,7 +326,7 @@ main(argc, argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: mountd [-2] [-d] [-l] [-n] [-r] [export_file]\n"); @@ -339,9 +337,7 @@ usage() * The mount rpc service */ void -mntsrv(rqstp, transp) - struct svc_req *rqstp; - SVCXPRT *transp; +mntsrv(struct svc_req *rqstp, SVCXPRT *transp) { struct exportlist *ep; struct dirlist *dp; @@ -535,9 +531,7 @@ mntsrv(rqstp, transp) * Xdr conversion for a dirpath string */ int -xdr_dir(xdrsp, dirp) - XDR *xdrsp; - char *dirp; +xdr_dir(XDR *xdrsp, char *dirp) { return (xdr_string(xdrsp, &dirp, RPCMNT_PATHLEN)); } @@ -546,9 +540,7 @@ xdr_dir(xdrsp, dirp) * Xdr routine to generate file handle reply */ int -xdr_fhs(xdrsp, cp) - XDR *xdrsp; - caddr_t cp; +xdr_fhs(XDR *xdrsp, caddr_t cp) { register struct fhreturn *fhrp = (struct fhreturn *)cp; u_long ok = 0, len, auth; @@ -577,9 +569,7 @@ xdr_fhs(xdrsp, cp) } int -xdr_mlist(xdrsp, cp) - XDR *xdrsp; - caddr_t cp; +xdr_mlist(XDR *xdrsp, caddr_t cp) { struct mountlist *mlp; int true = 1; @@ -607,9 +597,7 @@ xdr_mlist(xdrsp, cp) * Xdr conversion for export list */ int -xdr_explist(xdrsp, cp) - XDR *xdrsp; - caddr_t cp; +xdr_explist(XDR *xdrsp, caddr_t cp) { struct exportlist *ep; int false = 0; @@ -644,11 +632,7 @@ errout: * directory paths. */ int -put_exlist(dp, xdrsp, adp, putdefp) - struct dirlist *dp; - XDR *xdrsp; - struct dirlist *adp; - int *putdefp; +put_exlist(struct dirlist *dp, XDR *xdrsp, struct dirlist *adp, int *putdefp) { struct grouplist *grp; struct hostlist *hp; @@ -712,7 +696,7 @@ FILE *exp_file; * Get the export list */ void -get_exportlist() +get_exportlist(void) { struct exportlist *ep, *ep2; struct grouplist *grp, *tgrp; @@ -1018,7 +1002,7 @@ nextline: * Allocate an export list element */ struct exportlist * -get_exp() +get_exp(void) { struct exportlist *ep; @@ -1033,7 +1017,7 @@ get_exp() * Allocate a group list element */ struct grouplist * -get_grp() +get_grp(void) { struct grouplist *gp; @@ -1048,9 +1032,7 @@ get_grp() * Clean up upon an error in get_exportlist(). */ void -getexp_err(ep, grp) - struct exportlist *ep; - struct grouplist *grp; +getexp_err(struct exportlist *ep, struct grouplist *grp) { struct grouplist *tgrp; @@ -1069,8 +1051,7 @@ getexp_err(ep, grp) * Search the export list for a matching fs. */ struct exportlist * -ex_search(fsid) - fsid_t *fsid; +ex_search(fsid_t *fsid) { struct exportlist *ep; @@ -1088,10 +1069,7 @@ ex_search(fsid) * Add a directory path to the list. */ char * -add_expdir(dpp, cp, len) - struct dirlist **dpp; - char *cp; - int len; +add_expdir(struct dirlist **dpp, char *cp, int len) { struct dirlist *dp; @@ -1112,11 +1090,8 @@ add_expdir(dpp, cp, len) * and update the entry for host. */ void -hang_dirp(dp, grp, ep, flags) - struct dirlist *dp; - struct grouplist *grp; - struct exportlist *ep; - int flags; +hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep, + int flags) { struct hostlist *hp; struct dirlist *dp2; @@ -1157,11 +1132,8 @@ hang_dirp(dp, grp, ep, flags) * for the new directory or adding the new node. */ void -add_dlist(dpp, newdp, grp, flags) - struct dirlist **dpp; - struct dirlist *newdp; - struct grouplist *grp; - int flags; +add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp, + int flags) { struct dirlist *dp; struct hostlist *hp; @@ -1208,9 +1180,7 @@ add_dlist(dpp, newdp, grp, flags) * Search for a dirpath on the export point. */ struct dirlist * -dirp_search(dp, dirpath) - struct dirlist *dp; - char *dirpath; +dirp_search(struct dirlist *dp, char *dirpath) { int cmp; @@ -1230,11 +1200,7 @@ dirp_search(dp, dirpath) * Scan for a host match in a directory tree. */ int -chk_host(dp, saddr, defsetp, hostsetp) - struct dirlist *dp; - u_int32_t saddr; - int *defsetp; - int *hostsetp; +chk_host(struct dirlist *dp, u_int32_t saddr, int *defsetp, int *hostsetp) { struct hostlist *hp; struct grouplist *grp; @@ -1276,9 +1242,7 @@ chk_host(dp, saddr, defsetp, hostsetp) * Scan tree for a host that matches the address. */ int -scan_tree(dp, saddr) - struct dirlist *dp; - u_int32_t saddr; +scan_tree(struct dirlist *dp, u_int32_t saddr) { int defset, hostset; @@ -1297,8 +1261,7 @@ scan_tree(dp, saddr) * Traverse the dirlist tree and free it up. */ void -free_dir(dp) - struct dirlist *dp; +free_dir(struct dirlist *dp) { if (dp) { @@ -1315,13 +1278,8 @@ free_dir(dp) * -