Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jan 2016 23:37:07 +0000 (UTC)
From:      Luigi Rizzo <luigi@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r294859 - head/sys/netpfil/ipfw/test
Message-ID:  <201601262337.u0QNb7eJ011928@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: luigi
Date: Tue Jan 26 23:37:07 2016
New Revision: 294859
URL: https://svnweb.freebsd.org/changeset/base/294859

Log:
  fix various warnings to compile the test code with -Wextra

Modified:
  head/sys/netpfil/ipfw/test/Makefile
  head/sys/netpfil/ipfw/test/main.c
  head/sys/netpfil/ipfw/test/test_dn_sched.c

Modified: head/sys/netpfil/ipfw/test/Makefile
==============================================================================
--- head/sys/netpfil/ipfw/test/Makefile	Tue Jan 26 23:36:18 2016	(r294858)
+++ head/sys/netpfil/ipfw/test/Makefile	Tue Jan 26 23:37:07 2016	(r294859)
@@ -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)

Modified: head/sys/netpfil/ipfw/test/main.c
==============================================================================
--- head/sys/netpfil/ipfw/test/main.c	Tue Jan 26 23:36:18 2016	(r294858)
+++ head/sys/netpfil/ipfw/test/main.c	Tue Jan 26 23:37:07 2016	(r294859)
@@ -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;

Modified: head/sys/netpfil/ipfw/test/test_dn_sched.c
==============================================================================
--- head/sys/netpfil/ipfw/test/test_dn_sched.c	Tue Jan 26 23:36:18 2016	(r294858)
+++ head/sys/netpfil/ipfw/test/test_dn_sched.c	Tue Jan 26 23:37:07 2016	(r294859)
@@ -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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601262337.u0QNb7eJ011928>