Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin ANSIfy + static + __dead



details:   https://anonhg.NetBSD.org/src/rev/91ba6ef4cec1
branches:  trunk
changeset: 769067:91ba6ef4cec1
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Aug 30 20:54:18 2011 +0000

description:
ANSIfy + static + __dead

diffstat:

 usr.sbin/vnconfig/vnconfig.c |   40 ++++------
 usr.sbin/wiconfig/wiconfig.c |  149 ++++++++++++++++++------------------------
 2 files changed, 81 insertions(+), 108 deletions(-)

diffs (truncated from 398 to 300 lines):

diff -r 781f102fec93 -r 91ba6ef4cec1 usr.sbin/vnconfig/vnconfig.c
--- a/usr.sbin/vnconfig/vnconfig.c      Tue Aug 30 20:52:10 2011 +0000
+++ b/usr.sbin/vnconfig/vnconfig.c      Tue Aug 30 20:54:18 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vnconfig.c,v 1.39 2011/02/08 20:20:28 rmind Exp $      */
+/*     $NetBSD: vnconfig.c,v 1.40 2011/08/30 20:54:18 joerg Exp $      */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -91,22 +91,18 @@
 #define VND_UNCONFIG   2
 #define VND_GET                3
 
-int    verbose = 0;
-int    readonly = 0;
-int    force = 0;
-int    compressed = 0;
-char   *tabname;
+static int     verbose = 0;
+static int     readonly = 0;
+static int     force = 0;
+static int     compressed = 0;
+static char    *tabname;
 
-int    config __P((char *, char *, char *, int));
-int    getgeom __P((struct vndgeom *, char *));
-int    main __P((int, char **));
-char   *rawdevice __P((char *));
-void   usage __P((void));
+static int     config(char *, char *, char *, int);
+static int     getgeom(struct vndgeom *, char *);
+__dead static void     usage(void);
 
 int
-main(argc, argv)
-       int argc;
-       char *argv[];
+main(int argc, char *argv[])
 {
        int ch, rv, action = VND_CONFIG;
 
@@ -237,10 +233,8 @@
        exit(rv);
 }
 
-int
-config(dev, file, geom, action)
-       char *dev, *file, *geom;
-       int action;
+static int
+config(char *dev, char *file, char *geom, int action)
 {
        struct vnd_ioctl vndio;
        struct disklabel *lp;
@@ -337,10 +331,8 @@
        return (rv < 0);
 }
 
-int
-getgeom(vng, cp)
-       struct vndgeom *vng;
-       char *cp;
+static int
+getgeom(struct vndgeom *vng, char *cp)
 {
        char *secsize, *nsectors, *ntracks, *ncylinders;
 
@@ -381,8 +373,8 @@
        return (0);
 }
 
-void
-usage()
+static void
+usage(void)
 {
 
        (void)fprintf(stderr, "%s%s",
diff -r 781f102fec93 -r 91ba6ef4cec1 usr.sbin/wiconfig/wiconfig.c
--- a/usr.sbin/wiconfig/wiconfig.c      Tue Aug 30 20:52:10 2011 +0000
+++ b/usr.sbin/wiconfig/wiconfig.c      Tue Aug 30 20:54:18 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wiconfig.c,v 1.42 2009/04/19 01:52:09 lukem Exp $      */
+/*     $NetBSD: wiconfig.c,v 1.43 2011/08/30 21:01:50 joerg Exp $      */
 /*
  * Copyright (c) 1997, 1998, 1999
  *     Bill Paul <wpaul%ctr.columbia.edu@localhost>.  All rights reserved.
@@ -68,7 +68,7 @@
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1997, 1998, 1999\
  Bill Paul.  All rights reserved.");
-__RCSID("$NetBSD: wiconfig.c,v 1.42 2009/04/19 01:52:09 lukem Exp $");
+__RCSID("$NetBSD: wiconfig.c,v 1.43 2011/08/30 21:01:50 joerg Exp $");
 #endif
 
 struct wi_table {
@@ -96,35 +96,32 @@
 #define WI_APRATE_11           0x6E    /* 11 Mbps */
 
 #ifdef WI_RID_SCAN_APS
-static void wi_apscan          __P((char *));
-static int  get_if_flags       __P((int, const char *));
-static int  set_if_flags       __P((int, const char *, int));
+static void wi_apscan(char *);
+static int  get_if_flags(int, const char *);
+static int  set_if_flags(int, const char *, int);
 #endif
-static int  wi_getval          __P((char *, struct wi_req *));
-static void wi_setval          __P((char *, struct wi_req *));
-static void wi_printstr                __P((struct wi_req *));
-static void wi_setstr          __P((char *, int, char *));
-static void wi_setbytes                __P((char *, int, char *, int));
-static void wi_setword         __P((char *, int, int));
-static void wi_sethex          __P((char *, int, char *));
-static void wi_printwords      __P((struct wi_req *));
-static void wi_printbool       __P((struct wi_req *));
-static void wi_printhex                __P((struct wi_req *));
-static void wi_printbits       __P((struct wi_req *));
-static void wi_checkwifi       __P((char *));
-static void wi_dumpinfo                __P((char *));
-static void wi_printkeys       __P((struct wi_req *));
-static void wi_printvendor     __P((struct wi_req *));
-static void wi_dumpstats       __P((char *));
-static void usage              __P((void));
-static struct wi_table *
-       wi_optlookup __P((struct wi_table *, int));
-int main __P((int argc, char **argv));
+static int  wi_getval(char *, struct wi_req *);
+static void wi_setval(char *, struct wi_req *);
+static void wi_printstr(struct wi_req *);
+static void wi_setstr(char *, int, char *);
+static void wi_setbytes(char *, int, char *, int);
+static void wi_setword(char *, int, int);
+static void wi_sethex(char *, int, char *);
+static void wi_printwords(struct wi_req *);
+static void wi_printbool(struct wi_req *);
+static void wi_printhex(struct wi_req *);
+static void wi_printbits(struct wi_req *);
+static void wi_checkwifi(char *);
+static void wi_dumpinfo(char *);
+static void wi_printkeys(struct wi_req *);
+static void wi_printvendor(struct wi_req *);
+static void wi_dumpstats(char *);
+__dead static void usage(void);
+static struct wi_table *wi_optlookup(struct wi_table *, int);
 
 #ifdef WI_RID_SCAN_APS
-static int get_if_flags(s, name)
-       int             s;
-       const char      *name;
+static int
+get_if_flags(int s, const char *name)
 {
        struct ifreq    ifreq;
        int             flags;
@@ -137,10 +134,8 @@
        return flags;
 }
 
-static int set_if_flags(s, name, flags)
-       int             s;
-       const char      *name;
-       int             flags;
+static int
+set_if_flags(int s, const char *name, int flags)
 {
        struct ifreq ifreq;
 
@@ -152,8 +147,8 @@
        return 0;
 }
 
-static void wi_apscan(iface)
-       char                    *iface;
+static void
+wi_apscan(char *iface)
 {
        struct wi_req           wreq;
        struct ifreq            ifr;
@@ -284,9 +279,8 @@
 }
 #endif
 
-static int wi_getval(iface, wreq)
-       char                    *iface;
-       struct wi_req           *wreq;
+static int
+wi_getval(char *iface, struct wi_req *wreq)
 {
        struct ifreq            ifr;
        int                     s, error;
@@ -312,9 +306,8 @@
        return error;
 }
 
-static void wi_setval(iface, wreq)
-       char                    *iface;
-       struct wi_req           *wreq;
+static void
+wi_setval(char *iface, struct wi_req *wreq)
 {
        struct ifreq            ifr;
        int                     s;
@@ -337,8 +330,8 @@
        return;
 }
 
-void wi_printstr(wreq)
-       struct wi_req           *wreq;
+static void
+wi_printstr(struct wi_req *wreq)
 {
        char                    *ptr;
        int                     i;
@@ -365,10 +358,8 @@
        return;
 }
 
-void wi_setstr(iface, code, str)
-       char                    *iface;
-       int                     code;
-       char                    *str;
+static void
+wi_setstr(char *iface, int code, char *str)
 {
        struct wi_req           wreq;
 
@@ -387,11 +378,8 @@
        return;
 }
 
-void wi_setbytes(iface, code, bytes, len)
-       char                    *iface;
-       int                     code;
-       char                    *bytes;
-       int                     len;
+static void
+wi_setbytes(char *iface, int code, char *bytes, int len)
 {
        struct wi_req           wreq;
 
@@ -406,10 +394,8 @@
        return;
 }
 
-void wi_setword(iface, code, word)
-       char                    *iface;
-       int                     code;
-       int                     word;
+static void
+wi_setword(char *iface, int code, int word)
 {
        struct wi_req           wreq;
 
@@ -424,10 +410,8 @@
        return;
 }
 
-void wi_sethex(iface, code, str)
-       char                    *iface;
-       int                     code;
-       char                    *str;
+static void
+wi_sethex(char *iface, int code, char *str)
 {
        struct ether_addr       *addr;
 
@@ -440,8 +424,8 @@
        return;
 }
 
-static void wi_printkeys(wreq)
-        struct wi_req           *wreq;
+static void
+wi_printkeys(struct wi_req *wreq)
 {
         int                     i, j, bn;
         struct wi_key           *k;
@@ -474,8 +458,8 @@
         return;
 };
 
-void wi_printvendor(wreq)
-       struct wi_req           *wreq;
+static void
+wi_printvendor(struct wi_req *wreq)
 {
        /* id
         * vendor
@@ -511,8 +495,8 @@
        return;
 }      
 
-void wi_printwords(wreq)
-       struct wi_req           *wreq;
+static void
+wi_printwords(struct wi_req *wreq)
 {
        int                     i;
 



Home | Main Index | Thread Index | Old Index