]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
fix gcc warnings
authorMax Kellermann <max@duempel.org>
Tue, 29 Jan 2008 13:48:05 +0000 (13:48 +0000)
committerPatrick McHardy <kaber@trash.net>
Tue, 29 Jan 2008 13:48:05 +0000 (13:48 +0000)
Max Kellermann <max@duempel.org>

84 files changed:
configure.ac
extensions/dscp_helper.c
extensions/libip6t_HL.c
extensions/libip6t_LOG.c
extensions/libip6t_REJECT.c
extensions/libip6t_ah.c
extensions/libip6t_dst.c
extensions/libip6t_frag.c
extensions/libip6t_hbh.c
extensions/libip6t_hl.c
extensions/libip6t_icmp6.c
extensions/libip6t_ipv6header.c
extensions/libip6t_mh.c
extensions/libip6t_policy.c
extensions/libip6t_rt.c
extensions/libipt_CLUSTERIP.c
extensions/libipt_DNAT.c
extensions/libipt_ECN.c
extensions/libipt_LOG.c
extensions/libipt_MASQUERADE.c
extensions/libipt_NETMAP.c
extensions/libipt_REDIRECT.c
extensions/libipt_REJECT.c
extensions/libipt_SAME.c
extensions/libipt_SNAT.c
extensions/libipt_TTL.c
extensions/libipt_ULOG.c
extensions/libipt_addrtype.c
extensions/libipt_ah.c
extensions/libipt_ecn.c
extensions/libipt_icmp.c
extensions/libipt_policy.c
extensions/libipt_realm.c
extensions/libipt_recent.c
extensions/libipt_ttl.c
extensions/libxt_CLASSIFY.c
extensions/libxt_CONNMARK.c
extensions/libxt_CONNSECMARK.c
extensions/libxt_DSCP.c
extensions/libxt_MARK.c
extensions/libxt_NFLOG.c
extensions/libxt_NFQUEUE.c
extensions/libxt_RATEEST.c
extensions/libxt_SECMARK.c
extensions/libxt_TCPMSS.c
extensions/libxt_TCPOPTSTRIP.c
extensions/libxt_TOS.c
extensions/libxt_comment.c
extensions/libxt_connbytes.c
extensions/libxt_connlimit.c
extensions/libxt_connmark.c
extensions/libxt_conntrack.c
extensions/libxt_dccp.c
extensions/libxt_dscp.c
extensions/libxt_esp.c
extensions/libxt_hashlimit.c
extensions/libxt_helper.c
extensions/libxt_iprange.c
extensions/libxt_length.c
extensions/libxt_limit.c
extensions/libxt_mac.c
extensions/libxt_mark.c
extensions/libxt_multiport.c
extensions/libxt_owner.c
extensions/libxt_physdev.c
extensions/libxt_pkttype.c
extensions/libxt_quota.c
extensions/libxt_rateest.c
extensions/libxt_sctp.c
extensions/libxt_state.c
extensions/libxt_statistic.c
extensions/libxt_string.c
extensions/libxt_tcp.c
extensions/libxt_tcpmss.c
extensions/libxt_time.c
extensions/libxt_tos.c
extensions/libxt_u32.c
extensions/libxt_udp.c
extensions/tos_values.c
include/libiptc/libip6tc.h
include/libiptc/libiptc.h
ip6tables.c
iptables-xml.c
xtables.c

index b90c4a7079b2a65704fb8977e25e3da290e3df76..9d51ef74d7515a56ef5c8c331af47576df8d6a08 100644 (file)
@@ -37,7 +37,7 @@ AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" == "yes"])
 AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" == "yes"])
 
 regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
-       -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
+       -D_REENTRANT -W -Wall -Waggregate-return -Wmissing-declarations \
        -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
        -Winline -pipe -DIPTABLES_VERSION=\\\"$PACKAGE_VERSION\\\" \
        -DIPT_LIB_DIR=\\\"\${iptdir}\\\" -DIP6T_LIB_DIR=\\\"\${iptdir}\\\"";
@@ -46,7 +46,8 @@ kinclude_CFLAGS="-I\"$kbuilddir/include\" -I\"$ksourcedir/include\"";
 # Remove workarounds soon
 regular_CFLAGS="$regular_CFLAGS -Wno-aggregate-return \
        -Wno-missing-declarations -Wno-missing-prototypes \
-       -Wno-redundant-decls -Wno-shadow -Wno-strict-prototypes -Wno-inline"
+        -Wno-unused-parameter \
+       -Wno-shadow -Wno-inline"
 
 AC_SUBST([regular_CFLAGS kinclude_CFLAGS])
 AC_SUBST([kbuilddir])
index 8b60d417623db8eaf390cd64b924ed572ed6578b..9e9a163f6d857db10c0025dc6e480fa98605cbcc 100644 (file)
@@ -49,7 +49,7 @@ static const struct ds_class
 static unsigned int
 class_to_dscp(const char *name)
 {
-       int i;
+       unsigned i;
 
        for (i = 0; i < sizeof(ds_classes) / sizeof(struct ds_class); i++) {
                if (!strncasecmp(name, ds_classes[i].name,
index 73cb3badc457aa5052d9500e92cf723ad6959e38..c20147bdde16009690444f595a78278b79e8dd51 100644 (file)
@@ -136,7 +136,7 @@ static const struct option HL_opts[] = {
        { "hl-set", 1, NULL, '1' },
        { "hl-dec", 1, NULL, '2' },
        { "hl-inc", 1, NULL, '3' },
-       { }
+       { .name = NULL }
 };
 
 static struct ip6tables_target hl_target6 = {
index 10d5b73b7cd83934bc14d4a0fd14db45b23914ec..6fd4c0b2c2b67f8a22793b833acfad50db9b1b3b 100644 (file)
@@ -38,7 +38,7 @@ static const struct option LOG_opts[] = {
        { .name = "log-tcp-options",  .has_arg = 0, .val = '2' },
        { .name = "log-ip-options",   .has_arg = 0, .val = '3' },
        { .name = "log-uid",          .has_arg = 0, .val = '4' },
-       { }
+       { .name = NULL }
 };
 
 /* Initialize the target. */
index b765435fba4b3fa1c16744416cf7e07bfdfca889..000096ec4a0b5a6654c18ab91af72c304aef4e21 100644 (file)
@@ -66,7 +66,7 @@ static void REJECT_help(void)
 
 static const struct option REJECT_opts[] = {
        { "reject-with", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 /* Allocate and initialize the target. */
index c372af5db791c49a7fad6ccdae65f3bcde67a6f7..46469eafd83676db2b2e7922fb0d2141d846c88e 100644 (file)
@@ -23,7 +23,7 @@ static const struct option ah_opts[] = {
        { .name = "ahspi", .has_arg = 1, .val = '1' },
        { .name = "ahlen", .has_arg = 1, .val = '2' },
        { .name = "ahres", .has_arg = 0, .val = '3' },
-       { }
+       { .name = NULL }
 };
 
 static u_int32_t
index 4b4dcf919fa18c94c6369a1c874cfb857c77b182..9e4d87059a28344bbc08bd22a50982c95fb905a8 100644 (file)
@@ -26,7 +26,7 @@ static const struct option dst_opts[] = {
        { .name = "dst-len",        .has_arg = 1, .val = '1' },
        { .name = "dst-opts",       .has_arg = 1, .val = '2' },
        { .name = "dst-not-strict", .has_arg = 1, .val = '3' },
-       { }
+       { .name = NULL }
 };
 
 static u_int32_t
@@ -168,7 +168,7 @@ static int dst_parse(int c, char **argv, int invert, unsigned int *flags,
 }
 
 static void
-print_options(int optsnr, u_int16_t *optsp)
+print_options(unsigned optsnr, u_int16_t *optsp)
 {
        unsigned int i;
 
index b8e15d3d0cfbaf93c9c348c94e6968d55e72a066..86f40f4208b352f09ab728e01edf946b26335367 100644 (file)
@@ -29,7 +29,7 @@ static const struct option frag_opts[] = {
        { .name = "fragfirst", .has_arg = 0, .val = '4' },
        { .name = "fragmore",  .has_arg = 0, .val = '5' },
        { .name = "fraglast",  .has_arg = 0, .val = '6' },
-       { }
+       { .name = NULL }
 };
 
 static u_int32_t
index f8753bb9f2037f345f7b77f8e24b10d36fa4572b..1052575887672d2c527a4f20673863b6606eabae 100644 (file)
@@ -29,7 +29,7 @@ static const struct option hbh_opts[] = {
        { "hbh-len", 1, NULL, '1' },
        { "hbh-opts", 1, NULL, '2' },
        { "hbh-not-strict", 1, NULL, '3' },
-       { }
+       { .name = NULL }
 };
 
 static u_int32_t
@@ -162,7 +162,7 @@ static int hbh_parse(int c, char **argv, int invert, unsigned int *flags,
 }
 
 static void
-print_options(int optsnr, u_int16_t *optsp)
+print_options(unsigned optsnr, u_int16_t *optsp)
 {
        unsigned int i;
 
index 87a1eeb7c61f1bee6ad267bdb3ddffde6133a4e5..7f995988cdb64ee1459178b092c39999d6d098af 100644 (file)
@@ -122,7 +122,7 @@ static const struct option hl_opts[] = {
        { .name = "hl-eq", .has_arg = 1, .val = '2' },
        { .name = "hl-lt", .has_arg = 1, .val = '3' },
        { .name = "hl-gt", .has_arg = 1, .val = '4' },
-       { }
+       { .name = NULL }
 };
 
 static struct ip6tables_match hl_match6 = {
index febf52375dd754d7a3a767de492f99328a3d9d14..8c9653f7d6a73fb112a2d3c307deb655c0c5d4de 100644 (file)
@@ -86,7 +86,7 @@ static void icmp6_help(void)
 
 static const struct option icmp6_opts[] = {
        { "icmpv6-type", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 static void
index 0d7ffd8db3a9d53f4267f198a323fbe675ea11ee..c20fb94b299624148806010e4ddea6f8e50bf47a 100644 (file)
@@ -150,7 +150,7 @@ static void ipv6header_help(void)
 static const struct option ipv6header_opts[] = {
        { "header", 1, NULL, '1' },
        { "soft", 0, NULL, '2' },
-       { }
+       { .name = NULL }
 };
 
 static void ipv6header_init(struct xt_entry_match *m)
index 717a8beef03a0f11698416796a2cc338a3512071..dd0da2b8f4beaaaa843d6a1fbf54d6068a989140 100644 (file)
@@ -220,7 +220,7 @@ static void mh_save(const void *ip, const struct xt_entry_match *match)
 
 static const struct option mh_opts[] = {
        { "mh-type", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 static struct ip6tables_match mh_match6 = {
index 1ecd66e450b3ff8a8fceaf69ebd05f271eedeaba..f706f98692c6b80f9a5b9deae47d88b7a445ed9e 100644 (file)
@@ -91,7 +91,7 @@ static const struct option policy_opts[] =
                .name           = "next",
                .val            = 'a'
        },
-       { }
+       { .name = NULL }
 };
 
 /* FIXME - Duplicated code from ip6tables.c */
index 89469008a37db498c564d0389410b226c448917f..a9ced6a9e8dedade7ddbcc25a95e5bac684f2ec8 100644 (file)
@@ -35,7 +35,7 @@ static const struct option rt_opts[] = {
        { "rt-0-res", 0, NULL, '4' },
        { "rt-0-addrs", 1, NULL, '5' },
        { "rt-0-not-strict", 0, NULL, '6' },
-       { }
+       { .name = NULL }
 };
 
 static u_int32_t
@@ -255,7 +255,7 @@ print_nums(const char *name, u_int32_t min, u_int32_t max,
 }
 
 static void
-print_addresses(int addrnr, struct in6_addr *addrp)
+print_addresses(unsigned addrnr, struct in6_addr *addrp)
 {
        unsigned int i;
 
index 74b434f949ac82c77f722e76746005503846011d..fdeae863344d5ac9d273139a0e43ba5ffec7d15b 100644 (file)
@@ -50,7 +50,7 @@ static const struct option CLUSTERIP_opts[] = {
        { "total-nodes", 1, NULL, '4' },
        { "local-node", 1, NULL, '5' },
        { "hash-init", 1, NULL, '6' },
-       { }
+       { .name = NULL }
 };
 
 static void
index 6999ee9501f5bbbdcd50642aec225b2dfb7f60a5..3ad412b68e49f667c744c6bb3f3c78846c8653cf 100644 (file)
@@ -34,7 +34,7 @@ IPTABLES_VERSION);
 static const struct option DNAT_opts[] = {
        { "to-destination", 1, NULL, '1' },
        { "random", 0, NULL, '2' },
-       { }
+       { .name = NULL }
 };
 
 static struct ipt_natinfo *
index 817559a5e2a94b3b77a37bb6c1314397f65565c2..1523b2df68f89e84ab9336b6b18fc161f23f8f55 100644 (file)
@@ -38,7 +38,7 @@ static const struct option ECN_opts[] = {
        { "ecn-tcp-cwr", 1, NULL, 'G' },
        { "ecn-tcp-ece", 1, NULL, 'H' },
        { "ecn-ip-ect", 1, NULL, '9' },
-       { }
+       { .name = NULL }
 };
 
 static int ECN_parse(int c, char **argv, int invert, unsigned int *flags,
index a3635e5c5050044e5a414bafa70709621d911a73..6b08f586e5c8c616a8d8845a70d1f136bb0d98fa 100644 (file)
@@ -38,7 +38,7 @@ static const struct option LOG_opts[] = {
        { .name = "log-tcp-options",  .has_arg = 0, .val = '2' },
        { .name = "log-ip-options",   .has_arg = 0, .val = '3' },
        { .name = "log-uid",          .has_arg = 0, .val = '4' },
-       { }
+       { .name = NULL }
 };
 
 /* Initialize the target. */
index 5b4787d3c5c22921f1d78edd78be8ccf4d8dce2d..fc914c590e74aea51462a35812a2a8255027389b 100644 (file)
@@ -25,7 +25,7 @@ IPTABLES_VERSION);
 static const struct option MASQUERADE_opts[] = {
        { "to-ports", 1, NULL, '1' },
        { "random", 0, NULL, '2' },
-       { }
+       { .name = NULL }
 };
 
 /* Initialize the target. */
index 407369347d05f02e6b045d898e786dd71439937d..da0e5f4d42dcb7a37437b2836c8e37904904cc45 100644 (file)
@@ -15,7 +15,7 @@
 
 static const struct option NETMAP_opts[] = {
        { "to", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 /* Function which prints out usage message. */
index f749dd1e362a270719e3d43c5871d905a667d4e2..1918df82ccdefd91e137e761fe958db4f5ae723a 100644 (file)
@@ -24,7 +24,7 @@ IPTABLES_VERSION);
 static const struct option REDIRECT_opts[] = {
        { "to-ports", 1, NULL, '1' },
        { "random", 0, NULL, '2' },
-       { }
+       { .name = NULL }
 };
 
 /* Initialize the target. */
index 7e23ada7b0667578d7c459f360eec6cad9b41b07..5901a5ef894bfb6134c8ad151ed5ab3de73b3f72 100644 (file)
@@ -81,7 +81,7 @@ static void REJECT_help(void)
 
 static const struct option REJECT_opts[] = {
        { "reject-with", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 /* Allocate and initialize the target. */
index 6aaac99a4100717842069f9c8a0b67fce50fe06e..e03ae80dceab78bd37547c7b622a44f2ccfc4181 100644 (file)
@@ -32,7 +32,7 @@ static const struct option SAME_opts[] = {
        { "to", 1, NULL, '1' },
        { "nodst", 0, NULL, '2'},
        { "random", 0, NULL, '3' },
-       { }
+       { .name = NULL }
 };
 
 /* Initialize the target. */
@@ -90,7 +90,7 @@ static int SAME_parse(int c, char **argv, int invert, unsigned int *flags,
 {
        struct ipt_same_info *mr
                = (struct ipt_same_info *)(*target)->data;
-       int count;
+       unsigned count;
 
        switch (c) {
        case '1':
@@ -146,7 +146,7 @@ static void SAME_check(unsigned int flags)
 static void SAME_print(const void *ip, const struct xt_entry_target *target,
                        int numeric)
 {
-       int count;
+       unsigned count;
        struct ipt_same_info *mr
                = (struct ipt_same_info *)target->data;
        int random = 0;
@@ -180,7 +180,7 @@ static void SAME_print(const void *ip, const struct xt_entry_target *target,
 /* Saves the union ipt_targinfo in parsable form to stdout. */
 static void SAME_save(const void *ip, const struct xt_entry_target *target)
 {
-       int count;
+       unsigned count;
        struct ipt_same_info *mr
                = (struct ipt_same_info *)target->data;
        int random = 0;
index 7eae53c94b0fbb937a912ecdd9f16eb745a59ab0..7b9e1763f0e02c0601662c5eac16890314ec10ec 100644 (file)
@@ -34,7 +34,7 @@ IPTABLES_VERSION);
 static const struct option SNAT_opts[] = {
        { "to-source", 1, NULL, '1' },
        { "random", 0, NULL, '2' },
-       { }
+       { .name = NULL }
 };
 
 static struct ipt_natinfo *
index 4dfac063519636e66106e10982d9411958fe7ec6..b5a32c4088910d0f4ff62b78bbbee54f96bd60d1 100644 (file)
@@ -136,7 +136,7 @@ static const struct option TTL_opts[] = {
        { "ttl-set", 1, NULL, '1' },
        { "ttl-dec", 1, NULL, '2' },
        { "ttl-inc", 1, NULL, '3' },
-       { }
+       { .name = NULL }
 };
 
 static struct iptables_target ttl_target = {
index eddd79f0264dddb9d50352d91f9c702bcd460e9a..6fb2c6680e79e972978d82922bf044bbb3ad6e35 100644 (file)
@@ -49,7 +49,7 @@ static const struct option ULOG_opts[] = {
        {"ulog-prefix", 1, NULL, '#'},
        {"ulog-cprange", 1, NULL, 'A'},
        {"ulog-qthreshold", 1, NULL, 'B'},
-       { }
+       { .name = NULL }
 };
 
 /* Initialize the target. */
index b8605c734b8ddf35dc68483b67dc1c61d61ebbc4..5557af23b3faf6bb5f45dd5a2f4ee2ba9f7691a4 100644 (file)
@@ -180,7 +180,7 @@ static void addrtype_save(const void *ip, const struct xt_entry_match *match)
 static const struct option addrtype_opts[] = {
        { "src-type", 1, NULL, '1' },
        { "dst-type", 1, NULL, '2' },
-       { }
+       { .name = NULL }
 };
 
 static struct iptables_match addrtype_match = {
index 70ba03ebc6ceb749b2b69310eb212d79ab0db6ef..2555b5d81713aaceccd723bc521a43301db0440a 100644 (file)
@@ -20,7 +20,7 @@ IPTABLES_VERSION);
 
 static const struct option ah_opts[] = {
        { "ahspi", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 static u_int32_t
index d32d3142989d9f95a88d7a518bbb1f850e01ee51..9c07eab3d0b5b9d2218eadecf9a0f7b104f586ad 100644 (file)
@@ -30,7 +30,7 @@ static const struct option ecn_opts[] = {
        { .name = "ecn-tcp-cwr", .has_arg = 0, .val = 'F' },
        { .name = "ecn-tcp-ece", .has_arg = 0, .val = 'G' },
        { .name = "ecn-ip-ect",  .has_arg = 1, .val = 'H' },
-       { }
+       { .name = NULL }
 };
 
 static int ecn_parse(int c, char **argv, int invert, unsigned int *flags,
index fa76601414532ed59cd97065816299a7b663d2f5..b1fccbf545193453c6a42913e359b3ccf5b0b2a8 100644 (file)
@@ -110,7 +110,7 @@ static void icmp_help(void)
 
 static const struct option icmp_opts[] = {
        { "icmp-type", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 static void 
index a805e135d990f5c5fc037d0bf7b2e12775a2500c..48b96bedba35bc5a1f2657fd400714c4846be64f 100644 (file)
@@ -90,7 +90,7 @@ static const struct option policy_opts[] =
                .name           = "next",
                .val            = 'a'
        },
-       { }
+       { .name = NULL }
 };
 
 static int parse_direction(char *s)
index 4f3416f0ba87d7a34fb29e1994b0db2c775e118f..7026fc23aa7c24878904f8d3795b789d4d1e3f1c 100644 (file)
@@ -26,7 +26,7 @@ static void realm_help(void)
 
 static const struct option realm_opts[] = {
        { "realm", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 struct realmname { 
index 76f9771e6ea85217c60cf8d8e53744da9d01e6f9..ace778e0cf9c2b414dbe6f5629917b811afc7bef 100644 (file)
@@ -33,7 +33,7 @@ static const struct option recent_opts[] = {
        { .name = "name",     .has_arg = 1, .val = 208 },
        { .name = "rsource",  .has_arg = 0, .val = 209 },
        { .name = "rdest",    .has_arg = 0, .val = 210 },
-       { }
+       { .name = NULL }
 };
 
 /* Function which prints out usage message. */
index 622e60afe45511804d7605fb36cef066bfd8414e..d7820f1f4ef979527a75076fc377dc63f1b3672f 100644 (file)
@@ -145,7 +145,7 @@ static const struct option ttl_opts[] = {
        { "ttl-eq", 1, NULL, '2'},
        { "ttl-lt", 1, NULL, '3'},
        { "ttl-gt", 1, NULL, '4'},
-       { }
+       { .name = NULL }
 };
 
 static struct iptables_match ttl_match = {
index 65a19e52fcc686fc6e6aef7588566f44b525a8ce..e39367a885a6efbff60f98fa96ff72b06e3b5261 100644 (file)
@@ -23,7 +23,7 @@ IPTABLES_VERSION);
 
 static const struct option CLASSIFY_opts[] = {
        { "set-class", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 static int CLASSIFY_string_to_priority(const char *s, unsigned int *p)
index 95d6b1cd7369bd0a26079654895455615c2e8753..9e8013ad1a76bd9d5fdcb1f633e5c0ede81a51b0 100644 (file)
@@ -50,7 +50,7 @@ static const struct option CONNMARK_opts[] = {
        { "save-mark", 0, NULL, '2' },
        { "restore-mark", 0, NULL, '3' },
        { "mask", 1, NULL, '4' },
-       { }
+       { .name = NULL }
 };
 
 static const struct option connmark_tg_opts[] = {
@@ -64,7 +64,7 @@ static const struct option connmark_tg_opts[] = {
        {.name = "ctmask",        .has_arg = true,  .val = 'c'},
        {.name = "nfmask",        .has_arg = true,  .val = 'n'},
        {.name = "mask",          .has_arg = true,  .val = 'm'},
-       {},
+       {.name = NULL},
 };
 
 static void connmark_tg_help(void)
index a7d7cf7d59512fcc9fc2b4b7dcca9e674eec5511..e8d0a5eaa4eda2cdef52551359ad8647f27c86a8 100644 (file)
@@ -27,7 +27,7 @@ IPTABLES_VERSION);
 static const struct option CONNSECMARK_opts[] = {
        { "save", 0, 0, '1' },
        { "restore", 0, 0, '2' },
-       { 0 }
+       { .name = NULL }
 };
 
 static int
index 73b10426ddc3996a331f29c6b3cb185442ceb560..c15f0e162e467991a6dfbd6c54c3718e6bc1b708 100644 (file)
@@ -40,7 +40,7 @@ static void DSCP_help(void)
 static const struct option DSCP_opts[] = {
        { "set-dscp", 1, NULL, 'F' },
        { "set-dscp-class", 1, NULL, 'G' },
-       { }
+       { .name = NULL }
 };
 
 static void
index 82beb4b06d3f2b17e57bc1cd4125a110216b8b2f..569d2e8c547f33d2a758a571588f4a67ba30e89c 100644 (file)
@@ -29,7 +29,7 @@ static const struct option MARK_opts[] = {
        { "set-mark", 1, NULL, '1' },
        { "and-mark", 1, NULL, '2' },
        { "or-mark", 1, NULL, '3' },
-       { }
+       { .name = NULL }
 };
 
 static const struct option mark_tg_opts[] = {
@@ -38,7 +38,7 @@ static const struct option mark_tg_opts[] = {
        {.name = "and-mark",  .has_arg = true, .val = '&'},
        {.name = "or-mark",   .has_arg = true, .val = '|'},
        {.name = "xor-mark",  .has_arg = true, .val = '^'},
-       {},
+       { .name = NULL }
 };
 
 static void mark_tg_help(void)
index 1125c372a1f1948a8b583ab4264c6e97334aab60..d4dc971c45d0595e62e00f4969987be46d3cd137 100644 (file)
@@ -19,7 +19,7 @@ static const struct option NFLOG_opts[] = {
        { "nflog-prefix",    1, NULL, NFLOG_PREFIX },
        { "nflog-range",     1, NULL, NFLOG_RANGE },
        { "nflog-threshold", 1, NULL, NFLOG_THRESHOLD },
-       {NULL},
+       { .name = NULL }
 };
 
 static void NFLOG_help(void)
index 3687e5add88112ac645c504e22735b5dd7193dfe..b1c5ef3a4523821b22d9604048a717234f5edad4 100644 (file)
@@ -25,7 +25,7 @@ static void NFQUEUE_help(void)
 
 static const struct option NFQUEUE_opts[] = {
        { "queue-num", 1, NULL, 'F' },
-       { }
+       { .name = NULL }
 };
 
 static void
index 8445cdf2848895cf515b036687b7fdfbdd0bc156..187165747f5d79a4988a2c58fd67c3fb6acb5d9f 100644 (file)
@@ -36,7 +36,7 @@ static const struct option RATEEST_opts[] = {
        { "rateest-name",       1, NULL, RATEEST_OPT_NAME },
        { "rateest-interval",   1, NULL, RATEEST_OPT_INTERVAL },
        { "rateest-ewmalog",    1, NULL, RATEEST_OPT_EWMALOG },
-       { },
+       { .name = NULL },
 };
 
 /* Copied from iproute */
index 0aeaee93548253e103012e39c62fd4efa662cce2..b794e7deb42b68949cdd4c2dd25b491e86be6910 100644 (file)
@@ -25,7 +25,7 @@ IPTABLES_VERSION);
 
 static const struct option SECMARK_opts[] = {
        { "selctx", 1, 0, '1' },
-       { 0 }
+       { .name = NULL }
 };
 
 /*
index 8d6974d0cb3e1f221a7315cce8a748915ed1363b..9ab69bfed4f0dc9d5ceff0518dd29eb34745f699 100644 (file)
@@ -39,7 +39,7 @@ static void TCPMSS_help6(void)
 static const struct option TCPMSS_opts[] = {
        { "set-mss", 1, NULL, '1' },
        { "clamp-mss-to-pmtu", 0, NULL, '2' },
-       { }
+       { .name = NULL }
 };
 
 /* Function which parses command options; returns true if it
index c3d558dc72df5acc11fcd5df107f491ca3adf144..df107f42d1a7d93dc3ce7751746304ca0956a767 100644 (file)
@@ -22,12 +22,12 @@ enum {
 
 struct tcp_optionmap {
        const char *name, *desc;
-       const int option;
+       const unsigned option;
 };
 
 static const struct option tcpoptstrip_tg_opts[] = {
        {.name = "strip-options", .has_arg = true, .val = 's'},
-       {},
+       { .name = NULL }
 };
 
 static const struct tcp_optionmap tcp_optionmap[] = {
@@ -37,7 +37,7 @@ static const struct tcp_optionmap tcp_optionmap[] = {
        {"sack",           "Selective ACK",        TCPOPT_SACK},
        {"timestamp",      "Timestamp",            TCPOPT_TIMESTAMP},
        {"md5",            "MD5 signature",        TCPOPT_MD5SIG},
-       {NULL},
+       { .name = NULL }
 };
 
 static void tcpoptstrip_tg_help(void)
index 74ec2b52c42b1f84c9c31100c93114de5047ee78..777d7cfbc269d6b4bf25bae945c1f0523a910659 100644 (file)
@@ -20,7 +20,7 @@ enum {
 
 static const struct option tos_tg_opts_v0[] = {
        {.name = "set-tos", .has_arg = true, .val = '='},
-       {},
+       { .name = NULL }
 };
 
 static const struct option tos_tg_opts[] = {
@@ -28,7 +28,7 @@ static const struct option tos_tg_opts[] = {
        {.name = "and-tos", .has_arg = true, .val = '&'},
        {.name = "or-tos",  .has_arg = true, .val = '|'},
        {.name = "xor-tos", .has_arg = true, .val = '^'},
-       {},
+       { .name = NULL }
 };
 
 static void tos_tg_help_v0(void)
index e29ce166964370a16182d4c30e4be2baedf9672a..20277d4c53669854fbdd6f47a4d9a4981c237d03 100644 (file)
@@ -25,7 +25,7 @@ static void comment_help(void)
 
 static const struct option comment_opts[] = {
        { "comment", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 static void
index 3ec08d0507bbdb51f220f3872df1624a66e5d724..e6cb1f400376c520b32eca69c4adc7e86030b011 100644 (file)
@@ -23,7 +23,7 @@ static const struct option connbytes_opts[] = {
        { "connbytes", 1, NULL, '1' },
        { "connbytes-dir", 1, NULL, '2' },
        { "connbytes-mode", 1, NULL, '3' },
-       { }
+       { .name = NULL }
 };
 
 static void
index 31f931105cf09ef006c88de12e999e1af9cd0ae1..9e2137acbe88dad3672d44839c5fe6a2efc726bc 100644 (file)
@@ -21,7 +21,7 @@ static void connlimit_help(void)
 static const struct option connlimit_opts[] = {
        {"connlimit-above", 1, NULL, 'A'},
        {"connlimit-mask",  1, NULL, 'M'},
-       {NULL},
+       { .name = NULL }
 };
 
 static void connlimit_init(struct xt_entry_match *match)
index 65faa8e5ee42254b3a518b0ff852c649b1edaff4..1e38f7cda38f1c63a0f31ced39426de5f39384d5 100644 (file)
@@ -42,7 +42,7 @@ static void connmark_mt_help(void)
 
 static const struct option connmark_mt_opts[] = {
        {.name = "mark", .has_arg = true, .val = '1'},
-       {},
+       { .name = NULL }
 };
 
 static int
index d076d494d53645224e679e4f8893257930f54a7a..d1c0aa0c73ecf78d736d3e83fc8be13aaa92fc12 100644 (file)
@@ -57,7 +57,7 @@ static const struct option conntrack_mt_opts_v0[] = {
        {.name = "ctrepldst", .has_arg = true, .val = '6'},
        {.name = "ctstatus",  .has_arg = true, .val = '7'},
        {.name = "ctexpire",  .has_arg = true, .val = '8'},
-       {},
+       { .name = NULL }
 };
 
 static const struct option conntrack_mt_opts[] = {
@@ -74,7 +74,7 @@ static const struct option conntrack_mt_opts[] = {
        {.name = "ctreplsrcport", .has_arg = true, .val = 'c'},
        {.name = "ctrepldstport", .has_arg = true, .val = 'd'},
        {.name = "ctdir",         .has_arg = true, .val = 'e'},
-       {},
+       {.name = NULL},
 };
 
 static int
@@ -250,7 +250,9 @@ parse_expires(const char *s, struct xt_conntrack_info *sinfo)
                cp++;
 
                sinfo->expires_min = buffer[0] ? parse_expire(buffer) : 0;
-               sinfo->expires_max = cp[0] ? parse_expire(cp) : -1;
+               sinfo->expires_max = cp[0]
+                       ? parse_expire(cp)
+                       : (unsigned long)-1;
        }
        free(buffer);
 
index 450f24983c72fdac506d0e72f3afa0b5d8b4a2e8..467a695ca97fcb34e1f2351b7c25e9ec4a2655f4 100644 (file)
@@ -51,7 +51,7 @@ static const struct option dccp_opts[] = {
        { .name = "dport", .has_arg = 1, .val = '2' },
        { .name = "dccp-types", .has_arg = 1, .val = '3' },
        { .name = "dccp-option", .has_arg = 1, .val = '4' },
-       { }
+       { .name = NULL }
 };
 
 static void
index 69be08b60b543ab5173d3b7ea20f4893350ec287..a28af0966f2aae9e421230aa78021fd63a5e9db9 100644 (file)
@@ -42,7 +42,7 @@ static void dscp_help(void)
 static const struct option dscp_opts[] = {
        { "dscp", 1, NULL, 'F' },
        { "dscp-class", 1, NULL, 'G' },
-       { }
+       { .name = NULL }
 };
 
 static void
index e5b5eaa9b18bf57f033399e07b32e4b415978a0b..f37c088a2d407beced223a2fed298dac5511dd2c 100644 (file)
@@ -20,7 +20,7 @@ IPTABLES_VERSION);
 
 static const struct option esp_opts[] = {
        { "espspi", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 static u_int32_t
index 09455d92495f5202f8a52434732d6398d0f40596..d8a0035a22687f5c1d4ec350cccad50feb004768 100644 (file)
@@ -54,7 +54,7 @@ static const struct option hashlimit_opts[] = {
        { "hashlimit-htable-expire", 1, NULL, ')' },
        { "hashlimit-mode", 1, NULL, '_' },
        { "hashlimit-name", 1, NULL, '"' },
-       { }
+       { .name = NULL }
 };
 
 static
index f2f3a3d3066578bfd7ec597883f0ff84ab57c9a6..31ae4fc5788c6954468ee97bd521d24ef7c1943a 100644 (file)
@@ -20,7 +20,7 @@ IPTABLES_VERSION);
 
 static const struct option helper_opts[] = {
        { "helper", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 /* Function which parses command options; returns true if it
index 47d7464f7fd1e3c7cd6e535372de7e85cc30c24e..51b35f8a2718c5fa60e2e5decb3e74c5390b0f7c 100644 (file)
@@ -27,7 +27,7 @@ static void iprange_mt_help(void)
 static const struct option iprange_mt_opts[] = {
        {.name = "src-range", .has_arg = true, .val = '1'},
        {.name = "dst-range", .has_arg = true, .val = '2'},
-       {},
+       { .name = NULL }
 };
 
 static void
index c55b12bed9245dc58b9ebaa78cfa4a81e5ce0657..b812b672c4d1dedfeab43d2211fbca1090f8bdd8 100644 (file)
@@ -21,7 +21,7 @@ IPTABLES_VERSION);
   
 static const struct option length_opts[] = {
        { "length", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 static u_int16_t
index 92cecf410034368404dc4972e56c3d62e3dc66a6..65a8df3ffc4990f2ec72c619d09391eeb21fa1f2 100644 (file)
@@ -32,7 +32,7 @@ static void limit_help(void)
 static const struct option limit_opts[] = {
        { "limit", 1, NULL, '%' },
        { "limit-burst", 1, NULL, '$' },
-       { }
+       { .name = NULL }
 };
 
 static
index 5d84aee82696350abbad943194bb523bf628defb..2284d2ac151f6ef647a9a05aaab9ff663241c50e 100644 (file)
@@ -24,7 +24,7 @@ static void mac_help(void)
 
 static const struct option mac_opts[] = {
        { "mac-source", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 static void
index e75708461caf77036219df1b698b499a0e09e0d5..1dfcc58e32afcdc36d667958b3fb4d4c6306cfd7 100644 (file)
@@ -23,7 +23,7 @@ static void mark_mt_help(void)
 
 static const struct option mark_mt_opts[] = {
        {.name = "mark", .has_arg = true, .val = '1'},
-       {},
+       { .name = NULL }
 };
 
 static int mark_mt_parse(int c, char **argv, int invert, unsigned int *flags,
index 809a34975757a09f9f89b61cf488c6aac0b9e9a9..6de7bc1dff90c459694a1f10703e612b2c8aa29e 100644 (file)
@@ -49,7 +49,7 @@ static const struct option multiport_opts[] = {
        { "destination-ports", 1, NULL, '2' },
        { "dports", 1, NULL, '2' }, /* synonym */
        { "ports", 1, NULL, '3' },
-       { }
+       { .name = NULL }
 };
 
 static char *
index 62b8b8852e8681daf2db266b7b7f5bd99b317a10..ea86f998783dd01fbfb0d80fd5cbe758b930b4fd 100644 (file)
@@ -81,7 +81,7 @@ static const struct option owner_mt_opts_v0[] = {
 #ifdef IPT_OWNER_COMM
        {.name = "cmd-owner", .has_arg = true, .val = 'c'},
 #endif
-       {},
+       { .name = NULL }
 };
 
 static const struct option owner_mt6_opts_v0[] = {
@@ -89,14 +89,14 @@ static const struct option owner_mt6_opts_v0[] = {
        {.name = "gid-owner", .has_arg = true, .val = 'g'},
        {.name = "pid-owner", .has_arg = true, .val = 'p'},
        {.name = "sid-owner", .has_arg = true, .val = 's'},
-       {},
+       { .name = NULL }
 };
 
 static const struct option owner_mt_opts[] = {
        {.name = "uid-owner",     .has_arg = true,  .val = 'u'},
        {.name = "gid-owner",     .has_arg = true,  .val = 'g'},
        {.name = "socket-exists", .has_arg = false, .val = 'k'},
-       {},
+       { .name = NULL }
 };
 
 static int
index 144fbb4f46c5cb0bfa32e02e9154d8e007c46def..e971d1e14de87fdc7a1ef49c7c00f9b265add45c 100644 (file)
@@ -30,7 +30,7 @@ static const struct option physdev_opts[] = {
        { "physdev-is-in", 0, NULL, '3' },
        { "physdev-is-out", 0, NULL, '4' },
        { "physdev-is-bridged", 0, NULL, '5' },
-       { }
+       { .name = NULL }
 };
 
 static int
index 2d73560a6be280070038ba1a5e6b509df1ab5f9c..75194fcb4fca90cc5f0dd3f34a36aded3189d218 100644 (file)
@@ -66,7 +66,7 @@ static void pkttype_help(void)
 
 static const struct option pkttype_opts[] = {
        {"pkt-type", 1, NULL, '1'},
-       { }
+       { .name = NULL }
 };
 
 static void parse_pkttype(const char *pkttype, struct xt_pkttype_info *info)
index 7d73033aa030277acade11f4786c4ae801ac5bf8..57050f2ff63de5517ba21ba8fb4ad7710212d69a 100644 (file)
@@ -13,7 +13,7 @@
 
 static const struct option quota_opts[] = {
        {"quota", 1, NULL, '1'},
-       { }
+       { .name = NULL }
 };
 
 /* print usage */
@@ -49,7 +49,7 @@ parse_quota(const char *s, u_int64_t * quota)
        printf("Quota: %llu\n", *quota);
 #endif
 
-       if (*quota == -1)
+       if (*quota == (u_int64_t)-1)
                exit_error(PARAMETER_PROBLEM, "quota invalid: '%s'\n", s);
        else
                return 1;
index cf787033c4bd9bc6783be2d7f8eade1bd4f1d6ea..5f13340f719c9438c6813f6d8419cf528a416b34 100644 (file)
@@ -55,7 +55,7 @@ static const struct option rateest_opts[] = {
        { "rateest-lt",         0, NULL, OPT_RATEEST_LT },
        { "rateest-gt",         0, NULL, OPT_RATEEST_GT },
        { "rateest-eq",         0, NULL, OPT_RATEEST_EQ },
-       { },
+       { .name = NULL }
 };
 
 /* Copied from iproute. See http://physics.nist.gov/cuu/Units/binary.html */
@@ -81,7 +81,7 @@ static const struct rate_suffix {
        { "GBps",       8000000000. },
        { "TiBps",      8.*1024.*1024.*1024.*1024. },
        { "TBps",       8000000000000. },
-       { }
+       { .name = NULL }
 };
 
 static int
index de8948c52bed886c681f8c4f091f92ec0affd781..4b9166a9a9675504db72172e80cd294607ca9997 100644 (file)
@@ -73,7 +73,7 @@ static const struct option sctp_opts[] = {
        { .name = "destination-port", .has_arg = 1, .val = '2' },
        { .name = "dport", .has_arg = 1, .val = '2' },
        { .name = "chunk-types", .has_arg = 1, .val = '3' },
-       { }
+       { .name = NULL }
 };
 
 static void
index 82f21cd25e1add4b4b03bb000a126876de511345..68f52808a50b5236317c8f016a4191c5a943e87f 100644 (file)
@@ -25,7 +25,7 @@ state_help(void)
 
 static const struct option state_opts[] = {
        { "state", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 static int
index 1b34527b15927f572599410d6bdf6cdc89d8cc43..19bb121d7b6abdd97e86cce8d44b606eae9ac57e 100644 (file)
@@ -27,7 +27,7 @@ static const struct option statistic_opts[] = {
        { "probability", 1, NULL, '2' },
        { "every", 1, NULL, '3' },
        { "packet", 1, NULL, '4' },
-       { }
+       { .name = NULL }
 };
 
 static struct xt_statistic_info *info;
@@ -113,7 +113,7 @@ static void statistic_check(unsigned int flags)
                exit_error(PARAMETER_PROBLEM,
                           "--packet can only be used with --every");
        /* at this point, info->u.nth.every have been decreased. */
-       if (!(info->u.nth.packet >= 0 && info->u.nth.packet <= info->u.nth.every))
+       if (info->u.nth.packet > info->u.nth.every)
                exit_error(PARAMETER_PROBLEM,
                          "the --packet p must be 0 <= p <= n-1");
 
index 50b7f61e45e4236f2044587e94148d6454dade63..f1030bbcbf04d575df4115d783de7bb3598b26fa 100644 (file)
@@ -49,7 +49,7 @@ static const struct option string_opts[] = {
        { "algo", 1, NULL, '3' },
        { "string", 1, NULL, '4' },
        { "hex-string", 1, NULL, '5' },
-       { }
+       { .name = NULL }
 };
 
 static void string_init(struct xt_entry_match *m)
index b1f12a47a0c44b9c2f9ca4ef1ffb2aac9daa7741..3274f08c3c90d41ef6abaf92342242e0e0053c5d 100644 (file)
@@ -34,7 +34,7 @@ static const struct option tcp_opts[] = {
        { "syn", 0, NULL, '3' },
        { "tcp-flags", 1, NULL, '4' },
        { "tcp-option", 1, NULL, '5' },
-       { }
+       { .name = NULL }
 };
 
 static void
index e08be4890459e83bd130ca10823b41f5e50d6139..7a026bf71acb20d56cba31df6f335857667959bd 100644 (file)
@@ -20,7 +20,7 @@ IPTABLES_VERSION);
 
 static const struct option tcpmss_opts[] = {
        { "mss", 1, NULL, '1' },
-       { }
+       { .name = NULL }
 };
 
 static u_int16_t
index 29dd05df634eafaf99fe90df81a861465e07a4de..c39ab1a0683dee3db78a76b1d69acccc3d46b535 100644 (file)
@@ -44,7 +44,7 @@ static const struct option time_opts[] = {
        {"monthdays", true,  NULL, 'm'},
        {"localtz",   false, NULL, 'l'},
        {"utc",       false, NULL, 'u'},
-       {NULL},
+       { .name = NULL }
 };
 
 static void time_help(void)
index e437f4702d51fe61d33505b9c1f396a6c51306af..16a90ef53fb2050559b5fc6b520bf8e62b14bddb 100644 (file)
@@ -22,7 +22,7 @@ enum {
 
 static const struct option tos_mt_opts[] = {
        {.name = "tos", .has_arg = true, .val = 't'},
-       {},
+       { .name = NULL }
 };
 
 static void tos_mt_help(void)
index d01864f1a4a67776df698602470703d42944eb14..251b2d4596929a1cd9efe28dfa6b3b928e991a87 100644 (file)
@@ -24,7 +24,7 @@
 
 static const struct option u32_opts[] = {
        {"u32", 1, NULL, 'u'},
-       {NULL},
+       { .name = NULL }
 };
 
 static void u32_help(void)
index dd64a406007c06d595b68a18a49015d8d689c767..4e83ae8f910c03a47620f79e745417d17555dfa4 100644 (file)
@@ -26,7 +26,7 @@ static const struct option udp_opts[] = {
        { "sport", 1, NULL, '1' }, /* synonym */
        { "destination-port", 1, NULL, '2' },
        { "dport", 1, NULL, '2' }, /* synonym */
-       { }
+       { .name = NULL }
 };
 
 static void
index 014b65b066567a66658d53986b3c263637ddab07..1630834e6df3824c9a4c3797795cf285ec767aa4 100644 (file)
@@ -15,7 +15,7 @@ static const struct tos_symbol_info {
        {IPTOS_RELIABILITY, "Maximize-Reliability"},
        {IPTOS_MINCOST,     "Minimize-Cost"},
        {IPTOS_NORMALSVC,   "Normal-Service"},
-       {},
+       { .name = NULL }
 };
 
 /*
index dc416a2f4129e55af66e8c4853b09ff95ebd1559..50696898b50fdb2c72f5f98f533f38575800c315 100644 (file)
@@ -144,7 +144,7 @@ int ip6tc_set_counter(const ip6t_chainlabel chain,
 int ip6tc_commit(ip6tc_handle_t *handle);
 
 /* Get raw socket. */
-int ip6tc_get_raw_socket();
+int ip6tc_get_raw_socket(void);
 
 /* Translates errno numbers into more human-readable form than strerror. */
 const char *ip6tc_strerror(int err);
index f9f92d5b09134a7a7ea93133c7c2c03c5dac6734..30f5b7d132236717e33ee9735c4b1d244a07f3f2 100644 (file)
@@ -154,7 +154,7 @@ int iptc_set_counter(const ipt_chainlabel chain,
 int iptc_commit(iptc_handle_t *handle);
 
 /* Get raw socket. */
-int iptc_get_raw_socket();
+int iptc_get_raw_socket(void);
 
 /* Translates errno numbers into more human-readable form than strerror. */
 const char *iptc_strerror(int err);
index acdb043879784c760f9803240c351934aeba3d2f..c54237780ab5b5de447c8db49b13e0d48924fdc6 100644 (file)
@@ -1177,6 +1177,7 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle)
        struct in6_addr *saddrs = NULL, *daddrs = NULL;
 
        int c, verbose = 0;
+       unsigned i;
        const char *chain = NULL;
        const char *shostnetworkmask = NULL, *dhostnetworkmask = NULL;
        const char *policy = NULL, *newname = NULL;
@@ -1825,11 +1826,11 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle)
                e = NULL;
        }
 
-       for (c = 0; c < nsaddrs; c++)
-               free(&saddrs[c]);
+       for (i = 0; i < nsaddrs; i++)
+               free(&saddrs[i]);
 
-       for (c = 0; c < ndaddrs; c++)
-               free(&daddrs[c]);
+       for (i = 0; i < ndaddrs; i++)
+               free(&daddrs[i]);
 
        free_opts(1);
 
index 2aefb1aa6af96b3f90ccc354b53111120796f9ff..087b7c76e5fce663f1b035932170132576f1ebca 100644 (file)
@@ -54,7 +54,7 @@ static struct option options[] = {
        {"verbose", 0, 0, 'v'},
        {"combine", 0, 0, 'c'},
        {"help", 0, 0, 'h'},
-       {0}
+       { .name = NULL }
 };
 
 static void
@@ -85,10 +85,10 @@ parse_counters(char *string, struct ipt_counters *ctr)
 
 /* global new argv and argc */
 static char *newargv[255];
-static int newargc = 0;
+static unsigned newargc = 0;
 
 static char *oldargv[255];
-static int oldargc = 0;
+static unsigned oldargc = 0;
 
 /* arg meta data, were they quoted, frinstance */
 static int newargvattr[255];
@@ -129,7 +129,7 @@ add_argv(char *what, int quoted)
 static void
 free_argv(void)
 {
-       int i;
+       unsigned i;
 
        for (i = 0; i < newargc; i++) {
                free(newargv[i]);
@@ -149,7 +149,7 @@ free_argv(void)
 static void
 save_argv(void)
 {
-       int i;
+       unsigned i;
 
        for (i = 0; i < oldargc; i++)
                free(oldargv[i]);
@@ -228,7 +228,7 @@ xmlAttrI(char *name, long long int num)
 }
 
 static void
-closeChain()
+closeChain(void)
 {
        if (curChain[0] == 0)
                return;
@@ -316,7 +316,7 @@ saveChain(char *chain, char *policy, struct ipt_counters *ctr)
 }
 
 static void
-finishChains()
+finishChains(void)
 {
        int c;
 
@@ -331,7 +331,7 @@ finishChains()
 }
 
 static void
-closeTable()
+closeTable(void)
 {
        closeChain();
        finishChains();
@@ -536,7 +536,7 @@ do_rule_part(char *leveltag1, char *leveltag2, int part, int argc,
 }
 
 static int
-compareRules()
+compareRules(void)
 {
        /* compare arguments up to -j or -g for match.
           NOTE: We don't want to combine actions if there were no criteria 
@@ -545,8 +545,8 @@ compareRules()
           is the case when processing the ACTUAL output of actual iptables-save 
           rather than a file merely in a compatable format */
 
-       int old = 0;
-       int new = 0;
+       unsigned old = 0;
+       unsigned new = 0;
 
        int compare = 0;
 
@@ -748,7 +748,7 @@ main(int argc, char *argv[])
 
                        ret = 1;
                } else if (curTable[0]) {
-                       int a;
+                       unsigned a;
                        char *ptr = buffer;
                        char *pcnt = NULL;
                        char *bcnt = NULL;
index eba453bf28609a85ef3080c8fe74b12bea5a0396..af4d3dcfd28645d75e546b70241bae0ac81fae20 100644 (file)
--- a/xtables.c
+++ b/xtables.c
@@ -257,10 +257,10 @@ int service_to_port(const char *name, const char *proto)
 
 u_int16_t parse_port(const char *port, const char *proto)
 {
-       unsigned int portnum;
+       unsigned portnum;
 
        if ((string_to_number(port, 0, 65535, &portnum)) != -1 ||
-           (portnum = service_to_port(port, proto)) != -1)
+           (portnum = service_to_port(port, proto)) != (unsigned)-1)
                return (u_int16_t)portnum;
 
        exit_error(PARAMETER_PROBLEM,