mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Clean up headers by using 'static' whenever possible.
Reduces resulting code size.
This commit is contained in:
@ -34,7 +34,7 @@ struct Hashtable_ {
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
bool Hashtable_isConsistent(Hashtable* this) {
|
||||
static bool Hashtable_isConsistent(Hashtable* this) {
|
||||
int items = 0;
|
||||
for (int i = 0; i < this->size; i++) {
|
||||
HashtableItem* bucket = this->buckets[i];
|
||||
@ -61,7 +61,7 @@ int Hashtable_count(Hashtable* this) {
|
||||
|
||||
#endif
|
||||
|
||||
HashtableItem* HashtableItem_new(unsigned int key, void* value) {
|
||||
static HashtableItem* HashtableItem_new(unsigned int key, void* value) {
|
||||
HashtableItem* this;
|
||||
|
||||
this = (HashtableItem*) malloc(sizeof(HashtableItem));
|
||||
@ -99,11 +99,6 @@ void Hashtable_delete(Hashtable* this) {
|
||||
free(this);
|
||||
}
|
||||
|
||||
inline int Hashtable_size(Hashtable* this) {
|
||||
assert(Hashtable_isConsistent(this));
|
||||
return this->items;
|
||||
}
|
||||
|
||||
void Hashtable_put(Hashtable* this, unsigned int key, void* value) {
|
||||
unsigned int index = key % this->size;
|
||||
HashtableItem** bucketPtr = &(this->buckets[index]);
|
||||
|
Reference in New Issue
Block a user