mirror of
https://github.com/json-c/json-c.git
synced 2026-03-21 05:59:07 +08:00
Merge pull request #420 from angelskieglazki/master
arraylist: Fixed names of parameters for callback function
This commit is contained in:
@@ -112,16 +112,16 @@ array_list_add(struct array_list *arr, void *data)
|
||||
}
|
||||
|
||||
void
|
||||
array_list_sort(struct array_list *arr, int(*sort_fn)(const void *, const void *))
|
||||
array_list_sort(struct array_list *arr, int(*compar)(const void *, const void *))
|
||||
{
|
||||
qsort(arr->array, arr->length, sizeof(arr->array[0]), sort_fn);
|
||||
qsort(arr->array, arr->length, sizeof(arr->array[0]), compar);
|
||||
}
|
||||
|
||||
void* array_list_bsearch(const void **key, struct array_list *arr,
|
||||
int (*sort_fn)(const void *, const void *))
|
||||
int (*compar)(const void *, const void *))
|
||||
{
|
||||
return bsearch(key, arr->array, arr->length, sizeof(arr->array[0]),
|
||||
sort_fn);
|
||||
compar);
|
||||
}
|
||||
|
||||
size_t
|
||||
|
||||
@@ -56,9 +56,9 @@ array_list_length(struct array_list *al);
|
||||
extern void
|
||||
array_list_sort(struct array_list *arr, int(*compar)(const void *, const void *));
|
||||
|
||||
extern void* array_list_bsearch(const void **key,
|
||||
struct array_list *arr,
|
||||
int (*sort_fn)(const void *, const void *));
|
||||
extern void*
|
||||
array_list_bsearch(const void **key, struct array_list *arr,
|
||||
int (*compar)(const void *, const void *));
|
||||
|
||||
extern int
|
||||
array_list_del_idx(struct array_list *arr, size_t idx, size_t count);
|
||||
|
||||
Reference in New Issue
Block a user