Fix hash table issues with ISO C99
ISO C99 forbids unnamed structs/unions and nested functions. Move the "HTABLE_HEAD" and "HTABLE_GENERATE" parts out of the function body and place them at the very top of the file (where function definitions are allowed). Also, remove the unnamed struct from "htable.h" (which was useless anyway). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
@@ -69,9 +69,7 @@ struct name { \
|
||||
}
|
||||
|
||||
#define HTABLE_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *next; /* To build the bucket chain list. */ \
|
||||
}
|
||||
struct type *next /* To build the bucket chain list. */
|
||||
|
||||
#define HTABLE_SIZE(head) \
|
||||
(sizeof (*(head)->bkts) ? sizeof ((head)->bkts) / sizeof (*(head)->bkts) : 0)
|
||||
|
||||
Reference in New Issue
Block a user