From 1f23d3c2544f4329b31804392abc4eff434ba308 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Sat, 7 Jun 2008 15:04:34 +0200 Subject: libiptc: move variable definitions to head of function Signed-off-by: Patrick McHardy --- libiptc/libiptc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index 9463bdbc..d0f51b4a 100644 --- a/libiptc/libiptc.c +++ b/libiptc/libiptc.c @@ -2170,6 +2170,8 @@ int TC_CREATE_CHAIN(const IPT_CHAINLABEL chain, TC_HANDLE_T *handle) { static struct chain_head *c; + int capacity; + int exceeded; iptc_fn = TC_CREATE_CHAIN; @@ -2209,8 +2211,8 @@ TC_CREATE_CHAIN(const IPT_CHAINLABEL chain, TC_HANDLE_T *handle) * in the buckets. Thus, only rebuild chain index when the * capacity is exceed with CHAIN_INDEX_INSERT_MAX chains. */ - int capacity = (*handle)->chain_index_sz * CHAIN_INDEX_BUCKET_LEN; - int exceeded = ((((*handle)->num_chains)-capacity)); + capacity = (*handle)->chain_index_sz * CHAIN_INDEX_BUCKET_LEN; + exceeded = ((((*handle)->num_chains)-capacity)); if (exceeded > CHAIN_INDEX_INSERT_MAX) { debug("Capacity(%d) exceeded(%d) rebuild (chains:%d)\n", capacity, exceeded, (*handle)->num_chains); -- cgit v1.2.3