Source-Changes-HG archive

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

[src/trunk]: src/sys/net ANSI function decls and application of static.



details:   https://anonhg.NetBSD.org/src/rev/db09763c0299
branches:  trunk
changeset: 586259:db09763c0299
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Dec 11 23:05:24 2005 +0000

description:
ANSI function decls and application of static.

diffstat:

 sys/net/bsd-comp.c     |  106 ++++++++-------------
 sys/net/if.c           |  147 ++++++++++--------------------
 sys/net/if.h           |  122 ++++++++++++------------
 sys/net/if_arc.h       |   10 +-
 sys/net/if_arcsubr.c   |   43 +++-----
 sys/net/if_atm.h       |   14 +-
 sys/net/if_atmsubr.c   |   23 +---
 sys/net/if_bridge.c    |  233 +++++++++++++++++++++++++-----------------------
 sys/net/if_dl.h        |    6 +-
 sys/net/if_ethersubr.c |   10 +-
 sys/net/if_faith.c     |   54 ++++-------
 sys/net/if_faith.h     |    4 +-
 sys/net/if_fddi.h      |    6 +-
 sys/net/if_fddisubr.c  |   25 +---
 sys/net/if_gif.c       |   86 ++++++-----------
 sys/net/if_gif.h       |   18 +-
 sys/net/if_gre.c       |   38 +++---
 sys/net/if_gre.h       |    5 +-
 sys/net/if_hippi.h     |    6 +-
 sys/net/if_hippisubr.c |   29 ++---
 sys/net/if_loop.c      |   20 ++--
 sys/net/if_ppp.c       |   80 +++++-----------
 sys/net/if_ppp.h       |    4 +-
 sys/net/if_pppoe.c     |   37 +++---
 sys/net/if_pppvar.h    |   24 ++--
 sys/net/if_sl.c        |   78 +++++++---------
 sys/net/if_slvar.h     |   16 +--
 sys/net/if_stf.c       |   92 +++++++-----------
 sys/net/if_stf.h       |    4 +-
 sys/net/if_strip.c     |  128 ++++++++++----------------
 sys/net/if_stripvar.h  |   12 +--
 sys/net/if_token.h     |    6 +-
 sys/net/if_tokensubr.c |   28 ++---
 sys/net/if_tun.c       |  129 +++++++++-----------------
 sys/net/ppp-comp.h     |   28 ++--
 sys/net/ppp-deflate.c  |  101 ++++++++-------------
 sys/net/ppp_tty.c      |  131 +++++++++-----------------
 sys/net/raw_cb.c       |   14 +-
 sys/net/raw_cb.h       |   22 ++--
 sys/net/raw_usrreq.c   |   26 +---
 sys/net/slcompress.c   |   33 +-----
 sys/net/slcompress.h   |   16 +-
 42 files changed, 814 insertions(+), 1200 deletions(-)

diffs (truncated from 4859 to 300 lines):

diff -r 5b55d7a4db79 -r db09763c0299 sys/net/bsd-comp.c
--- a/sys/net/bsd-comp.c        Sun Dec 11 20:07:30 2005 +0000
+++ b/sys/net/bsd-comp.c        Sun Dec 11 23:05:24 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bsd-comp.c,v 1.13 2005/12/11 12:24:51 christos Exp $   */
+/*     $NetBSD: bsd-comp.c,v 1.14 2005/12/11 23:05:24 thorpej Exp $    */
 /*     Id: bsd-comp.c,v 1.6 1996/08/28 06:31:58 paulus Exp     */
 
 /* Because this code is derived from the 4.3BSD compress source:
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bsd-comp.c,v 1.13 2005/12/11 12:24:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bsd-comp.c,v 1.14 2005/12/11 23:05:24 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -129,20 +129,20 @@
 #define BSD_OVHD       2               /* BSD compress overhead/packet */
 #define BSD_INIT_BITS  BSD_MIN_BITS
 
-static void    *bsd_comp_alloc __P((u_char *options, int opt_len));
-static void    *bsd_decomp_alloc __P((u_char *options, int opt_len));
-static void    bsd_free __P((void *state));
-static int     bsd_comp_init __P((void *state, u_char *options, int opt_len,
-                                  int unit, int hdrlen, int debug));
-static int     bsd_decomp_init __P((void *state, u_char *options, int opt_len,
-                                    int unit, int hdrlen, int mru, int debug));
-static int     bsd_compress __P((void *state, struct mbuf **mret,
-                                 struct mbuf *mp, int slen, int maxolen));
-static void    bsd_incomp __P((void *state, struct mbuf *dmsg));
-static int     bsd_decompress __P((void *state, struct mbuf *cmp,
-                                   struct mbuf **dmpp));
-static void    bsd_reset __P((void *state));
-static void    bsd_comp_stats __P((void *state, struct compstat *stats));
+static void    *bsd_comp_alloc(u_char *options, int opt_len);
+static void    *bsd_decomp_alloc(u_char *options, int opt_len);
+static void    bsd_free(void *state);
+static int     bsd_comp_init(void *state, u_char *options, int opt_len,
+                             int unit, int hdrlen, int debug);
+static int     bsd_decomp_init(void *state, u_char *options, int opt_len,
+                               int unit, int hdrlen, int mru, int debug);
+static int     bsd_compress(void *state, struct mbuf **mret,
+                            struct mbuf *mp, int slen, int maxolen);
+static void    bsd_incomp(void *state, struct mbuf *dmsg);
+static int     bsd_decompress(void *state, struct mbuf *cmp,
+                              struct mbuf **dmpp);
+static void    bsd_reset(void *state);
+static void    bsd_comp_stats(void *state, struct compstat *stats);
 
 /*
  * Procedures exported to if_ppp.c.
@@ -186,18 +186,17 @@
 #define RATIO_SCALE    (1<<RATIO_SCALE_LOG)
 #define RATIO_MAX      (0x7fffffff>>RATIO_SCALE_LOG)
 
-static void bsd_clear __P((struct bsd_db *));
-static int bsd_check __P((struct bsd_db *));
-static void *bsd_alloc __P((u_char *, int, int));
-static int bsd_init __P((struct bsd_db *, u_char *, int, int, int, int,
-                        int, int));
+static void    bsd_clear(struct bsd_db *);
+static int     bsd_check(struct bsd_db *);
+static void    *bsd_alloc(u_char *, int, int);
+static int     bsd_init(struct bsd_db *, u_char *, int, int, int, int,
+                        int, int);
 
 /*
  * clear the dictionary
  */
 static void
-bsd_clear(db)
-    struct bsd_db *db;
+bsd_clear(struct bsd_db *db)
 {
     db->clear_count++;
     db->max_ent = FIRST-1;
@@ -222,8 +221,7 @@
  * must compute the same ratio.
  */
 static int                             /* 1=output CLEAR */
-bsd_check(db)
-    struct bsd_db *db;
+bsd_check(struct bsd_db *db)
 {
     u_int new_ratio;
 
@@ -263,9 +261,7 @@
  * Return statistics.
  */
 static void
-bsd_comp_stats(state, stats)
-    void *state;
-    struct compstat *stats;
+bsd_comp_stats(void *state, struct compstat *stats)
 {
     struct bsd_db *db = (struct bsd_db *) state;
     u_int out;
@@ -290,8 +286,7 @@
  * Reset state, as on a CCP ResetReq.
  */
 static void
-bsd_reset(state)
-    void *state;
+bsd_reset(void *state)
 {
     struct bsd_db *db = (struct bsd_db *) state;
 
@@ -304,9 +299,7 @@
  * Allocate space for a (de) compressor.
  */
 static void *
-bsd_alloc(options, opt_len, decomp)
-    u_char *options;
-    int opt_len, decomp;
+bsd_alloc(u_char *options, int opt_len, int decomp)
 {
     int bits;
     u_int newlen, hsize, hshift, maxmaxcode;
@@ -373,8 +366,7 @@
 }
 
 static void
-bsd_free(state)
-    void *state;
+bsd_free(void *state)
 {
     struct bsd_db *db = (struct bsd_db *) state;
 
@@ -384,17 +376,13 @@
 }
 
 static void *
-bsd_comp_alloc(options, opt_len)
-    u_char *options;
-    int opt_len;
+bsd_comp_alloc(u_char *options, int opt_len)
 {
     return bsd_alloc(options, opt_len, 0);
 }
 
 static void *
-bsd_decomp_alloc(options, opt_len)
-    u_char *options;
-    int opt_len;
+bsd_decomp_alloc(u_char *options, int opt_len)
 {
     return bsd_alloc(options, opt_len, 1);
 }
@@ -403,10 +391,8 @@
  * Initialize the database.
  */
 static int
-bsd_init(db, options, opt_len, unit, hdrlen, mru, debug, decomp)
-    struct bsd_db *db;
-    u_char *options;
-    int opt_len, unit, hdrlen, mru, debug, decomp;
+bsd_init(struct bsd_db *db, u_char *options, int opt_len, int unit, int hdrlen,
+         int mru, int debug, int decomp)
 {
     int i;
 
@@ -442,20 +428,16 @@
 }
 
 static int
-bsd_comp_init(state, options, opt_len, unit, hdrlen, debug)
-    void *state;
-    u_char *options;
-    int opt_len, unit, hdrlen, debug;
+bsd_comp_init(void *state, u_char *options, int opt_len, int unit, int hdrlen,
+              int debug)
 {
     return bsd_init((struct bsd_db *) state, options, opt_len,
                    unit, hdrlen, 0, debug, 0);
 }
 
 static int
-bsd_decomp_init(state, options, opt_len, unit, hdrlen, mru, debug)
-    void *state;
-    u_char *options;
-    int opt_len, unit, hdrlen, mru, debug;
+bsd_decomp_init(void *state, u_char *options, int opt_len, int unit, int hdrlen,
+                int mru, int debug)
 {
     return bsd_init((struct bsd_db *) state, options, opt_len,
                    unit, hdrlen, mru, debug, 1);
@@ -468,12 +450,10 @@
  *     code size expands, we do not output a bunch of padding.
  */
 int                                    /* new slen */
-bsd_compress(state, mret, mp, slen, maxolen)
-    void *state;
-    struct mbuf **mret;                /* return compressed mbuf chain here */
-    struct mbuf *mp;           /* from here */
-    int slen;                  /* uncompressed length */
-    int maxolen;               /* max compressed length */
+bsd_compress(void *state,
+             struct mbuf **mret /* return compressed mbuf chain here */,
+            struct mbuf *mp /* from here */,
+            int slen, int maxolen)
 {
     struct bsd_db *db = (struct bsd_db *) state;
     int hshift = db->hshift;
@@ -685,9 +665,7 @@
  * incompressible data by pretending to compress the incoming data.
  */
 static void
-bsd_incomp(state, dmsg)
-    void *state;
-    struct mbuf *dmsg;
+bsd_incomp(void *state, struct mbuf *dmsg)
 {
     struct bsd_db *db = (struct bsd_db *) state;
     u_int hshift = db->hshift;
@@ -815,9 +793,7 @@
  * compression, even though they are detected by inspecting the input.
  */
 int
-bsd_decompress(state, cmp, dmpp)
-    void *state;
-    struct mbuf *cmp, **dmpp;
+bsd_decompress(void *state, struct mbuf *cmp, struct mbuf **dmpp)
 {
     struct bsd_db *db = (struct bsd_db *) state;
     u_int max_ent = db->max_ent;
diff -r 5b55d7a4db79 -r db09763c0299 sys/net/if.c
--- a/sys/net/if.c      Sun Dec 11 20:07:30 2005 +0000
+++ b/sys/net/if.c      Sun Dec 11 23:05:24 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.162 2005/12/11 12:24:51 christos Exp $        */
+/*     $NetBSD: if.c,v 1.163 2005/12/11 23:05:24 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.162 2005/12/11 12:24:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.163 2005/12/11 23:05:24 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -159,13 +159,13 @@
 
 int netisr;                    /* scheduling bits for network */
 
-int if_rt_walktree __P((struct radix_node *, void *));
+static int     if_rt_walktree(struct radix_node *, void *);
 
-struct if_clone *if_clone_lookup __P((const char *, int *));
-int if_clone_list __P((struct if_clonereq *));
+static struct if_clone *if_clone_lookup(const char *, int *);
+static int     if_clone_list(struct if_clonereq *);
 
-LIST_HEAD(, if_clone) if_cloners = LIST_HEAD_INITIALIZER(if_cloners);
-int if_cloners_count;
+static LIST_HEAD(, if_clone) if_cloners = LIST_HEAD_INITIALIZER(if_cloners);
+static int if_cloners_count;
 
 #ifdef PFIL_HOOKS
 struct pfil_head if_pfil;      /* packet filtering hook for interfaces */
@@ -173,7 +173,7 @@
 
 #if defined(INET) || defined(INET6) || defined(NETATALK) || defined(NS) || \
     defined(ISO) || defined(CCITT) || defined(NATM)
-static void if_detach_queues __P((struct ifnet *, struct ifqueue *));
+static void if_detach_queues(struct ifnet *, struct ifqueue *);
 #endif
 
 /*
@@ -183,7 +183,7 @@
  * parameters.
  */
 void
-ifinit()
+ifinit(void)
 {
 
        callout_init(&if_slowtimo_ch);
@@ -202,71 +202,57 @@
  */
 
 int
-if_nulloutput(ifp, m, so, rt)
-       struct ifnet *ifp;
-       struct mbuf *m;
-       struct sockaddr *so;
-       struct rtentry *rt;
+if_nulloutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *so,
+    struct rtentry *rt)
 {
 
        return (ENXIO);
 }
 
 void
-if_nullinput(ifp, m)



Home | Main Index | Thread Index | Old Index