Skip to content

Commit 63e42e1

Browse files
committed
fixup! spell out interface of qsort_r
Implementations of qsort_r use different APIs. For example the arguments on Mac OS are switched.
1 parent c82a185 commit 63e42e1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/hsort.h

+12-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,19 @@
1313
/* In-place, iterative heapsort with an interface matching glibc's qsort_r. This
1414
* is preferred over standard library implementations because they generally
1515
* make no guarantee about being fast for malicious inputs.
16-
* Remeber that heapsort is unstable.
16+
* Remember that heapsort is unstable.
1717
*
18-
* See the qsort_r manpage for a description of the interface.
18+
* In/Out: ptr: pointer to the array to sort. The contents of the array are
19+
* sorted in ascending order according to the comparison function.
20+
* In: count: number of elements in the array.
21+
* size: size in bytes of each element.
22+
* cmp: pointer to a comparison function that is called with two
23+
* arguments that point to the objects being compared. The cmp_data
24+
* argument of secp256k1_hsort is passed as third argument. The
25+
* function must return an integer less than, equal to, or greater
26+
* than zero if the first argument is considered to be respectively
27+
* less than, equal to, or greater than the second.
28+
* cmp_data: pointer passed as third argument to cmp.
1929
*/
2030
static void secp256k1_hsort(void *ptr, size_t count, size_t size,
2131
int (*cmp)(const void *, const void *, void *),

0 commit comments

Comments
 (0)