From 10d72ffc7df6bb4607816d86f3ffe13906d0bcfa Mon Sep 17 00:00:00 2001
From: Luigi Rizzo <luigi@FreeBSD.org>
Date: Tue, 26 Jan 2016 23:37:07 +0000
Subject: [PATCH] fix various warnings to compile the test code with -Wextra

---
 sys/netpfil/ipfw/test/Makefile        | 2 +-
 sys/netpfil/ipfw/test/main.c          | 4 ++--
 sys/netpfil/ipfw/test/test_dn_sched.c | 6 ++++++
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/sys/netpfil/ipfw/test/Makefile b/sys/netpfil/ipfw/test/Makefile
index c556a4bf3d51..529306e495ab 100644
--- a/sys/netpfil/ipfw/test/Makefile
+++ b/sys/netpfil/ipfw/test/Makefile
@@ -20,7 +20,7 @@ HEAP_OBJS=$(HEAP_SRCS:.c=.o)
 
 VPATH=	.:..
 
-CFLAGS = -I.. -I. -Wall -Werror -O3 -DIPFW
+CFLAGS = -I.. -I. -Wall -Werror -O3 -DIPFW -Wextra
 TARGETS= test_sched # no test_heap by default
 
 all:	$(TARGETS)
diff --git a/sys/netpfil/ipfw/test/main.c b/sys/netpfil/ipfw/test/main.c
index ce86f49615e7..0dd575c94d3c 100644
--- a/sys/netpfil/ipfw/test/main.c
+++ b/sys/netpfil/ipfw/test/main.c
@@ -594,9 +594,9 @@ controller(struct cfg_s *c)
 	int flow_id;
 
 	/* histeresis between max and min */
-	if (c->state == 0 && c->pending >= c->th_max)
+	if (c->state == 0 && c->pending >= (uint32_t)c->th_max)
 		c->state = 1;
-	else if (c->state == 1 && c->pending <= c->th_min)
+	else if (c->state == 1 && c->pending <= (uint32_t)c->th_min)
 		c->state = 0;
 	ND(1, "state %d pending %2d", c->state, c->pending);
 	c->can_dequeue = c->state;
diff --git a/sys/netpfil/ipfw/test/test_dn_sched.c b/sys/netpfil/ipfw/test/test_dn_sched.c
index ee46c95ed868..2fcc310b2f63 100644
--- a/sys/netpfil/ipfw/test/test_dn_sched.c
+++ b/sys/netpfil/ipfw/test/test_dn_sched.c
@@ -15,6 +15,9 @@ m_freem(struct mbuf *m)
 int
 dn_sched_modevent(module_t mod, int cmd, void *arg)
 {
+	(void)mod;
+	(void)cmd;
+	(void)arg;
 	return 0;
 }
 
@@ -32,6 +35,8 @@ int
 dn_delete_queue(void *_q, void *do_free)
 {
 	struct dn_queue *q = _q;
+
+	(void)do_free;
         if (q->mq.head)
                 dn_free_pkts(q->mq.head);
         free(q);
@@ -66,6 +71,7 @@ drop:
 int
 ipdn_bound_var(int *v, int dflt, int lo, int hi, const char *msg)
 {
+	(void)msg;
         if (*v < lo) {
                 *v = dflt;
         } else if (*v > hi) {