Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin Use C89 function definitions



details:   https://anonhg.NetBSD.org/src/rev/64d8342b1efe
branches:  trunk
changeset: 778256:64d8342b1efe
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Mar 20 20:34:57 2012 +0000

description:
Use C89 function definitions

diffstat:

 usr.bin/config/lint.c       |   6 +-
 usr.bin/config/scan.l       |   4 +-
 usr.bin/find/find.c         |   9 +---
 usr.bin/find/function.c     |   8 +---
 usr.bin/hesinfo/hesinfo.c   |  10 ++---
 usr.bin/innetgr/innetgr.c   |  10 ++---
 usr.bin/lock/lock.c         |   7 +--
 usr.bin/m4/gnum4.c          |   8 ++--
 usr.bin/m4/look.c           |  19 +++--------
 usr.bin/m4/misc.c           |  14 ++++----
 usr.bin/m4/tokenizer.l      |   8 ++--
 usr.bin/m4/trace.c          |   6 +-
 usr.bin/mkstr/mkstr.c       |  10 +++---
 usr.bin/msgs/msgs.c         |  49 +++++++++++++-------------------
 usr.bin/netgroup/netgroup.c |  10 ++---
 usr.bin/netstat/if.c        |  16 +++-------
 usr.bin/netstat/iso.c       |  68 +++++++++++++-------------------------------
 usr.bin/netstat/main.c      |  33 +++++++--------------
 usr.bin/netstat/mbuf.c      |  10 ++---
 usr.bin/netstat/mroute.c    |  22 +++++--------
 usr.bin/netstat/mroute6.c   |   8 +---
 usr.bin/netstat/route.c     |  30 ++++++-------------
 usr.bin/netstat/unix.c      |  13 +++-----
 usr.bin/talk/ctl.c          |   6 +-
 usr.bin/talk/look_up.c      |   9 ++---
 usr.bin/tee/tee.c           |  16 +++------
 usr.bin/telnet/main.c       |   6 +-
 usr.bin/tftp/main.c         |  11 ++----
 usr.bin/tftp/tftp.c         |  36 +++++++----------------
 usr.bin/ul/ul.c             |  32 ++++++++------------
 usr.bin/units/units.c       |   4 +-
 usr.bin/users/users.c       |  10 ++---
 usr.bin/vgrind/regexp.c     |  21 +++++-------
 usr.bin/vgrind/vfontedpr.c  |  37 +++++++++---------------
 usr.bin/vmstat/vmstat.c     |   6 +-
 35 files changed, 218 insertions(+), 354 deletions(-)

diffs (truncated from 1923 to 300 lines):

diff -r 9b5a39ebc6d7 -r 64d8342b1efe usr.bin/config/lint.c
--- a/usr.bin/config/lint.c     Tue Mar 20 18:50:30 2012 +0000
+++ b/usr.bin/config/lint.c     Tue Mar 20 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lint.c,v 1.13 2012/03/12 03:04:56 dholland Exp $       */
+/*     $NetBSD: lint.c,v 1.14 2012/03/20 20:34:57 matt Exp $   */
 
 /*
  *  Copyright (c) 2007 The NetBSD Foundation.
@@ -36,7 +36,7 @@
 #include "defs.h"
 
 void
-emit_params()
+emit_params(void)
 {
 
        printf("version\t%d\n", CONFIG_VERSION);
@@ -196,7 +196,7 @@
 }
 
 void
-emit_instances()
+emit_instances(void)
 {
 
        (void)ht_enumerate(devroottab, emit_root_instance, NULL);
diff -r 9b5a39ebc6d7 -r 64d8342b1efe usr.bin/config/scan.l
--- a/usr.bin/config/scan.l     Tue Mar 20 18:50:30 2012 +0000
+++ b/usr.bin/config/scan.l     Tue Mar 20 20:34:57 2012 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: scan.l,v 1.16 2010/04/30 20:47:18 pooka Exp $  */
+/*     $NetBSD: scan.l,v 1.17 2012/03/20 20:34:57 matt Exp $   */
 
 /*
  * Copyright (c) 1992, 1993
@@ -541,7 +541,7 @@
  * Extract the pathname from a include/cinclude/package into curinclpath
  */
 static int
-getincludepath()
+getincludepath(void)
 {
        const char *p = yytext;
        ptrdiff_t len;
diff -r 9b5a39ebc6d7 -r 64d8342b1efe usr.bin/find/find.c
--- a/usr.bin/find/find.c       Tue Mar 20 18:50:30 2012 +0000
+++ b/usr.bin/find/find.c       Tue Mar 20 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: find.c,v 1.28 2012/03/18 17:09:46 dholland Exp $       */
+/*     $NetBSD: find.c,v 1.29 2012/03/20 20:34:57 matt Exp $   */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "from: @(#)find.c       8.5 (Berkeley) 8/5/94";
 #else
-__RCSID("$NetBSD: find.c,v 1.28 2012/03/18 17:09:46 dholland Exp $");
+__RCSID("$NetBSD: find.c,v 1.29 2012/03/20 20:34:57 matt Exp $");
 #endif
 #endif /* not lint */
 
@@ -282,10 +282,7 @@
  *     If any func() returns non-zero, then so will find_traverse().
  */
 int
-find_traverse(plan, func, arg)
-       PLAN *plan;
-       int (*func)(PLAN *, void *);
-       void *arg;
+find_traverse(PLAN *plan, int (*func)(PLAN *, void *), void *arg)
 {
        PLAN *p;
        int r, rval;
diff -r 9b5a39ebc6d7 -r 64d8342b1efe usr.bin/find/function.c
--- a/usr.bin/find/function.c   Tue Mar 20 18:50:30 2012 +0000
+++ b/usr.bin/find/function.c   Tue Mar 20 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: function.c,v 1.67 2011/09/22 12:49:57 christos Exp $   */
+/*     $NetBSD: function.c,v 1.68 2012/03/20 20:34:57 matt Exp $       */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "from: @(#)function.c   8.10 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: function.c,v 1.67 2011/09/22 12:49:57 christos Exp $");
+__RCSID("$NetBSD: function.c,v 1.68 2012/03/20 20:34:57 matt Exp $");
 #endif
 #endif /* not lint */
 
@@ -215,9 +215,7 @@
  *     file.
  */
 int
-f_anewer(plan, entry)
-       PLAN *plan;
-       FTSENT *entry;
+f_anewer(PLAN *plan, FTSENT *entry)
 {
 
        return (entry->fts_statp->st_atime > plan->t_data);
diff -r 9b5a39ebc6d7 -r 64d8342b1efe usr.bin/hesinfo/hesinfo.c
--- a/usr.bin/hesinfo/hesinfo.c Tue Mar 20 18:50:30 2012 +0000
+++ b/usr.bin/hesinfo/hesinfo.c Tue Mar 20 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hesinfo.c,v 1.3 2004/01/05 23:23:34 jmmv Exp $ */
+/*     $NetBSD: hesinfo.c,v 1.4 2012/03/20 20:34:57 matt Exp $ */
 
 /* Copyright 1988, 1996 by the Massachusetts Institute of Technology.
  *
@@ -23,7 +23,7 @@
 #if 0
 static char rcsid[] = "#Id: hesinfo.c,v 1.8 1996/12/08 21:29:54 ghudson Exp #";
 #else
-__RCSID("$NetBSD: hesinfo.c,v 1.3 2004/01/05 23:23:34 jmmv Exp $");
+__RCSID("$NetBSD: hesinfo.c,v 1.4 2012/03/20 20:34:57 matt Exp $");
 #endif
 #endif /* not lint */
 
@@ -35,12 +35,10 @@
 #include <string.h>
 #include <unistd.h>
 
-int    main __P((int, char **));
+int    main(int, char **);
 
 int 
-main(argc, argv)
-       int     argc;
-       char  **argv;
+main(int argc, char **argv)
 {
        char  **list, **p, *bindname, *name, *type;
        int     lflag = 0, errflg = 0, bflag = 0, c;
diff -r 9b5a39ebc6d7 -r 64d8342b1efe usr.bin/innetgr/innetgr.c
--- a/usr.bin/innetgr/innetgr.c Tue Mar 20 18:50:30 2012 +0000
+++ b/usr.bin/innetgr/innetgr.c Tue Mar 20 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: innetgr.c,v 1.7 2008/04/28 20:24:13 martin Exp $       */
+/*     $NetBSD: innetgr.c,v 1.8 2012/03/20 20:34:57 matt Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: innetgr.c,v 1.7 2008/04/28 20:24:13 martin Exp $");
+__RCSID("$NetBSD: innetgr.c,v 1.8 2012/03/20 20:34:57 matt Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -41,7 +41,7 @@
 int main __P((int, char *[]));
 
 static void
-usage()
+usage(void)
 {
 
        (void)fprintf(stderr,
@@ -51,9 +51,7 @@
 }
 
 int
-main(argc, argv)
-       int argc;
-       char *argv[];
+main(int argc, char *argv[])
 {
        int c, ok, verbose = 0;
        char *user = NULL;
diff -r 9b5a39ebc6d7 -r 64d8342b1efe usr.bin/lock/lock.c
--- a/usr.bin/lock/lock.c       Tue Mar 20 18:50:30 2012 +0000
+++ b/usr.bin/lock/lock.c       Tue Mar 20 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lock.c,v 1.31 2008/12/29 01:26:46 christos Exp $       */
+/*     $NetBSD: lock.c,v 1.32 2012/03/20 20:34:58 matt Exp $   */
 
 /*
  * Copyright (c) 1980, 1987, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)lock.c     8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: lock.c,v 1.31 2008/12/29 01:26:46 christos Exp $");
+__RCSID("$NetBSD: lock.c,v 1.32 2012/03/20 20:34:58 matt Exp $");
 #endif /* not lint */
 
 /*
@@ -326,8 +326,7 @@
 #endif
 
 static void
-hi(dummy)
-       int dummy;
+hi(int dummy)
 {
        struct timeval timval;
 
diff -r 9b5a39ebc6d7 -r 64d8342b1efe usr.bin/m4/gnum4.c
--- a/usr.bin/m4/gnum4.c        Tue Mar 20 18:50:30 2012 +0000
+++ b/usr.bin/m4/gnum4.c        Tue Mar 20 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gnum4.c,v 1.8 2011/09/06 18:16:01 joerg Exp $ */
+/* $NetBSD: gnum4.c,v 1.9 2012/03/20 20:34:58 matt Exp $ */
 /* $OpenBSD: gnum4.c,v 1.39 2008/08/21 21:01:04 espie Exp $ */
 
 /*
@@ -33,7 +33,7 @@
 #include "nbtool_config.h"
 #endif
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: gnum4.c,v 1.8 2011/09/06 18:16:01 joerg Exp $");
+__RCSID("$NetBSD: gnum4.c,v 1.9 2012/03/20 20:34:58 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -106,7 +106,7 @@
 }
 
 static void
-ensure_m4path()
+ensure_m4path(void)
 {
        static int envpathdone = 0;
        char *envpath;
@@ -241,7 +241,7 @@
 }
 
 static char *
-getstring()
+getstring(void)
 {
        addchar('\0');
        current = 0;
diff -r 9b5a39ebc6d7 -r 64d8342b1efe usr.bin/m4/look.c
--- a/usr.bin/m4/look.c Tue Mar 20 18:50:30 2012 +0000
+++ b/usr.bin/m4/look.c Tue Mar 20 20:34:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: look.c,v 1.11 2009/10/26 21:11:28 christos Exp $       */
+/*     $NetBSD: look.c,v 1.12 2012/03/20 20:34:58 matt Exp $   */
 /*     $OpenBSD: look.c,v 1.21 2009/10/14 17:23:17 sthen Exp $ */
 
 /*
@@ -42,7 +42,7 @@
 #include "nbtool_config.h"
 #endif
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: look.c,v 1.11 2009/10/26 21:11:28 christos Exp $");
+__RCSID("$NetBSD: look.c,v 1.12 2012/03/20 20:34:58 matt Exp $");
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -67,9 +67,7 @@
 
 /* Support routines for hash tables.  */
 void *
-hash_alloc(s, u)
-       size_t s;
-       void *u         UNUSED;
+hash_alloc(size_t s, void *u UNUSED)
 {
        void *storage = xalloc(s, "hash alloc");
        if (storage)
@@ -78,24 +76,19 @@
 }
 
 void
-hash_free(p, s, u)
-       void *p;
-       size_t s        UNUSED;
-       void *u         UNUSED;
+hash_free(void *p, size_t s UNUSED, void *u UNUSED)
 {
        free(p);
 }
 
 void *
-element_alloc(s, u)
-       size_t s;
-       void *u         UNUSED;
+element_alloc(size_t s, void *u UNUSED)
 {
        return xalloc(s, "element alloc");
 }
 
 void
-init_macros()
+init_macros(void)
 {
        ohash_init(&macros, 10, &macro_info);
 }
diff -r 9b5a39ebc6d7 -r 64d8342b1efe usr.bin/m4/misc.c
--- a/usr.bin/m4/misc.c Tue Mar 20 18:50:30 2012 +0000
+++ b/usr.bin/m4/misc.c Tue Mar 20 20:34:57 2012 +0000



Home | Main Index | Thread Index | Old Index