src/array_list.c

changeset 1622
27e7a4bf1a39
parent 1621
c52a4c67e29e
--- a/src/array_list.c	Thu Dec 18 12:26:25 2025 +0100
+++ b/src/array_list.c	Thu Dec 18 14:53:16 2025 +0100
@@ -131,15 +131,15 @@
     return 0;
 }
 
-int cx_array_insert_sorted_s_(
+int cx_array_insert_sorted_c_(
         const CxAllocator *allocator,
         CxArray *array,
         size_t elem_size,
         const void *sorted_data,
         size_t n,
-        bool allow_duplicates,
         cx_compare_func2 cmp_func,
-        void *context
+        void *context,
+        bool allow_duplicates
 ) {
     // assert pointers
     assert(allocator != NULL);
@@ -343,14 +343,14 @@
         const CxAllocator *allocator,
         CxArray *array,
         size_t elem_size,
-        cx_compare_func cmp_func,
         const void *sorted_data,
         size_t n,
+        cx_compare_func cmp_func,
         bool allow_duplicates
 ) {
     cx_compare_func_wrapper wrapper = {cmp_func};
-    return cx_array_insert_sorted_s_(allocator, array, elem_size, sorted_data,
-        n, allow_duplicates, cx_acmp_wrap, &wrapper);
+    return cx_array_insert_sorted_c_(allocator, array, elem_size, sorted_data,
+        n, cx_acmp_wrap, &wrapper, allow_duplicates);
 }
 
 #ifndef WITH_QSORT_R
@@ -664,15 +664,15 @@
         arl->data, list->collection.size, arl->capacity
     };
 
-    if (cx_array_insert_sorted_s_(
+    if (cx_array_insert_sorted_c_(
             list->collection.allocator,
             &wrap,
             list->collection.elem_size,
             sorted_data,
             n,
-            allow_duplicates,
             cx_list_compare_wrapper,
-            list
+            list,
+            allow_duplicates
     )) {
         // array list implementation is "all or nothing"
         return 0;  // LCOV_EXCL_LINE

mercurial