svn commit: r190712 - head/sbin/routed

Poul-Henning Kamp phk at FreeBSD.org
Sun Apr 5 07:15:07 PDT 2009


Author: phk
Date: Sun Apr  5 14:15:05 2009
New Revision: 190712
URL: http://svn.freebsd.org/changeset/base/190712

Log:
  Kick WARNS level up to 6 by fixing various trivial warnings.

Modified:
  head/sbin/routed/Makefile
  head/sbin/routed/if.c
  head/sbin/routed/output.c
  head/sbin/routed/radix.c
  head/sbin/routed/radix.h
  head/sbin/routed/table.c

Modified: head/sbin/routed/Makefile
==============================================================================
--- head/sbin/routed/Makefile	Sun Apr  5 14:01:39 2009	(r190711)
+++ head/sbin/routed/Makefile	Sun Apr  5 14:15:05 2009	(r190712)
@@ -7,6 +7,6 @@ MAN=   routed.8
 SUBDIR= rtquery
 LDADD=	-lmd
 DPADD=	${LIBMD}
-WARNS?=	0
+WARNS?=	6
 
 .include <bsd.prog.mk>

Modified: head/sbin/routed/if.c
==============================================================================
--- head/sbin/routed/if.c	Sun Apr  5 14:01:39 2009	(r190711)
+++ head/sbin/routed/if.c	Sun Apr  5 14:15:05 2009	(r190712)
@@ -955,7 +955,8 @@ ifinit(void)
 					trace_act("interface %s has been off"
 						  " %ld seconds; forget it",
 						  ifp->int_name,
-						  now.tv_sec-ifp->int_data.ts);
+						  (long)now.tv_sec-
+						      ifp->int_data.ts);
 					ifdel(ifp);
 				}
 				continue;

Modified: head/sbin/routed/output.c
==============================================================================
--- head/sbin/routed/output.c	Sun Apr  5 14:01:39 2009	(r190711)
+++ head/sbin/routed/output.c	Sun Apr  5 14:15:05 2009	(r190712)
@@ -139,7 +139,7 @@ output(enum output_type type,
 		flags = MSG_DONTROUTE;
 		break;
 	case OUT_MULTICAST:
-		if (ifp->int_if_flags & (IFF_POINTOPOINT|IFF_MULTICAST) ==
+		if ((ifp->int_if_flags & (IFF_POINTOPOINT|IFF_MULTICAST)) ==
 		    IFF_POINTOPOINT) {
 			msg = "Send pt-to-pt";
 		} else if (ifp->int_state & IS_DUP) {

Modified: head/sbin/routed/radix.c
==============================================================================
--- head/sbin/routed/radix.c	Sun Apr  5 14:01:39 2009	(r190711)
+++ head/sbin/routed/radix.c	Sun Apr  5 14:15:05 2009	(r190712)
@@ -846,7 +846,7 @@ rn_walktree(struct radix_node_head *h,
 }
 
 int
-rn_inithead(void **head, int off)
+rn_inithead(struct radix_node_head **head, int off)
 {
 	struct radix_node_head *rnh;
 	struct radix_node *t, *tt, *ttt;
@@ -887,7 +887,7 @@ rn_init(void)
 	addmask_key = cplim = rn_ones + max_keylen;
 	while (cp < cplim)
 		*cp++ = -1;
-	if (rn_inithead((void **)&mask_rnhead, 0) == 0)
+	if (rn_inithead(&mask_rnhead, 0) == 0)
 		panic("rn_init 2");
 }
 

Modified: head/sbin/routed/radix.h
==============================================================================
--- head/sbin/routed/radix.h	Sun Apr  5 14:01:39 2009	(r190711)
+++ head/sbin/routed/radix.h	Sun Apr  5 14:15:05 2009	(r190712)
@@ -138,7 +138,7 @@ struct radix_node_head {
 #define Free(p) free((void *)p);
 
 void	 rn_init(void);
-int	 rn_inithead(void **, int);
+int	 rn_inithead(struct radix_node_head **head, int off);
 int	 rn_refines(void *, void *);
 int	 rn_walktree(struct radix_node_head *,
 		     int (*)(struct radix_node *, struct walkarg *),

Modified: head/sbin/routed/table.c
==============================================================================
--- head/sbin/routed/table.c	Sun Apr  5 14:01:39 2009	(r190711)
+++ head/sbin/routed/table.c	Sun Apr  5 14:15:05 2009	(r190712)
@@ -1631,7 +1631,7 @@ rtinit(void)
 	/* Initialize the radix trees */
 	max_keylen = sizeof(struct sockaddr_in);
 	rn_init();
-	rn_inithead((void**)&rhead, 32);
+	rn_inithead(&rhead, 32);
 
 	/* mark all of the slots in the table free */
 	ag_avail = ag_slots;
@@ -2124,8 +2124,8 @@ age(naddr bad_gate)
 			       " %ld:%ld",
 			       ifp->int_name,
 			       naddr_ntoa(ifp->int_dstaddr),
-			       (now.tv_sec - ifp->int_act_time)/60,
-			       (now.tv_sec - ifp->int_act_time)%60);
+			       (long)(now.tv_sec - ifp->int_act_time)/60,
+			       (long)(now.tv_sec - ifp->int_act_time)%60);
 			if_sick(ifp);
 		}
 


More information about the svn-src-head mailing list