241 size_t size, |
241 size_t size, |
242 size_t elem_size, |
242 size_t elem_size, |
243 void const *elem, |
243 void const *elem, |
244 cx_compare_func cmp_func |
244 cx_compare_func cmp_func |
245 ) { |
245 ) { |
|
246 // special case: empty array |
|
247 if (size == 0) return 0; |
|
248 |
246 // declare a variable that will contain the compare results |
249 // declare a variable that will contain the compare results |
247 int result; |
250 int result; |
248 |
251 |
249 // cast the array pointer to something we can use offsets with |
252 // cast the array pointer to something we can use offsets with |
250 char const *array = arr; |
253 char const *array = arr; |