From 4eec8b3824d49c1c0503ebbf7844a4e312bc29e1 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu" Date: Thu, 13 Nov 2008 09:36:37 +0000 Subject: 2.4.4 - Premature checking prevents to add valid elements to hash types, fixed (bug reported by JC Janos). - Local variable shadows another variable, fixed (reported by Jan Engelhardt). - More compiler warning options added and warnings fixed. --- ipset.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'ipset.h') diff --git a/ipset.h b/ipset.h index 1c8b0c1..35a2055 100644 --- a/ipset.h +++ b/ipset.h @@ -68,11 +68,10 @@ enum set_commands { CMD_ADT_GET, }; -enum exittype { - OTHER_PROBLEM = 1, - PARAMETER_PROBLEM, - VERSION_PROBLEM -}; +/* Exit codes */ +#define OTHER_PROBLEM 1 +#define PARAMETER_PROBLEM 2 +#define VERSION_PROBLEM 3 /* The view of an ipset in userspace */ struct set { @@ -118,7 +117,7 @@ struct settype { size_t adt_size; /* Function which parses command options */ - ip_set_ip_t (*adt_parser) (unsigned cmd, const char *optarg, void *data); + ip_set_ip_t (*adt_parser) (int cmd, const char *optarg, void *data); /* * Printing @@ -157,7 +156,7 @@ struct settype { /* Internal data */ void *header; void *data; - unsigned int option_offset; + int option_offset; unsigned int flags; }; @@ -165,7 +164,7 @@ extern void settype_register(struct settype *settype); /* extern void unregister_settype(set_type_t *set_type); */ -extern void exit_error(enum exittype status, const char *msg, ...); +extern void exit_error(int status, const char *msg, ...); extern char *binding_ip_tostring(struct set *set, ip_set_ip_t ip, unsigned options); @@ -194,4 +193,9 @@ extern unsigned warn_once; #define ID2MASK(id) (1 << ((id)%BITSPERBYTE)) #define test_bit(id, heap) ((((char *)(heap))[ID2BYTE(id)] & ID2MASK(id)) != 0) +#define UNUSED __attribute__ ((unused)) +#define CONSTRUCTOR(module) \ +void __attribute__ ((constructor)) module##_init(void); \ +void module##_init(void) + #endif /* __IPSET_H */ -- cgit v1.2.3