fix various warnings to compile the test code with -Wextra
This commit is contained in:
parent
fa57c83c70
commit
10d72ffc7d
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user