src/cx/array_list.h

changeset 1625
89a2d53308e4
parent 1623
592aae491264
--- a/src/cx/array_list.h	Thu Dec 18 16:44:11 2025 +0100
+++ b/src/cx/array_list.h	Thu Dec 18 18:07:29 2025 +0100
@@ -280,12 +280,12 @@
  *
  * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation
  * @param array the name of the array where the element shall be added
- * @param element (@c void*) a pointer to the element that shall be added
+ * @param element the element that shall be added
  * @retval zero success
  * @retval non-zero a re-allocation was necessary but failed
  */
 #define cx_array_add_a(allocator, array, element) \
-        cx_array_insert_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (array).size, element, 1)
+        cx_array_insert_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (array).size, (void*)&(element), 1)
 
 /**
  * Appends an element to an array.
@@ -308,12 +308,12 @@
  * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation
  * @param array the name of the array where the element shall be inserted
  * @param index (@c size_t) the index where to insert the @p element
- * @param element (@c void*) a pointer to the element that shall be inserted
+ * @param element the element that shall be inserted
  * @retval zero success
  * @retval non-zero a re-allocation was necessary but failed
  */
 #define cx_array_insert_a(allocator, array, index, element) \
-        cx_array_insert_(allocator, (CxArray*)&(array), sizeof((array).data[0]), index, element, 1)
+        cx_array_insert_(allocator, (CxArray*)&(array), sizeof((array).data[0]), index, (void*)&(element), 1)
 
 /**
  * Inserts an element into an array.
@@ -418,13 +418,13 @@
  *
  * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation
  * @param array the name of the array where the elements shall be inserted
- * @param element (@c void*) a pointer to element that shall be inserted
+ * @param element the element that shall be inserted
  * @param cmp_func (@c cx_compare_func) the compare function that establishes the order
  * @retval zero success
  * @retval non-zero a re-allocation was necessary but failed
  */
 #define cx_array_insert_sorted_a(allocator, array, element, cmp_func) \
-        cx_array_insert_sorted_(allocator, (CxArray*)&(array), sizeof((array).data[0]), element, 1, cmp_func, true)
+        cx_array_insert_sorted_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (void*)&(element), 1, cmp_func, true)
 
 /**
  * Inserts an element into a sorted array.
@@ -434,7 +434,7 @@
  * @attention if the array is not sorted according to the specified @p cmp_func, the behavior is undefined.
  *
  * @param array the name of the array where the elements shall be inserted
- * @param element (@c void*) a pointer to element that shall be inserted
+ * @param element the element that shall be inserted
  * @param cmp_func (@c cx_compare_func) the compare function that establishes the order
  * @retval zero success
  * @retval non-zero a re-allocation was necessary but failed
@@ -486,13 +486,13 @@
  *
  * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation
  * @param array the name of the array where the elements shall be inserted
- * @param element (@c void*) a pointer to element that shall be inserted
+ * @param element the element that shall be inserted
  * @param cmp_func (@c cx_compare_func) the compare function that establishes the order
  * @retval zero success
  * @retval non-zero a re-allocation was necessary but failed
  */
 #define cx_array_insert_unique_a(allocator, array, element, cmp_func) \
-        cx_array_insert_sorted_(allocator, (CxArray*)&(array), sizeof((array).data[0]), element, 1, cmp_func, false)
+        cx_array_insert_sorted_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (void*)&(element), 1, cmp_func, false)
 
 /**
  * Inserts an element into a sorted array if it is not already contained.
@@ -502,7 +502,7 @@
  * @attention if the array is not sorted according to the specified @p cmp_func, the behavior is undefined.
  *
  * @param array the name of the array where the elements shall be inserted
- * @param element (@c void*) a pointer to element that shall be inserted
+ * @param element the element that shall be inserted
  * @param cmp_func (@c cx_compare_func) the compare function that establishes the order
  * @retval zero success
  * @retval non-zero a re-allocation was necessary but failed
@@ -575,14 +575,14 @@
  *
  * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation
  * @param array the name of the array where the elements shall be inserted
- * @param element (@c void*) a pointer to element that shall be inserted
+ * @param element the element that shall be inserted
  * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order
  * @param context (@c void*) additional context for the compare function
  * @retval zero success
  * @retval non-zero a re-allocation was necessary but failed
  */
 #define cx_array_insert_sorted_ca(allocator, array, element, cmp_func) \
-        cx_array_insert_sorted_c_(allocator, (CxArray*)&(array), sizeof((array).data[0]), element, 1, cmp_func, context, true)
+        cx_array_insert_sorted_c_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (void*)&(element), 1, cmp_func, context, true)
 
 /**
  * Inserts an element into a sorted array.
@@ -592,7 +592,7 @@
  * @attention if the array is not sorted according to the specified @p cmp_func, the behavior is undefined.
  *
  * @param array the name of the array where the elements shall be inserted
- * @param element (@c void*) a pointer to element that shall be inserted
+ * @param element the element that shall be inserted
  * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order
  * @param context (@c void*) additional context for the compare function
  * @retval zero success
@@ -647,14 +647,14 @@
  *
  * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation
  * @param array the name of the array where the elements shall be inserted
- * @param element (@c void*) a pointer to element that shall be inserted
+ * @param element the element that shall be inserted
  * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order
  * @param context (@c void*) additional context for the compare function
  * @retval zero success
  * @retval non-zero a re-allocation was necessary but failed
  */
 #define cx_array_insert_unique_ca(allocator, array, element, cmp_func, context) \
-        cx_array_insert_sorted_c_(allocator, (CxArray*)&(array), sizeof((array).data[0]), element, 1, cmp_func, context, false)
+        cx_array_insert_sorted_c_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (void*)&(element), 1, cmp_func, context, false)
 
 /**
  * Inserts an element into a sorted array if it is not already contained.
@@ -664,7 +664,7 @@
  * @attention if the array is not sorted according to the specified @p cmp_func, the behavior is undefined.
  *
  * @param array the name of the array where the elements shall be inserted
- * @param element (@c void*) a pointer to element that shall be inserted
+ * @param element the element that shall be inserted
  * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order
  * @param context (@c void*) additional context for the compare function
  * @retval zero success

mercurial