diff options
Diffstat (limited to 'src/hashmap.c')
-rw-r--r-- | src/hashmap.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/hashmap.c b/src/hashmap.c index 4f7773d..1c32f8a 100644 --- a/src/hashmap.c +++ b/src/hashmap.c @@ -1,4 +1,4 @@ -/* $Id: hashmap.c,v 1.12 2003-05-31 23:02:21 rjkaes Exp $ +/* $Id: hashmap.c,v 1.13 2003-07-31 23:38:28 rjkaes Exp $ * * A hashmap implementation. The keys are case-insensitive NULL terminated * strings, and the data is arbitrary lumps of data. Copies of both the @@ -97,12 +97,14 @@ hashmap_create(unsigned int nbuckets) if (nbuckets == 0) return NULL; - ptr = safecalloc(1, sizeof(struct hashmap_s)); + ptr = (struct hashmap_s*)safecalloc(1, sizeof(struct hashmap_s)); if (!ptr) return NULL; ptr->size = nbuckets; - ptr->buckets = safecalloc(nbuckets, sizeof(struct hashentry_s *)); + ptr->buckets = + (struct hashentry_s**)safecalloc(nbuckets, + sizeof(struct hashentry_s *)); if (!ptr->buckets) { safefree(ptr); return NULL; @@ -223,7 +225,7 @@ hashmap_insert(hashmap_t map, const char *key, data_copy = NULL; } - ptr = safemalloc(sizeof(struct hashentry_s)); + ptr = (struct hashentry_s*)safemalloc(sizeof(struct hashentry_s)); if (!ptr) { safefree(key_copy); safefree(data_copy); |