]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Drop -W from CFLAGS and some tiny code cleanups
authorJan Engelhardt <jengelh@medozas.de>
Mon, 3 Mar 2008 11:30:41 +0000 (12:30 +0100)
committerPatrick McHardy <kaber@trash.net>
Sun, 6 Apr 2008 15:41:33 +0000 (17:41 +0200)
- change "unsigned" to explicit "unsigned int"
- remove some casts

configure.ac
extensions/dscp_helper.c
extensions/libip6t_dst.c
extensions/libip6t_hbh.c
extensions/libip6t_rt.c
extensions/libipt_SAME.c
extensions/libxt_TCPOPTSTRIP.c
extensions/libxt_quota.c
iptables-xml.c
xtables.c

index a435ae4ff2b91108bd5ed7039e654121e646a359..004a51708ecf369c7f37126619c586b1cde3b367 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 -W -Wall -Waggregate-return -Wmissing-declarations \
+       -D_REENTRANT -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}\\\"";
index 9e9a163f6d857db10c0025dc6e480fa98605cbcc..217df0997e4aff8a22466dc54ba0653eb2b28fd5 100644 (file)
@@ -49,7 +49,7 @@ static const struct ds_class
 static unsigned int
 class_to_dscp(const char *name)
 {
-       unsigned i;
+       unsigned int i;
 
        for (i = 0; i < sizeof(ds_classes) / sizeof(struct ds_class); i++) {
                if (!strncasecmp(name, ds_classes[i].name,
index 9e4d87059a28344bbc08bd22a50982c95fb905a8..5b060334409661d32cbec002697ec9f42ca7e110 100644 (file)
@@ -168,7 +168,7 @@ static int dst_parse(int c, char **argv, int invert, unsigned int *flags,
 }
 
 static void
-print_options(unsigned optsnr, u_int16_t *optsp)
+print_options(unsigned int optsnr, u_int16_t *optsp)
 {
        unsigned int i;
 
index 1052575887672d2c527a4f20673863b6606eabae..ad12547ae09062da92cad57149302c453a7399b6 100644 (file)
@@ -162,7 +162,7 @@ static int hbh_parse(int c, char **argv, int invert, unsigned int *flags,
 }
 
 static void
-print_options(unsigned optsnr, u_int16_t *optsp)
+print_options(unsigned int optsnr, u_int16_t *optsp)
 {
        unsigned int i;
 
index a9ced6a9e8dedade7ddbcc25a95e5bac684f2ec8..e2ae09f4eb22028355a328905c3d56550efc935c 100644 (file)
@@ -255,7 +255,7 @@ print_nums(const char *name, u_int32_t min, u_int32_t max,
 }
 
 static void
-print_addresses(unsigned addrnr, struct in6_addr *addrp)
+print_addresses(unsigned int addrnr, struct in6_addr *addrp)
 {
        unsigned int i;
 
index e03ae80dceab78bd37547c7b622a44f2ccfc4181..d1e6903a94dcb0f2e2753ba58d0c12d98bcd4267 100644 (file)
@@ -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;
-       unsigned count;
+       unsigned int 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)
 {
-       unsigned count;
+       unsigned int 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)
 {
-       unsigned count;
+       unsigned int count;
        struct ipt_same_info *mr
                = (struct ipt_same_info *)target->data;
        int random = 0;
index df107f42d1a7d93dc3ce7751746304ca0956a767..bd66435369ea2d15a91a9161f3ebb586feeefb8a 100644 (file)
@@ -22,7 +22,7 @@ enum {
 
 struct tcp_optionmap {
        const char *name, *desc;
-       const unsigned option;
+       const unsigned int option;
 };
 
 static const struct option tcpoptstrip_tg_opts[] = {
index 57050f2ff63de5517ba21ba8fb4ad7710212d69a..b4fb78bb35a41f9ac788fd133b9a3c803c0e85ff 100644 (file)
@@ -43,7 +43,7 @@ quota_save(const void *ip, const struct xt_entry_match *match)
 static int
 parse_quota(const char *s, u_int64_t * quota)
 {
-       *quota = strtoull(s, (char **) NULL, 10);
+       *quota = strtoull(s, NULL, 10);
 
 #ifdef DEBUG_XT_QUOTA
        printf("Quota: %llu\n", *quota);
index 087b7c76e5fce663f1b035932170132576f1ebca..404d02068edf81fb97fc1eaea6b1252700a8a13a 100644 (file)
@@ -85,10 +85,10 @@ parse_counters(char *string, struct ipt_counters *ctr)
 
 /* global new argv and argc */
 static char *newargv[255];
-static unsigned newargc = 0;
+static unsigned int newargc = 0;
 
 static char *oldargv[255];
-static unsigned oldargc = 0;
+static unsigned int 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)
 {
-       unsigned i;
+       unsigned int i;
 
        for (i = 0; i < newargc; i++) {
                free(newargv[i]);
@@ -149,7 +149,7 @@ free_argv(void)
 static void
 save_argv(void)
 {
-       unsigned i;
+       unsigned int i;
 
        for (i = 0; i < oldargc; i++)
                free(oldargv[i]);
@@ -545,8 +545,8 @@ compareRules(void)
           is the case when processing the ACTUAL output of actual iptables-save 
           rather than a file merely in a compatable format */
 
-       unsigned old = 0;
-       unsigned new = 0;
+       unsigned int old = 0;
+       unsigned int new = 0;
 
        int compare = 0;
 
@@ -748,7 +748,7 @@ main(int argc, char *argv[])
 
                        ret = 1;
                } else if (curTable[0]) {
-                       unsigned a;
+                       unsigned int a;
                        char *ptr = buffer;
                        char *pcnt = NULL;
                        char *bcnt = NULL;
index af4d3dcfd28645d75e546b70241bae0ac81fae20..dba9081bccf137db3d47a256b5a713863fe5c682 100644 (file)
--- a/xtables.c
+++ b/xtables.c
@@ -257,7 +257,7 @@ int service_to_port(const char *name, const char *proto)
 
 u_int16_t parse_port(const char *port, const char *proto)
 {
-       unsigned portnum;
+       unsigned int portnum;
 
        if ((string_to_number(port, 0, 65535, &portnum)) != -1 ||
            (portnum = service_to_port(port, proto)) != (unsigned)-1)