Source-Changes-HG archive

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

[src/trunk]: src/sbin/route Kill __P(), use ANSI function declarations.



details:   https://anonhg.NetBSD.org/src/rev/58d1d3f720b9
branches:  trunk
changeset: 573686:58d1d3f720b9
user:      xtraeme <xtraeme%NetBSD.org@localhost>
date:      Sat Feb 05 14:05:23 2005 +0000

description:
Kill __P(), use ANSI function declarations.

diffstat:

 sbin/route/ccitt_addr.c |   11 +--
 sbin/route/extern.h     |   16 ++--
 sbin/route/route.c      |  145 +++++++++++++++++------------------------------
 sbin/route/show.c       |   33 ++++------
 4 files changed, 77 insertions(+), 128 deletions(-)

diffs (truncated from 520 to 300 lines):

diff -r 4aefc5afddcf -r 58d1d3f720b9 sbin/route/ccitt_addr.c
--- a/sbin/route/ccitt_addr.c   Sat Feb 05 13:47:19 2005 +0000
+++ b/sbin/route/ccitt_addr.c   Sat Feb 05 14:05:23 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ccitt_addr.c,v 1.13 2003/08/07 10:04:38 agc Exp $      */
+/*     $NetBSD: ccitt_addr.c,v 1.14 2005/02/05 14:05:23 xtraeme Exp $  */
 
 /*
  * Copyright (c) 1990, 1993
@@ -56,12 +56,10 @@
 
 #include "extern.h"
 
-static char *copychar __P((char *, char *));
+static char *copychar(char *, char *);
 
 int
-ccitt_addr (addr, xp)
-       char *addr;
-       struct sockaddr_x25 *xp;
+ccitt_addr(char *addr, struct sockaddr_x25 *xp)
 {
        char *p, *ap, *limit;
        int havenet = 0;
@@ -154,8 +152,7 @@
 }
 
 static char *
-copychar (from, to)
-       char *from, *to;
+copychar(char *from, char *to)
 {
        int n;
 
diff -r 4aefc5afddcf -r 58d1d3f720b9 sbin/route/extern.h
--- a/sbin/route/extern.h       Sat Feb 05 13:47:19 2005 +0000
+++ b/sbin/route/extern.h       Sat Feb 05 14:05:23 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.2 2001/10/24 16:05:06 atatat Exp $        */
+/*     $NetBSD: extern.h,v 1.3 2005/02/05 14:05:23 xtraeme Exp $       */
 
 /*
  * Copyright (c) 1997 Christos Zoulas.  All rights reserved.
@@ -34,16 +34,16 @@
 struct sockaddr_ns;
 
 /* show.c */
-void show __P((int, char **));
+void show(int, char **);
 
 /* ccitt_addr.c */
-int ccitt_addr __P((char *, struct sockaddr_x25 *));
+int ccitt_addr(char *, struct sockaddr_x25 *);
 
 /* route.c */
 extern int nflag;
 #define NOTDEFSTRING "0.0.0.0/xxx.xxx.xxx.xxx\0"
-int netmask_length __P((struct sockaddr *, int));
-char *netmask_string __P((struct sockaddr *, int));
-char *routename __P((struct sockaddr *, struct sockaddr *, int));
-char *netname __P((struct sockaddr *, struct sockaddr *));
-char *ns_print __P((struct sockaddr_ns *));
+int netmask_length(struct sockaddr *, int);
+char *netmask_string(struct sockaddr *, int);
+char *routename(struct sockaddr *, struct sockaddr *, int);
+char *netname(struct sockaddr *, struct sockaddr *);
+char *ns_print(struct sockaddr_ns *);
diff -r 4aefc5afddcf -r 58d1d3f720b9 sbin/route/route.c
--- a/sbin/route/route.c        Sat Feb 05 13:47:19 2005 +0000
+++ b/sbin/route/route.c        Sat Feb 05 14:05:23 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: route.c,v 1.74 2004/11/16 05:59:32 itojun Exp $        */
+/*     $NetBSD: route.c,v 1.75 2005/02/05 14:05:23 xtraeme Exp $       */
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)route.c    8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.74 2004/11/16 05:59:32 itojun Exp $");
+__RCSID("$NetBSD: route.c,v 1.75 2005/02/05 14:05:23 xtraeme Exp $");
 #endif
 #endif /* not lint */
 
@@ -76,34 +76,33 @@
 
 typedef union sockunion *sup;
 
-int main __P((int, char **));
-static void usage __P((char *)) __attribute__((__noreturn__));
-static char *any_ntoa __P((const struct sockaddr *));
-static void set_metric __P((char *, int));
-static int newroute __P((int, char **));
-static void inet_makenetandmask __P((u_int32_t, struct sockaddr_in *));
+static void usage(char *)__attribute__((__noreturn__));
+static char *any_ntoa(const struct sockaddr *);
+static void set_metric(char *, int);
+static int newroute(int, char **);
+static void inet_makenetandmask(u_int32_t, struct sockaddr_in *);
 #ifdef INET6
-static int inet6_makenetandmask __P((struct sockaddr_in6 *));
+static int inet6_makenetandmask(struct sockaddr_in6 *);
 #endif
-static int getaddr __P((int, char *, struct hostent **));
-static int flushroutes __P((int, char *[], int));
+static int getaddr(int, char *, struct hostent **);
+static int flushroutes(int, char *[], int);
 #ifndef SMALL
-static int prefixlen __P((char *));
-static int x25_makemask __P((void));
-static void interfaces __P((void));
-static void monitor __P((void));
-static void print_getmsg __P((struct rt_msghdr *, int));
-static const char *linkstate __P((struct if_msghdr *));
+static int prefixlen(char *);
+static int x25_makemask(void);
+static void interfaces(void);
+static void monitor(void);
+static void print_getmsg(struct rt_msghdr *, int);
+static const char *linkstate(struct if_msghdr *);
 #endif /* SMALL */
-static int rtmsg __P((int, int ));
-static void mask_addr __P((void));
-static void print_rtmsg __P((struct rt_msghdr *, int));
-static void pmsg_common __P((struct rt_msghdr *));
-static void pmsg_addrs __P((char *, int));
-static void bprintf __P((FILE *, int, u_char *));
-static int keyword __P((char *));
-static void sodump __P((sup, char *));
-static void sockaddr __P((char *, struct sockaddr *));
+static int rtmsg(int, int );
+static void mask_addr(void);
+static void print_rtmsg(struct rt_msghdr *, int);
+static void pmsg_common(struct rt_msghdr *);
+static void pmsg_addrs(char *, int);
+static void bprintf(FILE *, int, u_char *);
+static int keyword(char *);
+static void sodump(sup, char *);
+static void sockaddr(char *, struct sockaddr *);
 
 union  sockunion {
        struct  sockaddr sa;
@@ -132,8 +131,7 @@
 
 
 static void
-usage(cp)
-       char *cp;
+usage(char *cp)
 {
 
        if (cp)
@@ -150,9 +148,7 @@
 #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
 
 int
-main(argc, argv)
-       int argc;
-       char **argv;
+main(int argc, char **argv)
 {
        int ch;
 
@@ -244,10 +240,7 @@
  * associated with network interfaces.
  */
 static int
-flushroutes(argc, argv, doall)
-       int argc;
-       char *argv[];
-       int doall;
+flushroutes(int argc, char *argv[], int doall)
 {
        size_t needed;
        int mib[6], rlen, seqno;
@@ -356,8 +349,7 @@
 static char hexlist[] = "0123456789abcdef";
 
 static char *
-any_ntoa(sa)
-       const struct sockaddr *sa;
+any_ntoa(const struct sockaddr *sa)
 {
        static char obuf[3 * 256];
        const char *in;
@@ -379,9 +371,7 @@
 
 
 int
-netmask_length(nm, family)
-       struct sockaddr *nm;
-       int family;
+netmask_length(struct sockaddr *nm, int family)
 {
        static int
            /* number of bits in a nibble */
@@ -449,9 +439,7 @@
 }
 
 char *
-netmask_string(mask, len)
-       struct sockaddr *mask;
-       int len;
+netmask_string(struct sockaddr *mask, int len)
 {
        static char smask[16];
 
@@ -471,9 +459,7 @@
 
 
 char *
-routename(sa, nm, flags)
-       struct sockaddr *sa, *nm;
-       int flags;
+routename(struct sockaddr *sa, struct sockaddr *nm, int flags)
 {
        char *cp;
        static char line[50];
@@ -604,8 +590,7 @@
  * The address is assumed to be that of a net or subnet, not a host.
  */
 char *
-netname(sa, nm)
-       struct sockaddr *sa, *nm;
+netname(struct sockaddr *sa, struct sockaddr *nm)
 {
        char *cp = 0;
        static char line[50];
@@ -753,9 +738,7 @@
 }
 
 static void
-set_metric(value, key)
-       char *value;
-       int key;
+set_metric(char *value, int key)
 {
        int flag = 0;
        u_long noval, *valp = &noval;
@@ -780,9 +763,7 @@
 }
 
 static int
-newroute(argc, argv)
-       int argc;
-       char **argv;
+newroute(int argc, char **argv)
 {
        char *cmd, *dest = "", *gateway = "";
        const char *error;
@@ -1098,8 +1079,7 @@
  * XXX the function may need more improvement...
  */
 static int
-inet6_makenetandmask(sin6)
-       struct sockaddr_in6 *sin6;
+inet6_makenetandmask(struct sockaddr_in6 *sin6)
 {
        char *plen;
        struct in6_addr in6;
@@ -1130,10 +1110,7 @@
  * returning 1 if a host address, 0 if a network address.
  */
 static int
-getaddr(which, s, hpp)
-       int which;
-       char *s;
-       struct hostent **hpp;
+getaddr(int which, char *s, struct hostent **hpp)
 {
        sup su;
        struct hostent *hp;
@@ -1401,7 +1378,7 @@
 
 #ifndef SMALL
 int
-x25_makemask()
+x25_makemask(void)
 {
        char *cp;
 
@@ -1417,8 +1394,7 @@
 
 
 char *
-ns_print(sns)
-       struct sockaddr_ns *sns;
+ns_print(struct sockaddr_ns *sns)
 {
        struct ns_addr work;
        union { union ns_net net_e; u_int32_t int32_t_e; } net;
@@ -1462,7 +1438,7 @@
 }
 
 static void
-interfaces()
+interfaces(void)
 {
        size_t needed;



Home | Main Index | Thread Index | Old Index