fix various warnings to compile the test code with -Wextra

This commit is contained in:
Luigi Rizzo 2016-01-26 23:37:07 +00:00
parent fa57c83c70
commit 10d72ffc7d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=294859
3 changed files with 9 additions and 3 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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 @@ dn_enqueue(struct dn_queue *q, struct mbuf* m, int 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) {