---
 arptables.c              |   27 +++++++++++++++------------
 libarptc/libarptc.c      |    6 ++++--
 libarptc/libarptc_incl.c |    6 ++++--
 3 files changed, 23 insertions(+), 16 deletions(-)

Index: arptables-v0.0.3-4/arptables.c
===================================================================
--- arptables-v0.0.3-4.orig/arptables.c
+++ arptables-v0.0.3-4/arptables.c
@@ -874,7 +874,7 @@ parse_target(const char *targetname)
 
 	if (strlen(targetname)+1 > sizeof(arpt_chainlabel))
 		exit_error(PARAMETER_PROBLEM,
-			   "Invalid target name `%s' (%i chars max)",
+			   "Invalid target name `%s' (%zu chars max)",
 			   targetname, sizeof(arpt_chainlabel)-1);
 
 	for (ptr = targetname; *ptr; ptr++)
@@ -1062,7 +1062,7 @@ register_match(struct arptables_match *m
 	}
 
 	if (me->size != ARPT_ALIGN(me->size)) {
-		fprintf(stderr, "%s: match `%s' has invalid size %u.\n",
+		fprintf(stderr, "%s: match `%s' has invalid size %zu.\n",
 			program_name, me->name, me->size);
 		exit(1);
 	}
@@ -1092,7 +1092,7 @@ register_target(struct arptables_target
 	}
 
 	if (me->size != ARPT_ALIGN(me->size)) {
-		fprintf(stderr, "%s: target `%s' has invalid size %u.\n",
+		fprintf(stderr, "%s: target `%s' has invalid size %zu.\n",
 			program_name, me->name, me->size);
 		exit(1);
 	}
@@ -1116,17 +1116,17 @@ print_num(u_int64_t number, unsigned int
 					number = (number + 500) / 1000;
 					if (number > 9999) {
 						number = (number + 500) / 1000;
-						printf(FMT("%4lluT ","%lluT "), number);
+						printf(FMT("%4lluT ","%lluT "), (unsigned long long)number);
 					}
-					else printf(FMT("%4lluG ","%lluG "), number);
+					else printf(FMT("%4lluG ","%lluG "), (unsigned long long)number);
 				}
-				else printf(FMT("%4lluM ","%lluM "), number);
+				else printf(FMT("%4lluM ","%lluM "), (unsigned long long)number);
 			} else
-				printf(FMT("%4lluK ","%lluK "), number);
+				printf(FMT("%4lluK ","%lluK "), (unsigned long long)number);
 		} else
-			printf(FMT("%5llu ","%llu "), number);
+			printf(FMT("%5llu ","%llu "), (unsigned long long)number);
 	} else
-		printf(FMT("%8llu ","%llu "), number);
+		printf(FMT("%8llu ","%llu "), (unsigned long long)number);
 }
 
 
@@ -1370,7 +1370,7 @@ after_devdst:
 			/* Print the target information. */
 			target->print(&fw->arp, t, format & FMT_NUMERIC);
 	} else if (t->u.target_size != sizeof(*t))
-		printf("[%u bytes of unknown target data] ",
+		printf("[%zu bytes of unknown target data] ",
 		       t->u.target_size - sizeof(*t));
 
 	if (!(format & FMT_NOCOUNTS)) {
@@ -1777,6 +1777,7 @@ int do_command(int argc, char *argv[], c
 	const char *jumpto = "";
 	char *protocol = NULL;
 	const char *modprobe = NULL;
+	unsigned long long bpcnt_num;
 
 	/* first figure out if this is a 2.6 or a 2.4 kernel */
 	*handle = arptc_init(*table);
@@ -2159,15 +2160,17 @@ int do_command(int argc, char *argv[], c
 					"-%c requires packet and byte counter",
 					opt2char(OPT_COUNTERS));
 
-			if (sscanf(pcnt, "%llu", &fw.counters.pcnt) != 1)
+			if (sscanf(pcnt, "%llu", &bpcnt_num) != 1)
 				exit_error(PARAMETER_PROBLEM,
 					"-%c packet counter not numeric",
 					opt2char(OPT_COUNTERS));
+			fw.counters.pcnt = bpcnt_num;
 
-			if (sscanf(bcnt, "%llu", &fw.counters.bcnt) != 1)
+			if (sscanf(bcnt, "%llu", &bpcnt_num) != 1)
 				exit_error(PARAMETER_PROBLEM,
 					"-%c byte counter not numeric",
 					opt2char(OPT_COUNTERS));
+			fw.counters.bcnt = bpcnt_num;
 			
 			break;
 
Index: arptables-v0.0.3-4/libarptc/libarptc.c
===================================================================
--- arptables-v0.0.3-4.orig/libarptc/libarptc.c
+++ arptables-v0.0.3-4/libarptc/libarptc.c
@@ -133,7 +133,8 @@ dump_entry(STRUCT_ENTRY *e, const TC_HAN
 	printf("Flags: %02X\n", e->arp.flags);
 	printf("Invflags: %02X\n", e->arp.invflags);
 	printf("Counters: %llu packets, %llu bytes\n",
-	       e->counters.pcnt, e->counters.bcnt);
+		(unsigned long long)e->counters.pcnt, 
+		(unsigned long long)e->counters.bcnt);
 /*
 	printf("Cache: %08X ", e->nfcache);
 	if (e->nfcache & NFC_ALTERED) printf("ALTERED ");
@@ -159,7 +160,8 @@ dump_entry(STRUCT_ENTRY *e, const TC_HAN
 	t = GET_TARGET(e);
 	printf("Target name: `%s' [%u]\n", t->u.user.name, t->u.target_size);
 	if (strcmp(t->u.user.name, STANDARD_TARGET) == 0) {
-		int pos = *(int *)t->data;
+		const unsigned char *data = t->data;
+		int pos = *(const int *)data;
 		if (pos < 0)
 			printf("verdict=%s\n",
 			       pos == -NF_ACCEPT-1 ? "NF_ACCEPT"
Index: arptables-v0.0.3-4/libarptc/libarptc_incl.c
===================================================================
--- arptables-v0.0.3-4.orig/libarptc/libarptc_incl.c
+++ arptables-v0.0.3-4/libarptc/libarptc_incl.c
@@ -121,7 +121,7 @@ entry2index(const TC_HANDLE_T h, const S
 
 	if (ENTRY_ITERATE(h->entries.entrytable, h->entries.size,
 			  get_number, seek, &pos) == 0) {
-		fprintf(stderr, "ERROR: offset %i not an entry!\n",
+		fprintf(stderr, "ERROR: offset %zu not an entry!\n",
 			(char *)seek - (char *)h->entries.entrytable);
 		abort();
 	}
@@ -583,6 +583,7 @@ target_name(TC_HANDLE_T handle, const ST
 	int spos;
 	unsigned int labelidx;
 	STRUCT_ENTRY *jumpto;
+	const unsigned char *data;
 
 	/* To avoid const warnings */
 	STRUCT_ENTRY *e = (STRUCT_ENTRY *)ce;
@@ -591,7 +592,8 @@ target_name(TC_HANDLE_T handle, const ST
 		return GET_TARGET(e)->u.user.name;
 
 	/* Standard target: evaluate */
-	spos = *(int *)GET_TARGET(e)->data;
+	data = GET_TARGET(e)->data;
+	spos = *(const int *)data;
 	if (spos < 0) {
 		if (spos == RETURN)
 			return LABEL_RETURN;
Index: arptables-v0.0.3-4/Makefile
===================================================================
--- arptables-v0.0.3-4.orig/Makefile
+++ arptables-v0.0.3-4/Makefile
@@ -10,8 +10,8 @@ INITDIR:=/etc/rc.d/init.d
 SYSCONFIGDIR:=/etc/sysconfig
 DESTDIR:=
 
-COPT_FLAGS:=-O2
-CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG
+COPT_FLAGS=-O2
+CFLAGS=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG
 
 ifndef ARPT_LIBDIR
 ARPT_LIBDIR:=$(LIBDIR)/arptables
