From 39a1261a723c3c1d1860176cbad4eca17d858b94 Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Mon, 23 Jan 2006 18:50:54 +0000 Subject: remove unsigned char * warning with gcc 4.0 --- userspace/ebtables2/extensions/ebt_among.c | 2 +- userspace/ebtables2/extensions/ebt_arp.c | 4 ++-- userspace/ebtables2/extensions/ebt_log.c | 4 ++-- userspace/ebtables2/extensions/ebt_stp.c | 14 +++++++++----- 4 files changed, 14 insertions(+), 10 deletions(-) (limited to 'userspace/ebtables2/extensions') diff --git a/userspace/ebtables2/extensions/ebt_among.c b/userspace/ebtables2/extensions/ebt_among.c index 65ce481..7e01b49 100644 --- a/userspace/ebtables2/extensions/ebt_among.c +++ b/userspace/ebtables2/extensions/ebt_among.c @@ -375,7 +375,7 @@ static void wormhash_printout(const struct ebt_mac_wormhash *wh) const struct ebt_mac_wormhash_tuple *p; p = (const struct ebt_mac_wormhash_tuple *)(&wh->pool[i]); - ebt_print_mac(((const char *) &p->cmp[0]) + 2); + ebt_print_mac(((const unsigned char *) &p->cmp[0]) + 2); if (p->ip) { ip = (unsigned char *) &p->ip; printf("=%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]); diff --git a/userspace/ebtables2/extensions/ebt_arp.c b/userspace/ebtables2/extensions/ebt_arp.c index 9eed645..ffe6781 100644 --- a/userspace/ebtables2/extensions/ebt_arp.c +++ b/userspace/ebtables2/extensions/ebt_arp.c @@ -96,8 +96,8 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry, char *end; uint32_t *addr; uint32_t *mask; - char *maddr; - char *mmask; + unsigned char *maddr; + unsigned char *mmask; switch (c) { case ARP_OPCODE: diff --git a/userspace/ebtables2/extensions/ebt_log.c b/userspace/ebtables2/extensions/ebt_log.c index 7429479..575d12e 100644 --- a/userspace/ebtables2/extensions/ebt_log.c +++ b/userspace/ebtables2/extensions/ebt_log.c @@ -118,7 +118,7 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry, ebt_print_error2("Prefix too long"); if (strchr(optarg, '\"')) ebt_print_error2("Use of \\\" is not allowed in the prefix"); - strcpy(loginfo->prefix, optarg); + strcpy((char *)loginfo->prefix, (char *)optarg); break; case LOG_LEVEL: @@ -188,7 +188,7 @@ static int compare(const struct ebt_entry_watcher *w1, return 0; if (loginfo1->bitmask != loginfo2->bitmask) return 0; - return !strcmp(loginfo1->prefix, loginfo2->prefix); + return !strcmp((char *)loginfo1->prefix, (char *)loginfo2->prefix); } static struct ebt_u_watcher log_watcher = diff --git a/userspace/ebtables2/extensions/ebt_stp.c b/userspace/ebtables2/extensions/ebt_stp.c index 307131f..08a48fb 100644 --- a/userspace/ebtables2/extensions/ebt_stp.c +++ b/userspace/ebtables2/extensions/ebt_stp.c @@ -236,12 +236,14 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry, break; case EBT_STP_ROOTADDR: if (ebt_get_mac_and_mask(argv[optind-1], - stpinfo->config.root_addr, stpinfo->config.root_addrmsk)) + (unsigned char *)stpinfo->config.root_addr, + (unsigned char *)stpinfo->config.root_addrmsk)) ebt_print_error("Bad --stp-root-addr address"); break; case EBT_STP_SENDERADDR: - if (ebt_get_mac_and_mask(argv[optind-1], stpinfo->config.sender_addr, - stpinfo->config.sender_addrmsk)) + if (ebt_get_mac_and_mask(argv[optind-1], + (unsigned char *)stpinfo->config.sender_addr, + (unsigned char *)stpinfo->config.sender_addrmsk)) ebt_print_error("Bad --stp-sender-addr address"); break; default: @@ -293,13 +295,15 @@ static void print(const struct ebt_u_entry *entry, } else if (EBT_STP_ROOTPRIO == (1 << i)) print_range(c->root_priol, c->root_priou); else if (EBT_STP_ROOTADDR == (1 << i)) - ebt_print_mac_and_mask(c->root_addr, c->root_addrmsk); + ebt_print_mac_and_mask((unsigned char *)c->root_addr, + (unsigned char*)c->root_addrmsk); else if (EBT_STP_ROOTCOST == (1 << i)) print_range(c->root_costl, c->root_costu); else if (EBT_STP_SENDERPRIO == (1 << i)) print_range(c->sender_priol, c->sender_priou); else if (EBT_STP_SENDERADDR == (1 << i)) - ebt_print_mac_and_mask(c->sender_addr, c->sender_addrmsk); + ebt_print_mac_and_mask((unsigned char *)c->sender_addr, + (unsigned char *)c->sender_addrmsk); else if (EBT_STP_PORT == (1 << i)) print_range(c->portl, c->portu); else if (EBT_STP_MSGAGE == (1 << i)) -- cgit v1.2.3