summaryrefslogtreecommitdiff
path: root/src/hashmap.c
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2003-07-31 23:38:28 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2003-07-31 23:38:28 +0000
commit6aaa863432967b99d0e2c87116b4ec844b90436f (patch)
tree40d8a50800514332aab7e469c351e4491cab6dfe /src/hashmap.c
parentab02f47a297693752e1d68d5eaf914c77cfb652c (diff)
downloadtinyproxy-6aaa863432967b99d0e2c87116b4ec844b90436f.tar.gz
tinyproxy-6aaa863432967b99d0e2c87116b4ec844b90436f.zip
Added appropriate casts from (void*) so that the code will compile
cleanly with a C++ compiler. (Tested using GCC 3.3)
Diffstat (limited to '')
-rw-r--r--src/hashmap.c10
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);