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/array.cpp | |
| parent | eed873c6ec9ac1631fbf1285d4047596b353e9bf (diff) | |
Fix aprint* bug; NULL -> nullptr; Better error messages for overloaded functions
Diffstat (limited to 'src/array.cpp')
| -rw-r--r-- | src/array.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/array.cpp b/src/array.cpp index a46ccc47f..6670c7843 100644 --- a/src/array.cpp +++ b/src/array.cpp @@ -61,7 +61,7 @@ Array<T> array_make(T *data, isize count, isize capacity) { template <typename T> void array_free(Array<T> *array) { - if (array->allocator.proc != NULL) { + if (array->allocator.proc != nullptr) { gb_free(array->allocator, array->data); } array->count = 0; @@ -123,7 +123,7 @@ void array_set_capacity(Array<T> *array, isize capacity) { array_resize(array, capacity); } - T *new_data = NULL; + T *new_data = nullptr; if (capacity > 0) { new_data = gb_alloc_array(array->allocator, T, capacity); gb_memmove(new_data, array->data, gb_size_of(T) * array->capacity); @@ -147,7 +147,7 @@ typedef Array(void) ArrayVoid; #define array_init_reserve(x_, allocator_, init_capacity_) do { \ void **e = cast(void **)&((x_)->e); \ - GB_ASSERT((x_) != NULL); \ + GB_ASSERT((x_) != nullptr); \ (x_)->allocator = (allocator_); \ (x_)->count = 0; \ (x_)->capacity = (init_capacity_); \ @@ -156,7 +156,7 @@ typedef Array(void) ArrayVoid; #define array_init_count(x_, allocator_, init_count_) do { \ void **e = cast(void **)&((x_)->e); \ - GB_ASSERT((x_) != NULL); \ + GB_ASSERT((x_) != nullptr); \ (x_)->allocator = (allocator_); \ (x_)->count = (init_count_); \ (x_)->capacity = (init_count_); \ @@ -203,7 +203,7 @@ typedef Array(void) ArrayVoid; void array__set_capacity(void *ptr, isize capacity, isize element_size) { ArrayVoid *x = cast(ArrayVoid *)ptr; - GB_ASSERT(ptr != NULL); + GB_ASSERT(ptr != nullptr); GB_ASSERT(element_size > 0); |