From 445222e48c380bbb5d209a82f9614187bc751b41 Mon Sep 17 00:00:00 2001 From: Michael McConville Date: Wed, 16 Sep 2015 23:42:36 -0400 Subject: Clean up some needless malloc casts, convert some mallocs to callocs, and fix some style --- Hashtable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Hashtable.c') diff --git a/Hashtable.c b/Hashtable.c index 0f61519e..9cb2f932 100644 --- a/Hashtable.c +++ b/Hashtable.c @@ -63,7 +63,7 @@ int Hashtable_count(Hashtable* this) { static HashtableItem* HashtableItem_new(unsigned int key, void* value) { HashtableItem* this; - this = (HashtableItem*) malloc(sizeof(HashtableItem)); + this = malloc(sizeof(HashtableItem)); this->key = key; this->value = value; this->next = NULL; @@ -73,7 +73,7 @@ static HashtableItem* HashtableItem_new(unsigned int key, void* value) { Hashtable* Hashtable_new(int size, bool owner) { Hashtable* this; - this = (Hashtable*) malloc(sizeof(Hashtable)); + this = malloc(sizeof(Hashtable)); this->items = 0; this->size = size; this->buckets = (HashtableItem**) calloc(size, sizeof(HashtableItem*)); -- cgit v1.2.3