diff --git a/ccc/private/private_buffer.h b/ccc/private/private_buffer.h index 9a3c429f..2fcd8fa8 100644 --- a/ccc/private/private_buffer.h +++ b/ccc/private/private_buffer.h @@ -46,14 +46,6 @@ struct CCC_Buffer void *context; }; -/** @internal */ -#define CCC_private_buf_non_CCC_private_buf_default_size(...) __VA_ARGS__ -/** @internal */ -#define CCC_private_buf_default_size(...) 0 -/** @internal */ -#define CCC_private_buf_optional_size(...) \ - __VA_OPT__(CCC_private_buf_non_)##CCC_private_buf_default_size(__VA_ARGS__) - /** @internal Initializes the Buffer with a default size of 0. However the user can specify that the Buffer has some count of elements from index `[0, capacity - 1)` at initialization time. The Buffer assumes these elements @@ -175,4 +167,4 @@ of memory in one step. */ /* NOLINTEND(readability-identifier-naming) */ -#endif /* CCC_PRIVATE_BUF_H */ +#endif /* CCC_PRIVATE_BUFFER_H */ diff --git a/source/bitset.c b/source/bitset.c index 531263a3..75cf3fa8 100644 --- a/source/bitset.c +++ b/source/bitset.c @@ -1029,7 +1029,7 @@ CCC_Result CCC_bitset_reserve(CCC_Bitset *const bitset, size_t const to_add, CCC_Allocator *const allocate) { - if (!bitset || !allocate) + if (!bitset || !allocate || !to_add) { return CCC_RESULT_ARGUMENT_ERROR; } diff --git a/source/buffer.c b/source/buffer.c index 8eb91250..0816788c 100644 --- a/source/buffer.c +++ b/source/buffer.c @@ -60,7 +60,7 @@ CCC_Result CCC_buffer_reserve(CCC_Buffer *const buffer, size_t const to_add, CCC_Allocator *const allocate) { - if (!buffer || !allocate) + if (!buffer || !allocate || !to_add) { return CCC_RESULT_ARGUMENT_ERROR; } diff --git a/source/flat_double_ended_queue.c b/source/flat_double_ended_queue.c index 6e52c0c3..610047c3 100644 --- a/source/flat_double_ended_queue.c +++ b/source/flat_double_ended_queue.c @@ -360,7 +360,7 @@ CCC_flat_double_ended_queue_reserve(CCC_Flat_double_ended_queue *const queue, size_t const to_add, CCC_Allocator *const allocate) { - if (!queue || !allocate) + if (!queue || !allocate || !to_add) { return CCC_RESULT_ARGUMENT_ERROR; } diff --git a/source/flat_hash_map.c b/source/flat_hash_map.c index d1397ecf..c8e124cd 100644 --- a/source/flat_hash_map.c +++ b/source/flat_hash_map.c @@ -877,7 +877,7 @@ CCC_Result CCC_flat_hash_map_reserve(CCC_Flat_hash_map *const map, size_t const to_add, CCC_Allocator *const allocate) { - if (unlikely(!map || !to_add || !allocate)) + if (unlikely(!map || !to_add || !allocate || !to_add)) { return CCC_RESULT_ARGUMENT_ERROR; }