summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2016-10-14 15:37:04 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2016-11-01 14:52:54 +0100
commit3e236955c9369475872b9b86a58502fa777b50b9 (patch)
treed43b519c2289a353e56c32b42c402f9fa12d0e13 /nest
parent17fe57d8dcc89aea520788914b252cf49cf060ff (diff)
Build: switch on -Wextra, get rid of most of the warnings
There are several unresolved -Wmissing-field-initializers on older versions of GCC than 5.1, all of them false positive.
Diffstat (limited to 'nest')
-rw-r--r--nest/a-path.c2
-rw-r--r--nest/bfd.h2
-rw-r--r--nest/iface.c2
-rw-r--r--nest/locks.c3
-rw-r--r--nest/route.h1
-rw-r--r--nest/rt-attr.c4
-rw-r--r--nest/rt-table.c18
7 files changed, 16 insertions, 16 deletions
diff --git a/nest/a-path.c b/nest/a-path.c
index e1031b7b..b453f702 100644
--- a/nest/a-path.c
+++ b/nest/a-path.c
@@ -370,7 +370,7 @@ as_path_filter(struct linpool *pool, struct adata *path, struct f_tree *set, u32
}
}
- int nl = d - buf;
+ uint nl = d - buf;
if (nl == path->length)
return path;
diff --git a/nest/bfd.h b/nest/bfd.h
index f1e95cb2..b0ebe31d 100644
--- a/nest/bfd.h
+++ b/nest/bfd.h
@@ -42,7 +42,7 @@ struct bfd_request {
struct bfd_request * bfd_request_session(pool *p, ip_addr addr, ip_addr local, struct iface *iface, void (*hook)(struct bfd_request *), void *data);
-static inline void cf_check_bfd(int use) { }
+static inline void cf_check_bfd(int use UNUSED) { }
#else
diff --git a/nest/iface.c b/nest/iface.c
index 4d73c2a4..a23cdf4f 100644
--- a/nest/iface.c
+++ b/nest/iface.c
@@ -584,7 +584,7 @@ ifa_delete(struct ifa *a)
}
u32
-if_choose_router_id(struct iface_patt *mask, u32 old_id)
+if_choose_router_id(struct iface_patt *mask UNUSED6, u32 old_id UNUSED6)
{
#ifndef IPV6
struct iface *i;
diff --git a/nest/locks.c b/nest/locks.c
index ad2af493..84b8b0ae 100644
--- a/nest/locks.c
+++ b/nest/locks.c
@@ -100,7 +100,8 @@ static struct resclass olock_class = {
sizeof(struct object_lock),
olock_free,
olock_dump,
- NULL
+ NULL,
+ NULL,
};
/**
diff --git a/nest/route.h b/nest/route.h
index 07320566..383f4def 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -274,7 +274,6 @@ rte *rte_find(net *net, struct rte_src *src);
rte *rte_get_temp(struct rta *);
void rte_update2(struct announce_hook *ah, net *net, rte *new, struct rte_src *src);
static inline void rte_update(struct proto *p, net *net, rte *new) { rte_update2(p->main_ahook, net, new, p->main_source); }
-void rte_discard(rtable *tab, rte *old);
int rt_examine(rtable *t, ip_addr prefix, int pxlen, struct proto *p, struct filter *filter);
rte *rt_export_merged(struct announce_hook *ah, net *net, rte **rt_free, struct ea_list **tmpa, linpool *pool, int silent);
void rt_refresh_begin(rtable *t, struct announce_hook *ah);
diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index 9aeca846..edf27d44 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -103,7 +103,7 @@ static inline int u32_cto(uint x) { return ffs(~x) - 1; }
static inline u32
rte_src_alloc_id(void)
{
- int i, j;
+ uint i, j;
for (i = src_id_pos; i < src_id_size; i++)
if (src_ids[i] != 0xffffffff)
goto found;
@@ -785,7 +785,7 @@ static inline void
opaque_format(struct adata *ad, byte *buf, uint size)
{
byte *bound = buf + size - 10;
- int i;
+ uint i;
for(i = 0; i < ad->length; i++)
{
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 00476069..c6e48c38 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -1282,8 +1282,8 @@ rte_announce_i(rtable *tab, unsigned type, net *net, rte *new, rte *old,
rte_update_unlock();
}
-void
-rte_discard(rtable *t, rte *old) /* Non-filtered route deletion, used during garbage collection */
+static inline void
+rte_discard(rte *old) /* Non-filtered route deletion, used during garbage collection */
{
rte_update_lock();
rte_recalculate(old->sender, old->net, NULL, old->attrs->src);
@@ -1606,7 +1606,7 @@ again:
return 0;
}
- rte_discard(tab, e);
+ rte_discard(e);
(*limit)--;
goto rescan;
@@ -1712,7 +1712,7 @@ rta_apply_hostentry(rta *a, struct hostentry *he)
}
static inline rte *
-rt_next_hop_update_rte(rtable *tab, rte *old)
+rt_next_hop_update_rte(rtable *tab UNUSED, rte *old)
{
rta a;
memcpy(&a, old->attrs, sizeof(rta));
@@ -2104,11 +2104,11 @@ hc_remove(struct hostcache *hc, struct hostentry *he)
static void
hc_alloc_table(struct hostcache *hc, unsigned order)
{
- unsigned hsize = 1 << order;
+ uint hsize = 1 << order;
hc->hash_order = order;
hc->hash_shift = 16 - order;
- hc->hash_max = (order >= HC_HI_ORDER) ? ~0 : (hsize HC_HI_MARK);
- hc->hash_min = (order <= HC_LO_ORDER) ? 0 : (hsize HC_LO_MARK);
+ hc->hash_max = (order >= HC_HI_ORDER) ? ~0U : (hsize HC_HI_MARK);
+ hc->hash_min = (order <= HC_LO_ORDER) ? 0U : (hsize HC_LO_MARK);
hc->hash_table = mb_allocz(rt_table_pool, hsize * sizeof(struct hostentry *));
}
@@ -2116,10 +2116,10 @@ hc_alloc_table(struct hostcache *hc, unsigned order)
static void
hc_resize(struct hostcache *hc, unsigned new_order)
{
- unsigned old_size = 1 << hc->hash_order;
struct hostentry **old_table = hc->hash_table;
struct hostentry *he, *hen;
- int i;
+ uint old_size = 1 << hc->hash_order;
+ uint i;
hc_alloc_table(hc, new_order);
for (i = 0; i < old_size; i++)