Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin ANSIfy. Remove ifndef __STDC__. Remove __P().



details:   https://anonhg.NetBSD.org/src/rev/fba84c715839
branches:  trunk
changeset: 534042:fba84c715839
user:      wiz <wiz%NetBSD.org@localhost>
date:      Sun Jul 14 01:01:10 2002 +0000

description:
ANSIfy. Remove ifndef __STDC__. Remove __P().

diffstat:

 usr.sbin/mtrace/mtrace.c |  230 +++++++++++++++-------------------------------
 usr.sbin/rdate/rdate.c   |   18 +--
 2 files changed, 83 insertions(+), 165 deletions(-)

diffs (truncated from 504 to 300 lines):

diff -r 5033f570d53a -r fba84c715839 usr.sbin/mtrace/mtrace.c
--- a/usr.sbin/mtrace/mtrace.c  Sun Jul 14 00:58:30 2002 +0000
+++ b/usr.sbin/mtrace/mtrace.c  Sun Jul 14 01:01:10 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mtrace.c,v 1.19 2002/06/02 13:47:04 itojun Exp $       */
+/*     $NetBSD: mtrace.c,v 1.20 2002/07/14 01:10:56 wiz Exp $  */
 
 /*
  * mtrace.c
@@ -52,7 +52,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: mtrace.c,v 1.19 2002/06/02 13:47:04 itojun Exp $");
+__RCSID("$NetBSD: mtrace.c,v 1.20 2002/07/14 01:10:56 wiz Exp $");
 #endif
 
 #include <sys/types.h>
@@ -66,11 +66,7 @@
 #include <string.h>
 #include "defs.h"
 
-#ifdef __STDC__
 #include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
 #ifdef SUNOS5
 #include <sys/systeminfo.h>
 #endif
@@ -138,42 +134,41 @@
 vifi_t  numvifs;               /* to keep loader happy */
                                /* (see kern.c) */
 
-u_long                 byteswap __P((u_long));
-char *                 inet_name __P((u_int32_t addr));
-u_int32_t                      host_addr __P((char *name));
+u_long                 byteswap(u_long);
+char *                 inet_name(u_int32_t addr);
+u_int32_t                      host_addr(char *name);
 /* u_int is promoted u_char */
-char *                 proto_type __P((u_int type));
-char *                 flag_type __P((u_int type));
+char *                 proto_type(u_int type);
+char *                 flag_type(u_int type);
 
-u_int32_t              get_netmask __P((int s, u_int32_t dst));
-int                    get_ttl __P((struct resp_buf *buf));
-int                    t_diff __P((u_long a, u_long b));
-u_long                 fixtime __P((u_long time));
-int                    send_recv __P((u_int32_t dst, int type, int code,
-                                       int tries, struct resp_buf *save));
-char *                 print_host __P((u_int32_t addr));
-char *                 print_host2 __P((u_int32_t addr1, u_int32_t addr2));
-void                   print_trace __P((int index, struct resp_buf *buf));
-int                    what_kind __P((struct resp_buf *buf, char *why));
-char *                 scale __P((int *hop));
-void                   stat_line __P((struct tr_resp *r, struct tr_resp *s,
-                                       int have_next, int *res));
-void                   fixup_stats __P((struct resp_buf *base,
-                                       struct resp_buf *prev,
-                                       struct resp_buf *new));
-int                    print_stats __P((struct resp_buf *base,
-                                       struct resp_buf *prev,
-                                       struct resp_buf *new));
-void                   check_vif_state __P((void));
-void                   passive_mode __P((void));
+u_int32_t              get_netmask(int s, u_int32_t dst);
+int                    get_ttl(struct resp_buf *buf);
+int                    t_diff(u_long a, u_long b);
+u_long                 fixtime(u_long time);
+int                    send_recv(u_int32_t dst, int type, int code,
+                                 int tries, struct resp_buf *save);
+char *                 print_host(u_int32_t addr);
+char *                 print_host2(u_int32_t addr1, u_int32_t addr2);
+void                   print_trace(int index, struct resp_buf *buf);
+int                    what_kind(struct resp_buf *buf, char *why);
+char *                 scale(int *hop);
+void                   stat_line(struct tr_resp *r, struct tr_resp *s,
+                                 int have_next, int *res);
+void                   fixup_stats(struct resp_buf *base,
+                                   struct resp_buf *prev,
+                                   struct resp_buf *new);
+int                    print_stats(struct resp_buf *base,
+                                   struct resp_buf *prev,
+                                   struct resp_buf *new);
+void                   check_vif_state(void);
+void                   passive_mode(void);
 
-int                    main __P((int argc, char *argv[]));
+int                    main(int argc, char *argv[]);
 /* log() prototyped in defs.h */
 
 
 char   *
-inet_name(addr)
-    u_int32_t  addr;
+inet_name(u_int32_t addr)
 {
     struct hostent *e;
 
@@ -184,8 +179,7 @@
 
 
 u_int32_t 
-host_addr(name)
-    char   *name;
+host_addr(char *name)
 {
     struct hostent *e = (struct hostent *)0;
     u_int32_t  addr;
@@ -224,8 +218,7 @@
 
 
 char *
-proto_type(type)
-    u_int type;
+proto_type(u_int type)
 {
     static char buf[80];
 
@@ -254,8 +247,7 @@
 
 
 char *
-flag_type(type)
-    u_int type;
+flag_type(u_int type)
 {
     static char buf[80];
 
@@ -301,9 +293,7 @@
  */
 
 u_int32_t
-get_netmask(s, dst)
-    int s;
-    u_int32_t dst;
+get_netmask(int s, u_int32_t dst)
 {
     unsigned int i;
     char ifbuf[5000];
@@ -341,8 +331,7 @@
 
 
 int
-get_ttl(buf)
-    struct resp_buf *buf;
+get_ttl(struct resp_buf *buf)
 {
     int rno;
     struct tr_resp *b;
@@ -369,8 +358,7 @@
  * the result in milliseconds.
  */
 int
-t_diff(a, b)
-    u_long a, b;
+t_diff(u_long a, u_long b)
 {
     int d = a - b;
 
@@ -383,8 +371,7 @@
  * so correct and incorrect times will be far apart.
  */
 u_long
-fixtime(time)
-    u_long time;
+fixtime(u_long time)
 {
     if (abs((int)(time-base.qtime)) > 0x3FFFFFFF)
         time = ((time & 0xFFFF0000) + (JAN_1970 << 16)) +
@@ -396,18 +383,14 @@
  * Swap bytes for poor little-endian machines that don't byte-swap
  */
 u_long
-byteswap(v)
-    u_long v;
+byteswap(u_long v)
 {
     return ((v << 24) | ((v & 0xff00) << 8) |
            ((v >> 8) & 0xff00) | (v >> 24));
 }
 
 int
-send_recv(dst, type, code, tries, save)
-    u_int32_t dst;
-    int type, code, tries;
-    struct resp_buf *save;
+send_recv(u_int32_t dst, int type, int code, int tries, struct resp_buf *save)
 {
     fd_set  fds;
     struct timeval tq, tr, tv;
@@ -638,7 +621,7 @@
  * it just snoops on what traces it can.
  */
 void
-passive_mode()
+passive_mode(void)
 {
     struct timeval tr;
     struct ip *ip;
@@ -751,8 +734,7 @@
 }
 
 char *
-print_host(addr)
-    u_int32_t addr;
+print_host(u_int32_t addr)
 {
     return print_host2(addr, 0);
 }
@@ -764,8 +746,7 @@
  * confusing but should be slightly more helpful than just a "?".
  */
 char *
-print_host2(addr1, addr2)
-    u_int32_t addr1, addr2;
+print_host2(u_int32_t addr1, u_int32_t addr2)
 {
     char *name;
 
@@ -784,9 +765,7 @@
  * Print responses as received (reverse path from dst to src)
  */
 void
-print_trace(index, buf)
-    int index;
-    struct resp_buf *buf;
+print_trace(int index, struct resp_buf *buf)
 {
     struct tr_resp *r;
     char *name;
@@ -819,9 +798,7 @@
  * See what kind of router is the next hop
  */
 int
-what_kind(buf, why)
-    struct resp_buf *buf;
-    char *why;
+what_kind(struct resp_buf *buf, char *why)
 {
     u_int32_t smask;
     int retval;
@@ -879,8 +856,7 @@
 
 
 char *
-scale(hop)
-    int *hop;
+scale(int *hop)
 {
     if (*hop > -1000 && *hop < 10000) return (" ms");
     *hop /= 1000;
@@ -897,10 +873,7 @@
 #define OUTS    2
 #define BOTH    3
 void
-stat_line(r, s, have_next, rst)
-    struct tr_resp *r, *s;
-    int have_next;
-    int *rst;
+stat_line(struct tr_resp *r, struct tr_resp *s, int have_next, int *rst)
 {
     int timediff = (fixtime(ntohl(s->tr_qarr)) -
                         fixtime(ntohl(r->tr_qarr))) >> 16;
@@ -997,8 +970,7 @@
  * byteorder bugs in mrouted 3.6 on little-endian machines.
  */
 void
-fixup_stats(base, prev, new)
-    struct resp_buf *base, *prev, *new;
+fixup_stats(struct resp_buf *base, struct resp_buf *prev, struct resp_buf *new)
 {
     int rno = base->len;
     struct tr_resp *b = base->resps + rno;
@@ -1077,8 +1049,7 @@
  * Print responses with statistics for forward path (from src to dst)
  */
 int
-print_stats(base, prev, new)
-    struct resp_buf *base, *prev, *new;
+print_stats(struct resp_buf *base, struct resp_buf *prev, struct resp_buf *new)
 {
     int rtt, hop;
     char *ms;
@@ -1171,9 +1142,7 @@
  ***************************************************************************/
 
 int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char **argv)
 {
     int udp;
     struct sockaddr_in addr;
@@ -1699,7 +1668,7 @@
 }
 



Home | Main Index | Thread Index | Old Index