From 2db03cb4a54eaa594ca0d3ccb6819a8d56e7efed Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Thu, 6 Jul 2017 22:43:55 +0100 Subject: Fix aprint* bug; NULL -> nullptr; Better error messages for overloaded functions --- src/map.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/map.cpp') 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 *h, HashKey key) { if (index >= 0) { return &h->entries[index].value; } - return NULL; + return nullptr; } template @@ -303,7 +303,7 @@ template MapEntry *multi_map_find_first(Map *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 *multi_map_find_next(Map *h, MapEntry *e) { } i = h->entries[i].next; } - return NULL; + return nullptr; } template isize multi_map_count(Map *h, HashKey key) { isize count = 0; MapEntry *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 void multi_map_get_all(Map *h, HashKey key, T *items) { isize i = 0; MapEntry *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 *h, HashKey key, MapEntry *e) { template void multi_map_remove_all(Map *h, HashKey key) { - while (map_get(h, key) != NULL) { + while (map_get(h, key) != nullptr) { map_remove(h, key); } } -- cgit v1.2.3