aboutsummaryrefslogtreecommitdiffstats
path: root/nest/rt-table.c
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/rt-table.c
parent17fe57d8dcc89aea520788914b252cf49cf060ff (diff)
downloadbird-3e236955c9369475872b9b86a58502fa777b50b9.tar.gz
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/rt-table.c')
-rw-r--r--nest/rt-table.c18
1 files changed, 9 insertions, 9 deletions
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++)