svn commit: r201387 - in head/usr.sbin: accton ancontrol asf chroot extattrctl faithd inetd kbdcontrol mount_portalfs ndiscvt quotaon rip6query rmt

Ed Schouten ed at FreeBSD.org
Sat Jan 2 11:05:35 UTC 2010


Author: ed
Date: Sat Jan  2 11:05:34 2010
New Revision: 201387
URL: http://svn.freebsd.org/changeset/base/201387

Log:
  ANSIfy some more tools in usr.sbin/.
  
  Most of these tools build with WARNS=6, except for their use of K&R
  function declarations.

Modified:
  head/usr.sbin/accton/accton.c
  head/usr.sbin/ancontrol/ancontrol.c
  head/usr.sbin/asf/asf_kld.c
  head/usr.sbin/chroot/chroot.c
  head/usr.sbin/extattrctl/extattrctl.c
  head/usr.sbin/faithd/faithd.c
  head/usr.sbin/inetd/inetd.c
  head/usr.sbin/kbdcontrol/kbdcontrol.c
  head/usr.sbin/mount_portalfs/mount_portalfs.c
  head/usr.sbin/ndiscvt/ndiscvt.c
  head/usr.sbin/quotaon/quotaon.c
  head/usr.sbin/rip6query/rip6query.c
  head/usr.sbin/rmt/rmt.c

Modified: head/usr.sbin/accton/accton.c
==============================================================================
--- head/usr.sbin/accton/accton.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/accton/accton.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -80,7 +80,7 @@ main(int argc, char *argv[])
 }
 
 static void
-usage()
+usage(void)
 {
 	(void)fprintf(stderr, "usage: accton [file]\n");
 	exit(1);

Modified: head/usr.sbin/ancontrol/ancontrol.c
==============================================================================
--- head/usr.sbin/ancontrol/ancontrol.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/ancontrol/ancontrol.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -1327,8 +1327,8 @@ an_setkeys(const char *iface, const char
 	}
 }
 
-static void an_readkeyinfo(iface)
-	const char		*iface;
+static void
+an_readkeyinfo(const char *iface)
 {
 	struct an_req		areq;
 	struct an_ltv_genconfig	*cfg;

Modified: head/usr.sbin/asf/asf_kld.c
==============================================================================
--- head/usr.sbin/asf/asf_kld.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/asf/asf_kld.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -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 */

Modified: head/usr.sbin/chroot/chroot.c
==============================================================================
--- head/usr.sbin/chroot/chroot.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/chroot/chroot.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -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");

Modified: head/usr.sbin/extattrctl/extattrctl.c
==============================================================================
--- head/usr.sbin/extattrctl/extattrctl.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/extattrctl/extattrctl.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -54,7 +54,7 @@ long num_inodes_by_path(char *path);
 void usage(void);
 
 void
-usage()
+usage(void)
 {
 
 	fprintf(stderr,

Modified: head/usr.sbin/faithd/faithd.c
==============================================================================
--- head/usr.sbin/faithd/faithd.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/faithd/faithd.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -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);

Modified: head/usr.sbin/inetd/inetd.c
==============================================================================
--- head/usr.sbin/inetd/inetd.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/inetd/inetd.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -1397,8 +1397,7 @@ setsockopt(fd, SOL_SOCKET, opt, (char *)
 
 #ifdef IPSEC
 void
-ipsecsetup(sep)
-	struct servtab *sep;
+ipsecsetup(struct servtab *sep)
 {
 	char *buf;
 	char *policy_in = NULL;

Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c
==============================================================================
--- head/usr.sbin/kbdcontrol/kbdcontrol.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/kbdcontrol/kbdcontrol.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -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]",

Modified: head/usr.sbin/mount_portalfs/mount_portalfs.c
==============================================================================
--- head/usr.sbin/mount_portalfs/mount_portalfs.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/mount_portalfs/mount_portalfs.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -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");

Modified: head/usr.sbin/ndiscvt/ndiscvt.c
==============================================================================
--- head/usr.sbin/ndiscvt/ndiscvt.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/ndiscvt/ndiscvt.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -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;

Modified: head/usr.sbin/quotaon/quotaon.c
==============================================================================
--- head/usr.sbin/quotaon/quotaon.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/quotaon/quotaon.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -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))

Modified: head/usr.sbin/rip6query/rip6query.c
==============================================================================
--- head/usr.sbin/rip6query/rip6query.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/rip6query/rip6query.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -68,9 +68,7 @@ static const char *sa_n2a(struct sockadd
 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];
 

Modified: head/usr.sbin/rmt/rmt.c
==============================================================================
--- head/usr.sbin/rmt/rmt.c	Sat Jan  2 10:27:05 2010	(r201386)
+++ head/usr.sbin/rmt/rmt.c	Sat Jan  2 11:05:34 2010	(r201387)
@@ -206,8 +206,7 @@ ioerror:
 }
 
 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));


More information about the svn-src-all mailing list