]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
get rid of numerous gcc-4 warnings
authorHarald Welte <laforge@gnumonks.org>
Tue, 19 Jul 2005 22:03:49 +0000 (22:03 +0000)
committerHarald Welte <laforge@gnumonks.org>
Tue, 19 Jul 2005 22:03:49 +0000 (22:03 +0000)
14 files changed:
extensions/libip6t_length.c
extensions/libip6t_physdev.c
extensions/libipt_DSCP.c
extensions/libipt_TOS.c
extensions/libipt_comment.c
extensions/libipt_dscp.c
extensions/libipt_physdev.c
extensions/libipt_rpc.c
extensions/libipt_tos.c
extensions/libipt_ttl.c
ip6tables.c
iptables.c
libipq/libipq.c
libiptc/libiptc.c

index c944c65e093674de97a1362100394cc26814b928..9f7ba16559afd838efdf840c77e7b0aee27e4c83 100644 (file)
@@ -30,7 +30,7 @@ static u_int16_t
 parse_length(const char *s)
 {
 
-       int len;
+       unsigned int len;
        
        if (string_to_number(s, 0, 0xFFFF, &len) == -1)
                exit_error(PARAMETER_PROBLEM, "length invalid: `%s'\n", s);
index fb473470430264eb1832547250781781320de252..e7fa22e98d3685deddafc3bf52a982f257d57e18 100644 (file)
@@ -53,7 +53,8 @@ parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IP6T_PHYSDEV_OP_IN)
                        goto multiple_use;
                check_inverse(optarg, &invert, &optind, 0);
-               parse_interface(argv[optind-1], info->physindev, info->in_mask);
+               parse_interface(argv[optind-1], info->physindev,
+                               (unsigned char *)info->in_mask);
                if (invert)
                        info->invert |= IP6T_PHYSDEV_OP_IN;
                info->bitmask |= IP6T_PHYSDEV_OP_IN;
@@ -65,7 +66,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
                        goto multiple_use;
                check_inverse(optarg, &invert, &optind, 0);
                parse_interface(argv[optind-1], info->physoutdev,
-                               info->out_mask);
+                               (unsigned char *)info->out_mask);
                if (invert)
                        info->invert |= IP6T_PHYSDEV_OP_OUT;
                info->bitmask |= IP6T_PHYSDEV_OP_OUT;
index 90e2a344067ed5d1e3b8f2af0dcc2b46ffb1dfe7..c50d902bb463baadaa1172fab5479d99bc5179e7 100644 (file)
@@ -49,7 +49,7 @@ static struct option opts[] = {
 };
 
 static void
-parse_dscp(const unsigned char *s, struct ipt_DSCP_info *dinfo)
+parse_dscp(const char *s, struct ipt_DSCP_info *dinfo)
 {
        unsigned int dscp;
        
@@ -67,7 +67,7 @@ parse_dscp(const unsigned char *s, struct ipt_DSCP_info *dinfo)
 
 
 static void
-parse_class(const unsigned char *s, struct ipt_DSCP_info *dinfo)
+parse_class(const char *s, struct ipt_DSCP_info *dinfo)
 {
        unsigned int dscp = class_to_dscp(s);
 
index 4302950d615d56b58494dba2bd5e7a76d9ccd894..999f7b028c668b8d6b06d7257f04037627bb3197 100644 (file)
@@ -59,7 +59,7 @@ init(struct ipt_entry_target *t, unsigned int *nfcache)
 }
 
 static void
-parse_tos(const unsigned char *s, struct ipt_tos_target_info *info)
+parse_tos(const char *s, struct ipt_tos_target_info *info)
 {
        unsigned int i, tos;
 
index c543fc69dfda9d5f6a308b1a2efcfb9cff697821..692acca3307687d084831c558d42cbda4efe8a61 100644 (file)
@@ -30,7 +30,7 @@ static struct option opts[] = {
 };
 
 static void
-parse_comment(const unsigned char *s, struct ipt_comment_info *info)
+parse_comment(const char *s, struct ipt_comment_info *info)
 {      
        int slen = strlen(s);
 
@@ -38,7 +38,7 @@ parse_comment(const unsigned char *s, struct ipt_comment_info *info)
                exit_error(PARAMETER_PROBLEM,
                        "COMMENT must be shorter than %i characters", IPT_MAX_COMMENT_LEN);
        }
-       strcpy(info->comment, s);
+       strcpy((char *)info->comment, s);
 }
 
 /* Function which parses command options; returns true if it
index 4520a6a7e9e381024e591e552b3a3f64ed61ec84..bb19bede841b544bd1f4c555ebf8dc1f01af5c29 100644 (file)
@@ -46,7 +46,7 @@ static struct option opts[] = {
 };
 
 static void
-parse_dscp(const unsigned char *s, struct ipt_dscp_info *dinfo)
+parse_dscp(const char *s, struct ipt_dscp_info *dinfo)
 {
        unsigned int dscp;
        
index b6dae2ac86e8ba2709a0d6c6f1a3e3ebe5d13fdc..28ee82712f2e8962ad2a80921828f9f5dcc3d085 100644 (file)
@@ -53,7 +53,8 @@ parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IPT_PHYSDEV_OP_IN)
                        goto multiple_use;
                check_inverse(optarg, &invert, &optind, 0);
-               parse_interface(argv[optind-1], info->physindev, info->in_mask);
+               parse_interface(argv[optind-1], info->physindev,
+                               (unsigned char *)info->in_mask);
                if (invert)
                        info->invert |= IPT_PHYSDEV_OP_IN;
                info->bitmask |= IPT_PHYSDEV_OP_IN;
@@ -65,7 +66,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
                        goto multiple_use;
                check_inverse(optarg, &invert, &optind, 0);
                parse_interface(argv[optind-1], info->physoutdev,
-                               info->out_mask);
+                               (unsigned char *)info->out_mask);
                if (invert)
                        info->invert |= IPT_PHYSDEV_OP_OUT;
                info->bitmask |= IPT_PHYSDEV_OP_OUT;
index f6e897acdc66a75b506de312c434ece99c313246..dbfb3962639f138a40ae9680b1457110ef54e2e1 100644 (file)
@@ -89,7 +89,7 @@ static int k_itoa(char *string, int number)
 }
 
 
-static int k_atoi(signed char *string)
+static int k_atoi(char *string)
 {
        unsigned int result = 0;
        int maxoctet = IPT_RPC_CHAR_LEN;
index 7a10a5022f260e31fbfb331ada3f4fd1054c7981..5b1866e51dee4f7660904e7a1bb245ab0addb8fa 100644 (file)
@@ -48,10 +48,10 @@ static struct option opts[] = {
 };
 
 static void
-parse_tos(const unsigned char *s, struct ipt_tos_info *info)
+parse_tos(const char *s, struct ipt_tos_info *info)
 {
        unsigned int i;
-       unsigned int tos;
+       int tos;
 
        if (string_to_number(s, 0, 255, &tos) != -1) {
                if (tos == IPTOS_LOWDELAY
index 3a25734b519ce20f447d96808e301b97368a5326..db5b002a1cdb597cbdc264e14cefbf01d7451618 100644 (file)
@@ -29,7 +29,7 @@ static int parse(int c, char **argv, int invert, unsigned int *flags,
                struct ipt_entry_match **match)
 {
        struct ipt_ttl_info *info = (struct ipt_ttl_info *) (*match)->data;
-       int value;
+       unsigned int value;
 
        check_inverse(optarg, &invert, &optind, 0);
 
index 9bfe1d3831923ab98f48c2dc3202cc9a3ea0eac0..49dcbf0705eb28d9f34765a1adc4743dc5d9b368 100644 (file)
@@ -430,7 +430,8 @@ cmd2char(int option)
 }
 
 static void
-add_command(int *cmd, const int newcmd, const int othercmds, int invert)
+add_command(unsigned int *cmd, const int newcmd, const int othercmds,
+           int invert)
 {
        if (invert)
                exit_error(PARAMETER_PROBLEM, "unexpected ! flag");
index 92c6c49cb777111e1d47826dbb9294f7c0063469..0bb2b0370357c17df664dda774dc28b541e6302e 100644 (file)
@@ -484,7 +484,8 @@ cmd2char(int option)
 }
 
 static void
-add_command(int *cmd, const int newcmd, const int othercmds, int invert)
+add_command(unsigned int *cmd, const int newcmd, const int othercmds, 
+           int invert)
 {
        if (invert)
                exit_error(PARAMETER_PROBLEM, "unexpected ! flag");
index a25ad4ceccfcf9670fdb5d0496f29de2dc26ca37..658af9755dc1af03bf6070b4ec9732ba622ac864 100644 (file)
@@ -122,7 +122,8 @@ static ssize_t ipq_netlink_recvfrom(const struct ipq_handle *h,
                                     unsigned char *buf, size_t len,
                                     int timeout)
 {
-       int addrlen, status;
+       unsigned int addrlen;
+       int status;
        struct nlmsghdr *nlh;
 
        if (len < sizeof(struct nlmsgerr)) {
index 9f7d2ceeb3e6340d4638b2ef302550afdebc77e4..7546d87b4eef711424859c4d222e50e8a54de1c2 100644 (file)
@@ -674,7 +674,7 @@ static int iptcc_compile_chain(TC_HANDLE_T h, STRUCT_REPLACE *repl, struct chain
 
 /* calculate offset and number for every rule in the cache */
 static int iptcc_compile_chain_offsets(TC_HANDLE_T h, struct chain_head *c,
-                                      int *offset, int *num)
+                                      unsigned int *offset, unsigned int *num)
 {
        struct rule_head *r;
 
@@ -798,7 +798,7 @@ TC_INIT(const char *tablename)
 {
        TC_HANDLE_T h;
        STRUCT_GETINFO info;
-       int tmp;
+       unsigned int tmp;
        socklen_t s;
 
        iptc_fn = TC_INIT;