Fixed build errors

This commit is contained in:
Sam Lantinga
2024-09-29 04:42:19 -07:00
parent ba7b346e52
commit 2825a682f0

View File

@@ -314,23 +314,32 @@ bool SDL_InsertIntoHashTable(SDL_HashTable *restrict table, const void *key, con
return false; return false;
} }
return insert_item(&new_item, table->table, table->hash_mask, &table->max_probe_len); // This never returns NULL
insert_item(&new_item, table->table, table->hash_mask, &table->max_probe_len);
return true;
} }
bool SDL_FindInHashTable(const SDL_HashTable *table, const void *key, const void **_value) bool SDL_FindInHashTable(const SDL_HashTable *table, const void *key, const void **value)
{ {
Uint32 hash; Uint32 hash;
SDL_HashItem *i; SDL_HashItem *i;
if (!table) { if (!table) {
if (value) {
*value = NULL;
}
return false; return false;
} }
hash = calc_hash(table, key); hash = calc_hash(table, key);
i = find_first_item(table, key, hash); i = find_first_item(table, key, hash);
*_value = i ? i->value : NULL; if (i) {
if (value) {
return i; *value = i->value;
}
return true;
}
return false;
} }
bool SDL_RemoveFromHashTable(SDL_HashTable *table, const void *key) bool SDL_RemoveFromHashTable(SDL_HashTable *table, const void *key)