270 |
270 |
271 static int cx_arl_compare( |
271 static int cx_arl_compare( |
272 struct cx_list_s const *list, |
272 struct cx_list_s const *list, |
273 struct cx_list_s const *other |
273 struct cx_list_s const *other |
274 ) { |
274 ) { |
275 |
275 if (list->size == other->size) { |
|
276 char const *left = ((cx_array_list const *) list)->data; |
|
277 char const *right = ((cx_array_list const *) other)->data; |
|
278 for (size_t i = 0; i < list->size; i++) { |
|
279 int d = list->cmpfunc(left, right); |
|
280 if (d != 0) { |
|
281 return d; |
|
282 } |
|
283 left += list->itemsize; |
|
284 right += other->itemsize; |
|
285 } |
|
286 return 0; |
|
287 } else { |
|
288 return list->size < other->size ? -1 : 1; |
|
289 } |
276 } |
290 } |
277 |
291 |
278 static void cx_arl_reverse(struct cx_list_s *list) { |
292 static void cx_arl_reverse(struct cx_list_s *list) { |
279 |
293 |
280 } |
294 } |