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:
Lukas Fleischer
2012-02-19 03:04:39 +01:00
parent 136e5bc4f7
commit 2702a61b0e
3 changed files with 18 additions and 13 deletions

View File

@@ -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)