]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
build: remove dead code parts
authorJan Engelhardt <jengelh@medozas.de>
Sun, 29 May 2011 23:39:54 +0000 (01:39 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Sun, 29 May 2011 23:39:54 +0000 (01:39 +0200)
gcc-4.6 has a new warning, -Wunused-but-set-variable, which flags
no-op code.

  CC     libiptc/libip4tc.lo
In file included from libiptc/libip4tc.c:118:0:
libiptc/libiptc.c: In function "iptcc_chain_index_delete_chain":
libiptc/libiptc.c:611:32: warning: variable "index_ptr2" set but not used
libiptc/libiptc.c: In function "alloc_handle":
libiptc/libiptc.c:1282:9: warning: variable "len" set but not used
  CC     libiptc/libip6tc.lo
In file included from libiptc/libip6tc.c:113:0:
libiptc/libiptc.c: In function "iptcc_chain_index_delete_chain":
libiptc/libiptc.c:611:32: warning: variable "index_ptr2" set but not used
libiptc/libiptc.c: In function "alloc_handle":
libiptc/libiptc.c:1282:9: warning: variable "len" set but not used
  CC     xtables_multi-iptables-xml.o
iptables-xml.c: In function "do_rule_part":
iptables-xml.c:376:8: warning: variable "thisChain" set but not used
  CC     xtables_multi-ip6tables.o
ip6tables.c: In function "print_firewall":
ip6tables.c:552:10: warning: variable "flags" set but not used

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
ip6tables.c
iptables-xml.c
libiptc/libiptc.c

index a74238cce69d7637dcecec6a31f56d15b875ccd1..4df73b8d4c9001e1e2fe277a87639adf8eea3cf3 100644 (file)
@@ -549,7 +549,6 @@ print_firewall(const struct ip6t_entry *fw,
 {
        const struct xtables_target *target = NULL;
        const struct ip6t_entry_target *t;
-       uint8_t flags;
        char buf[BUFSIZ];
 
        if (!ip6tc_is_chain(targname, handle))
@@ -559,7 +558,6 @@ print_firewall(const struct ip6t_entry *fw,
                         XTF_LOAD_MUST_SUCCEED);
 
        t = ip6t_get_target((struct ip6t_entry *)fw);
-       flags = fw->ipv6.flags;
 
        if (format & FMT_LINENUMBERS)
                printf(FMT("%-4u ", "%u "), num);
index dc3cd4f21056e4cbb225b7e03dc402985ce71186..aa98f75e21acaa4e4629f7d7d86eacaa02f6a1f7 100644 (file)
@@ -373,7 +373,6 @@ do_rule_part(char *leveltag1, char *leveltag2, int part, int argc,
 {
        int arg = 1;            // ignore leading -A
        char invert_next = 0;
-       char *thisChain = NULL;
        char *spacer = "";      // space when needed to assemble arguments
        char *level1 = NULL;
        char *level2 = NULL;
@@ -397,8 +396,6 @@ do_rule_part(char *leveltag1, char *leveltag2, int part, int argc,
                } else printf("%s<%s ", (leveli ## LEVEL), (level ## LEVEL)); \
        } while(0)
 
-       thisChain = argv[arg++];
-
        if (part == 1) {        /* skip */
                /* use argvattr to tell which arguments were quoted 
                   to avoid comparing quoted arguments, like comments, to -j, */
index d3b1c5173f6f3faceb47f45173e5b6e9b1f5ab16..0b6d5e3adf02c8e249701f09e94a527f5ef981b6 100644 (file)
@@ -608,7 +608,7 @@ static int iptcc_chain_index_rebuild(struct xtc_handle *h)
  */
 static int iptcc_chain_index_delete_chain(struct chain_head *c, struct xtc_handle *h)
 {
-       struct list_head *index_ptr, *index_ptr2, *next;
+       struct list_head *index_ptr, *next;
        struct chain_head *c2;
        unsigned int idx, idx2;
 
@@ -628,7 +628,7 @@ static int iptcc_chain_index_delete_chain(struct chain_head *c, struct xtc_handl
                 * is located in the same index bucket.
                 */
                c2         = list_entry(next, struct chain_head, list);
-               index_ptr2 = iptcc_bsearch_chain_index(c2->name, &idx2, h);
+               iptcc_bsearch_chain_index(c2->name, &idx2, h);
                if (idx != idx2) {
                        /* Rebuild needed */
                        return iptcc_chain_index_rebuild(h);
@@ -1279,11 +1279,8 @@ static int iptcc_compile_table(struct xtc_handle *h, STRUCT_REPLACE *repl)
 static struct xtc_handle *
 alloc_handle(const char *tablename, unsigned int size, unsigned int num_rules)
 {
-       size_t len;
        struct xtc_handle *h;
 
-       len = sizeof(STRUCT_TC_HANDLE) + size;
-
        h = malloc(sizeof(STRUCT_TC_HANDLE));
        if (!h) {
                errno = ENOMEM;