hashmap: fix three implicit cast warnings.
Michael
This commit is contained in:
parent
181b03d729
commit
ab9e8a59e2
@ -106,12 +106,13 @@ hashmap_create (unsigned int nbuckets)
|
|||||||
if (nbuckets == 0)
|
if (nbuckets == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ptr = safecalloc (1, sizeof (struct hashmap_s));
|
ptr = (struct hashmap_s *)safecalloc (1, sizeof (struct hashmap_s));
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ptr->size = nbuckets;
|
ptr->size = nbuckets;
|
||||||
ptr->buckets = safecalloc (nbuckets, sizeof (struct hashbucket_s));
|
ptr->buckets = (struct hashbucket_s *)safecalloc (nbuckets,
|
||||||
|
sizeof (struct hashbucket_s));
|
||||||
if (!ptr->buckets)
|
if (!ptr->buckets)
|
||||||
{
|
{
|
||||||
safefree (ptr);
|
safefree (ptr);
|
||||||
@ -231,7 +232,7 @@ hashmap_insert (hashmap_t map, const char *key, const void *data, size_t len)
|
|||||||
}
|
}
|
||||||
memcpy (data_copy, data, len);
|
memcpy (data_copy, data, len);
|
||||||
|
|
||||||
ptr = safemalloc (sizeof (struct hashentry_s));
|
ptr = (struct hashentry_s *)safemalloc (sizeof (struct hashentry_s));
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
{
|
{
|
||||||
safefree (key_copy);
|
safefree (key_copy);
|
||||||
|
Loading…
Reference in New Issue
Block a user