mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Clean up some needless malloc casts, convert some mallocs to callocs, and fix some style
This commit is contained in:
@ -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*));
|
||||
|
Reference in New Issue
Block a user