Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/mrouted Unifdef __STDC__. Remove __P(). Remove regi...



details:   https://anonhg.NetBSD.org/src/rev/53b082c0b088
branches:  trunk
changeset: 534059:53b082c0b088
user:      wiz <wiz%NetBSD.org@localhost>
date:      Sun Jul 14 16:30:41 2002 +0000

description:
Unifdef __STDC__. Remove __P(). Remove register. ANSIfy.

diffstat:

 usr.sbin/mrouted/callout.c |   27 ++--
 usr.sbin/mrouted/cfparse.y |   53 +-------
 usr.sbin/mrouted/config.c  |    8 +-
 usr.sbin/mrouted/defs.h    |  261 ++++++++++++++++++++------------------------
 usr.sbin/mrouted/igmp.c    |   26 +--
 usr.sbin/mrouted/inet.c    |   40 ++----
 usr.sbin/mrouted/kern.c    |   46 ++-----
 usr.sbin/mrouted/main.c    |  102 +++++------------
 usr.sbin/mrouted/prune.c   |  232 +++++++++++++--------------------------
 usr.sbin/mrouted/route.c   |  171 ++++++++++++-----------------
 usr.sbin/mrouted/rsrr.c    |   21 +-
 usr.sbin/mrouted/snmp.c    |   66 +++++-----
 usr.sbin/mrouted/vif.c     |  203 +++++++++++++---------------------
 13 files changed, 495 insertions(+), 761 deletions(-)

diffs (truncated from 2669 to 300 lines):

diff -r db6df87915e3 -r 53b082c0b088 usr.sbin/mrouted/callout.c
--- a/usr.sbin/mrouted/callout.c        Sun Jul 14 15:34:58 2002 +0000
+++ b/usr.sbin/mrouted/callout.c        Sun Jul 14 16:30:41 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: callout.c,v 1.4 1997/10/17 10:37:55 lukem Exp $        */
+/*     $NetBSD: callout.c,v 1.5 2002/07/14 16:30:41 wiz Exp $  */
 
 /*
  * The mrouted program is covered by the license in the accompanying file
@@ -26,15 +26,15 @@
 };
 
 #ifdef IGMP_DEBUG
-static void print_Q __P((void));
+static void print_Q(void);
 #else
 #define        print_Q()       
 #endif
 
-int secs_remaining __P((int));
+int secs_remaining(int);
 
 void
-callout_init()
+callout_init(void)
 {
     Q = (struct timeout_q *) 0;
 }
@@ -44,7 +44,7 @@
  * signal handler for SIGALARM that is called once every second
  */
 void
-age_callout_queue()
+age_callout_queue(void)
 {
     struct timeout_q *ptr;
     
@@ -82,12 +82,13 @@
 
 /* 
  * sets the timer
+ *
+ * delay: number of units for timeout
+ * action: function to be called on timeout
+ * data: what to call the timeout function with
  */
 int
-timer_setTimer(delay, action, data)
-    int        delay;          /* number of units for timeout */
-    cfunc_t    action;         /* function to be called on timeout */
-    char       *data;          /* what to call the timeout function with */
+timer_setTimer(int delay, cfunc_t action, char *data)
 {
     struct     timeout_q  *ptr, *node, *prev;
     
@@ -150,8 +151,7 @@
 
 /* clears the associated timer */
 void
-timer_clearTimer(timer_id)
-    int  timer_id;
+timer_clearTimer(int timer_id)
 {
     struct timeout_q  *ptr, *prev;
     
@@ -202,7 +202,7 @@
  * debugging utility
  */
 static void
-print_Q()
+print_Q(void)
 {
     struct timeout_q  *ptr;
     
@@ -212,8 +212,7 @@
 #endif /* IGMP_DEBUG */
 
 int
-secs_remaining(timer_id)
-    int  timer_id;
+secs_remaining(int timer_id)
 {
     struct timeout_q  *ptr;
     int left=0;
diff -r db6df87915e3 -r 53b082c0b088 usr.sbin/mrouted/cfparse.y
--- a/usr.sbin/mrouted/cfparse.y        Sun Jul 14 15:34:58 2002 +0000
+++ b/usr.sbin/mrouted/cfparse.y        Sun Jul 14 16:30:41 2002 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: cfparse.y,v 1.7 2001/08/02 03:41:42 itojun Exp $       */
+/*     $NetBSD: cfparse.y,v 1.8 2002/07/14 16:30:42 wiz Exp $  */
 
 /*
  * Configuration file parser for mrouted.
@@ -23,28 +23,23 @@
  * THE USE OF THIS SOFTWARE.
  */
 #include <stdio.h>
-#ifdef __STDC__
 #include <stdarg.h>
-#else
-#include <string.h>
-#include <varargs.h>
-#endif
 #include "defs.h"
 #include <netdb.h>
 
 /*
  * Local function declarations
  */
-static void            fatal __P((char *fmt, ...))
+static void            fatal(char *fmt, ...)
     __attribute__((__format__(__printf__, 1, 2)));
-static void            warn __P((char *fmt, ...))
+static void            warn(char *fmt, ...)
         __attribute__((__format__(__printf__, 1, 2)));
-static void            yyerror __P((char *s));
-static char *          next_word __P((void));
-static int             yylex __P((void));
-static u_int32_t       valid_if __P((char *s));
-static struct ifreq *  ifconfaddr __P((struct ifconf *ifcp, u_int32_t a));
-int                    yyparse __P((void));
+static void            yyerror(char *s);
+static char *          next_word(void);
+static int             yylex(void);
+static u_int32_t       valid_if(char *s);
+static struct ifreq *  ifconfaddr(struct ifconf *ifcp, u_int32_t a);
+int                    yyparse(void);
 
 static FILE *f __attribute__((__unused__));    /* XXX egcs */
 extern int udp_socket;
@@ -396,7 +391,6 @@
        | ADDR                  { $$.addr = $1; $$.mask = 0; }
        ;
 %%
-#ifdef __STDC__
 static void
 fatal(char *fmt, ...)
 {
@@ -404,25 +398,12 @@
        char buf[200];
 
        va_start(ap, fmt);
-#else
-/*VARARGS1*/
-static void
-fatal(fmt, va_alist)
-char *fmt;
-va_dcl
-{
-       va_list ap;
-       char buf[200];
-
-       va_start(ap);
-#endif
        vsprintf(buf, fmt, ap);
        va_end(ap);
 
        log(LOG_ERR,0,"%s: %s near line %d", configfilename, buf, lineno);
 }
 
-#ifdef __STDC__
 static void
 warn(char *fmt, ...)
 {
@@ -430,18 +411,6 @@
        char buf[200];
 
        va_start(ap, fmt);
-#else
-/*VARARGS1*/
-static void
-warn(fmt, va_alist)
-char *fmt;
-va_dcl
-{
-       va_list ap;
-       char buf[200];
-
-       va_start(ap);
-#endif
        vsprintf(buf, fmt, ap);
        va_end(ap);
 
@@ -618,8 +587,8 @@
 valid_if(s)
 char *s;
 {
-       register vifi_t vifi;
-       register struct uvif *v;
+       vifi_t vifi;
+       struct uvif *v;
 
        for (vifi=0, v=uvifs; vifi<numvifs; vifi++, v++)
            if (!strcmp(v->uv_name, s))
diff -r db6df87915e3 -r 53b082c0b088 usr.sbin/mrouted/config.c
--- a/usr.sbin/mrouted/config.c Sun Jul 14 15:34:58 2002 +0000
+++ b/usr.sbin/mrouted/config.c Sun Jul 14 16:30:41 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: config.c,v 1.6 1995/12/10 10:06:58 mycroft Exp $       */
+/*     $NetBSD: config.c,v 1.7 2002/07/14 16:30:42 wiz Exp $   */
 
 /*
  * The mrouted program is covered by the license in the accompanying file
@@ -18,13 +18,13 @@
  * and install them in the uvifs array.
  */
 void
-config_vifs_from_kernel()
+config_vifs_from_kernel(void)
 {
     struct ifreq ifbuf[32];
     struct ifreq *ifrp, *ifend;
     struct ifconf ifc;
-    register struct uvif *v;
-    register vifi_t vifi;
+    struct uvif *v;
+    vifi_t vifi;
     int n;
     u_int32_t addr, mask, subnet;
     short flags;
diff -r db6df87915e3 -r 53b082c0b088 usr.sbin/mrouted/defs.h
--- a/usr.sbin/mrouted/defs.h   Sun Jul 14 15:34:58 2002 +0000
+++ b/usr.sbin/mrouted/defs.h   Sun Jul 14 16:30:41 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: defs.h,v 1.8 2000/10/11 20:23:53 is Exp $      */
+/*     $NetBSD: defs.h,v 1.9 2002/07/14 16:30:42 wiz Exp $     */
 
 /*
  * The mrouted program is covered by the license in the accompanying file
@@ -36,16 +36,8 @@
 #include <sys/un.h>
 #endif /* RSRR */
 
-#ifndef __P
-#ifdef __STDC__
-#define __P(x) x
-#else
-#define __P(x) ()
-#endif
-#endif
-
-typedef void (*cfunc_t) __P((void *));
-typedef void (*ihfunc_t) __P((int, fd_set *));
+typedef void (*cfunc_t)(void *);
+typedef void (*ihfunc_t)(int, fd_set *);
 
 #include "dvmrp.h"
 #include "vif.h"
@@ -87,12 +79,7 @@
                            /* for Deleting kernel table entries */
 
 /* obnoxious gcc gives an extraneous warning about this constant... */
-#if defined(__STDC__) || defined(__GNUC__)
 #define JAN_1970       2208988800UL    /* 1970 - 1900 in seconds */
-#else
-#define JAN_1970       2208988800L     /* 1970 - 1900 in seconds */
-#define const          /**/
-#endif
 
 #ifdef RSRR
 #define BIT_ZERO(X)      ((X) = 0)
@@ -161,163 +148,157 @@
 #endif
 
 /* main.c */
-extern void            log __P((int, int, const char *, ...))
+extern void            log(int, int, const char *, ...)
        __attribute__((__format__(__printf__, 3, 4)));
-extern int             register_input_handler __P((int fd, ihfunc_t func));
+extern int             register_input_handler(int fd, ihfunc_t func);
 
 /* igmp.c */
-extern void            init_igmp __P((void));
-extern void            accept_igmp __P((int recvlen));
-extern void            send_igmp __P((u_int32_t src, u_int32_t dst, int type,
-                                               int code, u_int32_t group,
-                                               int datalen));
+extern void            init_igmp(void);
+extern void            accept_igmp(int recvlen);
+extern void            send_igmp(u_int32_t src, u_int32_t dst, int type,
+                                 int code, u_int32_t group, int datalen);
 
 /* callout.c */
-extern void            callout_init __P((void));
-extern void            age_callout_queue __P((void));
-extern int             timer_setTimer __P((int delay, cfunc_t action,
-                                               char *data));
-extern void            timer_clearTimer __P((int timer_id));
+extern void            callout_init(void);
+extern void            age_callout_queue(void);
+extern int             timer_setTimer(int delay, cfunc_t action, char *data);
+extern void            timer_clearTimer(int timer_id);
 
 /* route.c */
-extern void            init_routes __P((void));
-extern void            start_route_updates __P((void));
-extern void            update_route __P((u_int32_t origin, u_int32_t mask,
-                                               u_int metric, u_int32_t src,
-                                               vifi_t vifi));



Home | Main Index | Thread Index | Old Index