mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-12 06:18:13 +00:00
Fixed build errors
This commit is contained in:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user