src/cx/array_list.h

changeset 891
49d8cff6f0ee
parent 890
54565fd74e74
--- a/src/cx/array_list.h	Sat Sep 28 15:47:28 2024 +0200
+++ b/src/cx/array_list.h	Sat Sep 28 15:55:14 2024 +0200
@@ -159,6 +159,7 @@
  * if reallocation shall not happen
  * @return zero on success, non-zero error code on failure
  */
+__attribute__((__nonnull__(1, 2, 5)))
 enum cx_array_result cx_array_copy(
         void **target,
         size_t *size,
@@ -168,7 +169,7 @@
         size_t elem_size,
         size_t elem_count,
         struct cx_array_reallocator_s *reallocator
-) __attribute__((__nonnull__(1, 2, 5)));
+);
 
 /**
  * Convenience macro that uses cx_array_copy() with a default layout and the default reallocator.
@@ -236,6 +237,7 @@
  * @param reallocator the array reallocator to use
  * @return zero on success, non-zero error code on failure
  */
+__attribute__((__nonnull__))
 enum cx_array_result cx_array_insert_sorted(
         void **target,
         size_t *size,
@@ -245,7 +247,7 @@
         size_t elem_size,
         size_t elem_count,
         struct cx_array_reallocator_s *reallocator
-) __attribute__((__nonnull__));
+);
 
 /**
  * Inserts an element into a sorted array.
@@ -315,13 +317,14 @@
  * @param cmp_func the compare function
  * @return the index of the largest lower bound, or \p size
  */
+__attribute__((__nonnull__))
 size_t cx_array_binary_search_inf(
         const void *arr,
         size_t size,
         size_t elem_size,
         const void *elem,
         cx_compare_func cmp_func
-) __attribute__((__nonnull__));
+);
 
 /**
  * Searches an item in a sorted array.
@@ -402,12 +405,13 @@
  * @param idx1 index of first element
  * @param idx2 index of second element
  */
+__attribute__((__nonnull__))
 void cx_array_swap(
         void *arr,
         size_t elem_size,
         size_t idx1,
         size_t idx2
-) __attribute__((__nonnull__));
+);
 
 /**
  * Allocates an array list for storing elements with \p elem_size bytes each.

mercurial