From 9a958de54ccdc98bccac14218af0cb9fe04e607d Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Sat, 2 Jan 2010 11:05:34 +0000 Subject: [PATCH] ANSIfy some more tools in usr.sbin/. Most of these tools build with WARNS=6, except for their use of K&R function declarations. --- usr.sbin/accton/accton.c | 2 +- usr.sbin/ancontrol/ancontrol.c | 4 ++-- usr.sbin/asf/asf_kld.c | 2 +- usr.sbin/chroot/chroot.c | 6 ++---- usr.sbin/extattrctl/extattrctl.c | 2 +- usr.sbin/faithd/faithd.c | 8 ++++---- usr.sbin/inetd/inetd.c | 3 +-- usr.sbin/kbdcontrol/kbdcontrol.c | 2 +- usr.sbin/mount_portalfs/mount_portalfs.c | 2 +- usr.sbin/ndiscvt/ndiscvt.c | 6 ++---- usr.sbin/quotaon/quotaon.c | 5 +---- usr.sbin/rip6query/rip6query.c | 12 ++++-------- usr.sbin/rmt/rmt.c | 10 +++------- 13 files changed, 24 insertions(+), 40 deletions(-) diff --git a/usr.sbin/accton/accton.c b/usr.sbin/accton/accton.c index c1bb8b6b72c5..33e66042e898 100644 --- a/usr.sbin/accton/accton.c +++ b/usr.sbin/accton/accton.c @@ -80,7 +80,7 @@ main(int argc, char *argv[]) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: accton [file]\n"); exit(1); diff --git a/usr.sbin/ancontrol/ancontrol.c b/usr.sbin/ancontrol/ancontrol.c index 08d13d312058..008970d9b08e 100644 --- a/usr.sbin/ancontrol/ancontrol.c +++ b/usr.sbin/ancontrol/ancontrol.c @@ -1327,8 +1327,8 @@ an_setkeys(const char *iface, const char *key, int keytype) } } -static void an_readkeyinfo(iface) - const char *iface; +static void +an_readkeyinfo(const char *iface) { struct an_req areq; struct an_ltv_genconfig *cfg; diff --git a/usr.sbin/asf/asf_kld.c b/usr.sbin/asf/asf_kld.c index 1d6a2b7d51e6..f0bd699580d8 100644 --- a/usr.sbin/asf/asf_kld.c +++ b/usr.sbin/asf/asf_kld.c @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); * Works with a live kernel only. */ void -asf_kld() +asf_kld(void) { struct kld_file_stat kfs; int fid = 0; /* indicates the beginning of the linker file list */ diff --git a/usr.sbin/chroot/chroot.c b/usr.sbin/chroot/chroot.c index cc924a027bc5..a0122f777e66 100644 --- a/usr.sbin/chroot/chroot.c +++ b/usr.sbin/chroot/chroot.c @@ -61,9 +61,7 @@ char *group; /* group to switch to ... */ char *grouplist; /* group list to switch to ... */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { struct group *gp; struct passwd *pw; @@ -179,7 +177,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: chroot [-g group] [-G group,group,...] " "[-u user] newroot [command]\n"); diff --git a/usr.sbin/extattrctl/extattrctl.c b/usr.sbin/extattrctl/extattrctl.c index 103fcd345a92..1929f796f4f9 100644 --- a/usr.sbin/extattrctl/extattrctl.c +++ b/usr.sbin/extattrctl/extattrctl.c @@ -54,7 +54,7 @@ long num_inodes_by_path(char *path); void usage(void); void -usage() +usage(void) { fprintf(stderr, diff --git a/usr.sbin/faithd/faithd.c b/usr.sbin/faithd/faithd.c index f192fbd3d3b6..9caf0e9f8f30 100644 --- a/usr.sbin/faithd/faithd.c +++ b/usr.sbin/faithd/faithd.c @@ -791,7 +791,7 @@ exit_success(const char *fmt, ...) #ifdef USE_ROUTE static void -grab_myaddrs() +grab_myaddrs(void) { struct ifaddrs *ifap, *ifa; struct myaddrs *p; @@ -847,7 +847,7 @@ grab_myaddrs() } static void -free_myaddrs() +free_myaddrs(void) { struct myaddrs *p, *q; @@ -861,7 +861,7 @@ free_myaddrs() } static void -update_myaddrs() +update_myaddrs(void) { char msg[BUFSIZ]; int len; @@ -900,7 +900,7 @@ update_myaddrs() #endif /*USE_ROUTE*/ static void -usage() +usage(void) { fprintf(stderr, "usage: %s [-dp] [-f conf] service [serverpath [serverargs]]\n", faithdname); diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index e8d34f462835..0a39fdf7f648 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -1397,8 +1397,7 @@ setsockopt(fd, SOL_SOCKET, opt, (char *)&on, sizeof (on)) #ifdef IPSEC void -ipsecsetup(sep) - struct servtab *sep; +ipsecsetup(struct servtab *sep) { char *buf; char *policy_in = NULL; diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index 5d20b163730e..280faa1df2e0 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -1148,7 +1148,7 @@ mux_keyboard(u_int op, char *kbd) } void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n%s\n", "usage: kbdcontrol [-dFKix] [-A name] [-a name] [-b duration.pitch | [quiet.]belltype]", diff --git a/usr.sbin/mount_portalfs/mount_portalfs.c b/usr.sbin/mount_portalfs/mount_portalfs.c index 8f61efcc964c..3c37b95657c1 100644 --- a/usr.sbin/mount_portalfs/mount_portalfs.c +++ b/usr.sbin/mount_portalfs/mount_portalfs.c @@ -272,7 +272,7 @@ main(int argc, char *argv[]) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: mount_portalfs [-o options] config mount-point\n"); diff --git a/usr.sbin/ndiscvt/ndiscvt.c b/usr.sbin/ndiscvt/ndiscvt.c index 34d312071e57..5de75191f73b 100644 --- a/usr.sbin/ndiscvt/ndiscvt.c +++ b/usr.sbin/ndiscvt/ndiscvt.c @@ -91,10 +91,8 @@ extern const char *__progname; nt_hdr = (image_nt_header *)(x + dos_hdr->idh_lfanew); \ sect_hdr = IMAGE_FIRST_SECTION(nt_hdr); -static -int insert_padding(imgbase, imglen) - void **imgbase; - int *imglen; +static int +insert_padding(void **imgbase, int *imglen) { image_section_header *sect_hdr; image_dos_header *dos_hdr; diff --git a/usr.sbin/quotaon/quotaon.c b/usr.sbin/quotaon/quotaon.c index 314f596bc014..84a523d7b1ca 100644 --- a/usr.sbin/quotaon/quotaon.c +++ b/usr.sbin/quotaon/quotaon.c @@ -154,10 +154,7 @@ usage(void) } int -quotaonoff(fs, offmode, type, qfpathname) - register struct fstab *fs; - int offmode, type; - char *qfpathname; +quotaonoff(struct fstab *fs, int offmode, int type, char *qfpathname) { if (strcmp(fs->fs_file, "/") && readonly(fs)) diff --git a/usr.sbin/rip6query/rip6query.c b/usr.sbin/rip6query/rip6query.c index 0bf56fdc9312..4426bbc1c21f 100644 --- a/usr.sbin/rip6query/rip6query.c +++ b/usr.sbin/rip6query/rip6query.c @@ -68,9 +68,7 @@ static const char *sa_n2a(struct sockaddr *); static const char *inet6_n2a(struct in6_addr *); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { struct netinfo6 *np; struct sockaddr_in6 fsock; @@ -175,15 +173,14 @@ main(argc, argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: rip6query [-I iface] address\n"); } /* getnameinfo() is preferred as we may be able to show ifindex as ifname */ static const char * -sa_n2a(sa) - struct sockaddr *sa; +sa_n2a(struct sockaddr *sa) { static char buf[NI_MAXHOST]; @@ -195,8 +192,7 @@ sa_n2a(sa) } static const char * -inet6_n2a(addr) - struct in6_addr *addr; +inet6_n2a(struct in6_addr *addr) { static char buf[NI_MAXHOST]; diff --git a/usr.sbin/rmt/rmt.c b/usr.sbin/rmt/rmt.c index af4f954e07b9..f5e3cc14d013 100644 --- a/usr.sbin/rmt/rmt.c +++ b/usr.sbin/rmt/rmt.c @@ -206,8 +206,7 @@ main(int argc, char **argv) } void -getstring(bp) - char *bp; +getstring(char *bp) { int i; char *cp = bp; @@ -222,9 +221,7 @@ getstring(bp) } char * -checkbuf(rec, size) - char *rec; - int size; +checkbuf(char *rec, int size) { if (size <= maxrecsize) @@ -244,8 +241,7 @@ checkbuf(rec, size) } void -error(num) - int num; +error(int num) { DEBUG2("rmtd: E %d (%s)\n", num, strerror(num));