diff options
| author | Ginger Bill <bill@gingerbill.org> | 2016-11-23 12:25:37 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2016-11-23 12:25:37 +0000 |
| commit | a77c6b3e55c5857c9c0ba36baae2dbdcd7564cd4 (patch) | |
| tree | b53241533f12e6f9075026a77860a9cc1dd5baa0 /src/map.c | |
| parent | ef8563a818812493c33e34a259189757d0e7612b (diff) | |
Compile as C! Whoop!
Diffstat (limited to 'src/map.c')
| -rw-r--r-- | src/map.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -76,7 +76,7 @@ gb_inline void _J2(MAP_FUNC,destroy)(MAP_NAME *h) { } gb_internal isize _J2(MAP_FUNC,_add_entry)(MAP_NAME *h, HashKey key) { - MAP_ENTRY e = {}; + MAP_ENTRY e = {0}; e.key = key; e.next = -1; array_add(&h->entries, e); @@ -99,7 +99,7 @@ gb_internal MapFindResult _J2(MAP_FUNC,_find)(MAP_NAME *h, HashKey key) { return fr; } -gb_internal MapFindResult _J2(MAP_FUNC,_find)(MAP_NAME *h, MAP_ENTRY *e) { +gb_internal MapFindResult _J2(MAP_FUNC,_find_from_entry)(MAP_NAME *h, MAP_ENTRY *e) { MapFindResult fr = {-1, -1, -1}; if (h->hashes.count > 0) { fr.hash_index = e->key.key % h->hashes.count; @@ -244,7 +244,7 @@ MAP_ENTRY *_J2(MAP_FUNC,multi_find_next)(MAP_NAME *h, MAP_ENTRY *e) { isize _J2(MAP_FUNC,multi_count)(MAP_NAME *h, HashKey key) { isize count = 0; - auto *e = _J2(MAP_FUNC,multi_find_first)(h, key); + MAP_ENTRY *e = _J2(MAP_FUNC,multi_find_first)(h, key); while (e != NULL) { count++; e = _J2(MAP_FUNC,multi_find_next)(h, e); @@ -254,7 +254,7 @@ isize _J2(MAP_FUNC,multi_count)(MAP_NAME *h, HashKey key) { void _J2(MAP_FUNC,multi_get_all)(MAP_NAME *h, HashKey key, MAP_TYPE *items) { isize i = 0; - auto *e = _J2(MAP_FUNC,multi_find_first)(h, key); + MAP_ENTRY *e = _J2(MAP_FUNC,multi_find_first)(h, key); while (e != NULL) { items[i++] = e->value; e = _J2(MAP_FUNC,multi_find_next)(h, e); @@ -280,7 +280,7 @@ void _J2(MAP_FUNC,multi_insert)(MAP_NAME *h, HashKey key, MAP_TYPE value) { } void _J2(MAP_FUNC,multi_remove)(MAP_NAME *h, HashKey key, MAP_ENTRY *e) { - MapFindResult fr = _J2(MAP_FUNC,_find)(h, e); + MapFindResult fr = _J2(MAP_FUNC,_find_from_entry)(h, e); if (fr.entry_index >= 0) { _J2(MAP_FUNC,_erase)(h, fr); } |