# HG changeset patch # User Mike Becker # Date 1708287148 -3600 # Node ID 04c53b3c83783d807a951aba3eb3f39a53afad1f # Parent 5c926801f052ce849b4fd5fdbff00e3a1083c62b capitalize cx_array_declare() diff -r 5c926801f052 -r 04c53b3c8378 CHANGELOG --- a/CHANGELOG Sun Feb 18 13:38:42 2024 +0100 +++ b/CHANGELOG Sun Feb 18 21:12:28 2024 +0100 @@ -2,8 +2,7 @@ ------------------------ * adds tree.h * adds cx_array_default_reallocator - * adds cx_array_add() - * adds cx_array_declare() and cx_array_simple_*() convenience macros + * adds several new cx_array_*() functions * adds cx_linked_list_find_node() * adds cxListFindRemove() * adds cxBufferReset() diff -r 5c926801f052 -r 04c53b3c8378 docs/src/features.md --- a/docs/src/features.md Sun Feb 18 13:38:42 2024 +0100 +++ b/docs/src/features.md Sun Feb 18 21:12:28 2024 +0100 @@ -318,7 +318,7 @@ If you just want to add one single element to an existing array, you can use the macro `cx_array_add()`. In that case, since the element is added to the end of the array, the `capacity` argument is mandatory. -You can use `cx_array_declare()` to declare the necessary fields within a structure and then use the +You can use `CX_ARRAY_DECLARE()` to declare the necessary fields within a structure and then use the `cx_array_simple_*()` convenience macros to reduce code overhead. ## Map diff -r 5c926801f052 -r 04c53b3c8378 src/cx/array_list.h --- a/src/cx/array_list.h Sun Feb 18 13:38:42 2024 +0100 +++ b/src/cx/array_list.h Sun Feb 18 21:12:28 2024 +0100 @@ -54,14 +54,15 @@ * * @see cx_array_simple_add() * @see cx_array_simple_copy() + * @see cx_array_initialize() */ -#define cx_array_declare(type, name) \ +#define CX_ARRAY_DECLARE(type, name) \ type * name; \ size_t name##_size; \ size_t name##_capacity; /** - * Initializes an array declared with cx_array_declare(). + * Initializes an array declared with CX_ARRAY_DECLARE(). * * The memory for the array is allocated with stdlib malloc(). * @param array the array diff -r 5c926801f052 -r 04c53b3c8378 src/tree.c --- a/src/tree.c Sun Feb 18 13:38:42 2024 +0100 +++ b/src/tree.c Sun Feb 18 21:12:28 2024 +0100 @@ -109,7 +109,7 @@ } // create a working stack - cx_array_declare(void const*, work); + CX_ARRAY_DECLARE(void const*, work); cx_array_initialize(work, 32); // add the children of root to the working stack diff -r 5c926801f052 -r 04c53b3c8378 tests/test_list.c --- a/tests/test_list.c Sun Feb 18 13:38:42 2024 +0100 +++ b/tests/test_list.c Sun Feb 18 21:12:28 2024 +0100 @@ -41,7 +41,7 @@ int *stackarray = stackspace; size_t stackarray_size = 3; size_t stackarray_capacity = 5; - cx_array_declare(int, heaparray); + CX_ARRAY_DECLARE(int, heaparray); heaparray = calloc(5, sizeof(int)); heaparray[0] = 2; heaparray[1] = 3;