diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-07-06 22:43:55 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-07-06 22:43:55 +0100 |
| commit | 2db03cb4a54eaa594ca0d3ccb6819a8d56e7efed (patch) | |
| tree | 255b286dc38003c2e7308250b73753922aec9034 /src/map.cpp | |
| parent | eed873c6ec9ac1631fbf1285d4047596b353e9bf (diff) | |
Fix aprint* bug; NULL -> nullptr; Better error messages for overloaded functions
Diffstat (limited to 'src/map.cpp')
| -rw-r--r-- | src/map.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/map.cpp b/src/map.cpp index 7732bcfe4..4d75270fb 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -234,7 +234,7 @@ gb_inline T *map_get(Map<T> *h, HashKey key) { if (index >= 0) { return &h->entries[index].value; } - return NULL; + return nullptr; } template <typename T> @@ -303,7 +303,7 @@ template <typename T> MapEntry<T> *multi_map_find_first(Map<T> *h, HashKey key) { isize i = map__find(h, key).entry_index; if (i < 0) { - return NULL; + return nullptr; } return &h->entries[i]; } @@ -317,14 +317,14 @@ MapEntry<T> *multi_map_find_next(Map<T> *h, MapEntry<T> *e) { } i = h->entries[i].next; } - return NULL; + return nullptr; } template <typename T> isize multi_map_count(Map<T> *h, HashKey key) { isize count = 0; MapEntry<T> *e = multi_map_find_first(h, key); - while (e != NULL) { + while (e != nullptr) { count++; e = multi_map_find_next(h, e); } @@ -335,7 +335,7 @@ template <typename T> void multi_map_get_all(Map<T> *h, HashKey key, T *items) { isize i = 0; MapEntry<T> *e = multi_map_find_first(h, key); - while (e != NULL) { + while (e != nullptr) { items[i++] = e->value; e = multi_map_find_next(h, e); } @@ -374,7 +374,7 @@ void multi_map_remove(Map<T> *h, HashKey key, MapEntry<T> *e) { template <typename T> void multi_map_remove_all(Map<T> *h, HashKey key) { - while (map_get(h, key) != NULL) { + while (map_get(h, key) != nullptr) { map_remove(h, key); } } |