X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fhashtable.h;h=4dc223fec61b4c0f31adbdfb310d11dfb2dde8c2;hb=2c231515ea791d45d206dacfe0268341bb7fdfd0;hp=aa73ad8f8f69732bfbc07183d355b8fa7d839e77;hpb=e0a22ab2268f3aab6be7a4cd982087429e9cf976;p=libucw.git diff --git a/lib/hashtable.h b/lib/hashtable.h index aa73ad8f..4dc223fe 100644 --- a/lib/hashtable.h +++ b/lib/hashtable.h @@ -317,8 +317,6 @@ static inline void P(init_data) (TAUC P(node) *n UNUSED) } #endif -#include - #ifdef HASH_GIVE_ALLOC /* If the caller has requested to use his own allocation functions, do so */ static inline void P(init_alloc) (TAU) { } @@ -351,8 +349,8 @@ static inline void P(cleanup_alloc) (TAU) { } #endif #ifdef HASH_TABLE_ALLOC -static inline void * P(table_alloc) (TAUC unsigned int size) { return P(alloc)(size); } -static inline void P(table_free) (TAUC void *x) { P(free)(x); } +static inline void * P(table_alloc) (TAUC unsigned int size) { return P(alloc)(TTC size); } +static inline void P(table_free) (TAUC void *x) { P(free)(TTC x); } #else static inline void * P(table_alloc) (TAUC unsigned int size) { return xmalloc(size); } static inline void P(table_free) (TAUC void *x) { xfree(x); } @@ -381,7 +379,7 @@ static inline void * P(new_bucket)(TAUC uns size) { return P(alloc)(TTC size); } static void P(alloc_table) (TAU) { - T.hash_size = nextprime(T.hash_size); + T.hash_size = next_table_prime(T.hash_size); T.ht = P(table_alloc)(TTC sizeof(void *) * T.hash_size); bzero(T.ht, sizeof(void *) * T.hash_size); if (2*T.hash_size < T.hash_hard_max) @@ -613,7 +611,7 @@ do { \ GLUE_(h_px,node) *h_var = &h_buck->n; #define HASH_FOR_ALL(h_px, h_var) HASH_FOR_ALL_DYNAMIC(h_px, &GLUE_(h_px,table), h_var) #define HASH_END_FOR } } while(0) -#define HASH_BREAK +#define HASH_BREAK #define HASH_CONTINUE continue #endif