diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2004-02-13 21:27:42 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2004-02-13 21:27:42 +0000 |
commit | aee5a6384985746420fda1c07d4231c4272ae715 (patch) | |
tree | ec784f7f8aa36ef58566b8fe31c6927e52398089 /src/hashmap.c | |
parent | bf22966f558ca95222c94706124a3a385f5aa0bf (diff) | |
download | tinyproxy-aee5a6384985746420fda1c07d4231c4272ae715.tar.gz tinyproxy-aee5a6384985746420fda1c07d4231c4272ae715.zip |
Removed unnecessary casts (mostly dealing with memory allocation.) I
should never have added them in the first place. They don't really
buy anything, and they can hide bugs.
Diffstat (limited to '')
-rw-r--r-- | src/hashmap.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/hashmap.c b/src/hashmap.c index 1c32f8a..f1806af 100644 --- a/src/hashmap.c +++ b/src/hashmap.c @@ -1,4 +1,4 @@ -/* $Id: hashmap.c,v 1.13 2003-07-31 23:38:28 rjkaes Exp $ +/* $Id: hashmap.c,v 1.14 2004-02-13 21:27:42 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,14 +97,12 @@ hashmap_create(unsigned int nbuckets) if (nbuckets == 0) return NULL; - ptr = (struct hashmap_s*)safecalloc(1, sizeof(struct hashmap_s)); + ptr = safecalloc(1, sizeof(struct hashmap_s)); if (!ptr) return NULL; ptr->size = nbuckets; - ptr->buckets = - (struct hashentry_s**)safecalloc(nbuckets, - sizeof(struct hashentry_s *)); + ptr->buckets = safecalloc(nbuckets, sizeof(struct hashentry_s *)); if (!ptr->buckets) { safefree(ptr); return NULL; @@ -225,7 +223,7 @@ hashmap_insert(hashmap_t map, const char *key, data_copy = NULL; } - ptr = (struct hashentry_s*)safemalloc(sizeof(struct hashentry_s)); + ptr = safemalloc(sizeof(struct hashentry_s)); if (!ptr) { safefree(key_copy); safefree(data_copy); |