From 31c52205e0f4f5bb6fffcbd928f2975b0bad75d4 Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org" Date: Tue, 19 Jul 2005 22:03:49 +0000 Subject: get rid of numerous gcc-4 warnings --- extensions/libip6t_length.c | 2 +- extensions/libip6t_physdev.c | 5 +++-- extensions/libipt_DSCP.c | 4 ++-- extensions/libipt_TOS.c | 2 +- extensions/libipt_comment.c | 4 ++-- extensions/libipt_dscp.c | 2 +- extensions/libipt_physdev.c | 5 +++-- extensions/libipt_rpc.c | 2 +- extensions/libipt_tos.c | 4 ++-- extensions/libipt_ttl.c | 2 +- ip6tables.c | 3 ++- iptables.c | 3 ++- libipq/libipq.c | 3 ++- libiptc/libiptc.c | 4 ++-- 14 files changed, 25 insertions(+), 20 deletions(-) diff --git a/extensions/libip6t_length.c b/extensions/libip6t_length.c index c944c65..9f7ba16 100644 --- a/extensions/libip6t_length.c +++ b/extensions/libip6t_length.c @@ -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); diff --git a/extensions/libip6t_physdev.c b/extensions/libip6t_physdev.c index fb47347..e7fa22e 100644 --- a/extensions/libip6t_physdev.c +++ b/extensions/libip6t_physdev.c @@ -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; diff --git a/extensions/libipt_DSCP.c b/extensions/libipt_DSCP.c index 90e2a34..c50d902 100644 --- a/extensions/libipt_DSCP.c +++ b/extensions/libipt_DSCP.c @@ -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); diff --git a/extensions/libipt_TOS.c b/extensions/libipt_TOS.c index 4302950..999f7b0 100644 --- a/extensions/libipt_TOS.c +++ b/extensions/libipt_TOS.c @@ -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; diff --git a/extensions/libipt_comment.c b/extensions/libipt_comment.c index c543fc6..692acca 100644 --- a/extensions/libipt_comment.c +++ b/extensions/libipt_comment.c @@ -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 diff --git a/extensions/libipt_dscp.c b/extensions/libipt_dscp.c index 4520a6a..bb19bed 100644 --- a/extensions/libipt_dscp.c +++ b/extensions/libipt_dscp.c @@ -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; diff --git a/extensions/libipt_physdev.c b/extensions/libipt_physdev.c index b6dae2a..28ee827 100644 --- a/extensions/libipt_physdev.c +++ b/extensions/libipt_physdev.c @@ -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; diff --git a/extensions/libipt_rpc.c b/extensions/libipt_rpc.c index f6e897a..dbfb396 100644 --- a/extensions/libipt_rpc.c +++ b/extensions/libipt_rpc.c @@ -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; diff --git a/extensions/libipt_tos.c b/extensions/libipt_tos.c index 7a10a50..5b1866e 100644 --- a/extensions/libipt_tos.c +++ b/extensions/libipt_tos.c @@ -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 diff --git a/extensions/libipt_ttl.c b/extensions/libipt_ttl.c index 3a25734..db5b002 100644 --- a/extensions/libipt_ttl.c +++ b/extensions/libipt_ttl.c @@ -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); diff --git a/ip6tables.c b/ip6tables.c index 9bfe1d3..49dcbf0 100644 --- a/ip6tables.c +++ b/ip6tables.c @@ -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"); diff --git a/iptables.c b/iptables.c index 92c6c49..0bb2b03 100644 --- a/iptables.c +++ b/iptables.c @@ -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"); diff --git a/libipq/libipq.c b/libipq/libipq.c index a25ad4c..658af97 100644 --- a/libipq/libipq.c +++ b/libipq/libipq.c @@ -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)) { diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index 9f7d2ce..7546d87 100644 --- a/libiptc/libiptc.c +++ b/libiptc/libiptc.c @@ -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; -- cgit v1.2.3