Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions ccc/private/private_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -175,4 +167,4 @@ of memory in one step. */

/* NOLINTEND(readability-identifier-naming) */

#endif /* CCC_PRIVATE_BUF_H */
#endif /* CCC_PRIVATE_BUFFER_H */
2 changes: 1 addition & 1 deletion source/bitset.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion source/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion source/flat_double_ended_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion source/flat_hash_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down