From 4eec8b3824d49c1c0503ebbf7844a4e312bc29e1 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu" Date: Thu, 13 Nov 2008 09:36:37 +0000 Subject: 2.4.4 - Premature checking prevents to add valid elements to hash types, fixed (bug reported by JC Janos). - Local variable shadows another variable, fixed (reported by Jan Engelhardt). - More compiler warning options added and warnings fixed. --- ipset_iptreemap.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'ipset_iptreemap.c') diff --git a/ipset_iptreemap.c b/ipset_iptreemap.c index d1d31bb..bcdf133 100644 --- a/ipset_iptreemap.c +++ b/ipset_iptreemap.c @@ -34,7 +34,7 @@ create_init(void *data) } static int -create_parse(int c, char *argv[], void *data, unsigned int *flags) +create_parse(int c, char *argv[] UNUSED, void *data, unsigned int *flags) { struct ip_set_req_iptreemap_create *mydata = data; @@ -53,22 +53,22 @@ create_parse(int c, char *argv[], void *data, unsigned int *flags) } static void -create_final(void *data, unsigned int flags) +create_final(void *data UNUSED, unsigned int flags UNUSED) { } static const struct option create_opts[] = { {.name = "gc", .has_arg = required_argument, .val = 'g'}, - {NULL}, + {0, 0, 0, 0}, }; static ip_set_ip_t -adt_parser(unsigned int cmd, const char *optarg, void *data) +adt_parser(int cmd UNUSED, const char *arg, void *data) { struct ip_set_req_iptreemap *mydata = data; ip_set_ip_t mask; - char *saved = ipset_strdup(optarg); + char *saved = ipset_strdup(arg); char *ptr, *tmp = saved; if (strchr(tmp, '/')) { @@ -103,7 +103,7 @@ initheader(struct set *set, const void *data) } static void -printheader(struct set *set, unsigned int options) +printheader(struct set *set, unsigned int options UNUSED) { struct ip_set_iptreemap *mysetdata = set->settype->header; @@ -114,7 +114,8 @@ printheader(struct set *set, unsigned int options) } static void -printips_sorted(struct set *set, void *data, size_t len, unsigned int options) +printips_sorted(struct set *set UNUSED, void *data, + size_t len, unsigned int options) { struct ip_set_req_iptreemap *req; size_t offset = 0; @@ -132,7 +133,7 @@ printips_sorted(struct set *set, void *data, size_t len, unsigned int options) } static void -saveheader(struct set *set, unsigned int options) +saveheader(struct set *set, unsigned int options UNUSED) { struct ip_set_iptreemap *mysetdata = set->settype->header; @@ -145,7 +146,8 @@ saveheader(struct set *set, unsigned int options) } static void -saveips(struct set *set, void *data, size_t len, unsigned int options) +saveips(struct set *set UNUSED, void *data, + size_t len, unsigned int options) { struct ip_set_req_iptreemap *req; size_t offset = 0; @@ -202,8 +204,7 @@ static struct settype settype_iptreemap = { .usage = &usage, }; -void -_init(void) +CONSTRUCTOR(iptreemap) { settype_register(&settype_iptreemap); } -- cgit v1.2.3