From 3e236955c9369475872b9b86a58502fa777b50b9 Mon Sep 17 00:00:00 2001 From: Jan Moskyto Matejka Date: Fri, 14 Oct 2016 15:37:04 +0200 Subject: 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. --- nest/rt-table.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'nest/rt-table.c') 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++) -- cgit v1.2.3