summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/heapsort.c
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-10-28 11:58:18 +0000
committerbapt <bapt@FreeBSD.org>2015-10-28 11:58:18 +0000
commitc21ffb8d6aca32c9584cfa072f309a5890a21aea (patch)
treec13556877cfa7b8f6941e8141a6801cf91e72840 /lib/libc/stdlib/heapsort.c
parentec14b01dd8898deebe0427357d842721add8e34c (diff)
parent39fb527bf90f6a5cb03d93bd49c310bbca016a45 (diff)
downloadFreeBSD-src-c21ffb8d6aca32c9584cfa072f309a5890a21aea.zip
FreeBSD-src-c21ffb8d6aca32c9584cfa072f309a5890a21aea.tar.gz
Merge from head
Sponsored by: Gandi.net
Diffstat (limited to 'lib/libc/stdlib/heapsort.c')
-rw-r--r--lib/libc/stdlib/heapsort.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/libc/stdlib/heapsort.c b/lib/libc/stdlib/heapsort.c
index 673a6a1..a7a4a26 100644
--- a/lib/libc/stdlib/heapsort.c
+++ b/lib/libc/stdlib/heapsort.c
@@ -138,6 +138,12 @@ typedef DECLARE_BLOCK(int, heapsort_block, const void *, const void *);
} \
}
+#ifdef I_AM_HEAPSORT_B
+int heapsort_b(void *, size_t, size_t, heapsort_block);
+#else
+int heapsort(void *, size_t, size_t,
+ int (*)(const void *, const void *));
+#endif
/*
* Heapsort -- Knuth, Vol. 3, page 145. Runs in O (N lg N), both average
* and worst. While heapsort is faster than the worst case of quicksort,
@@ -147,16 +153,11 @@ typedef DECLARE_BLOCK(int, heapsort_block, const void *, const void *);
*/
#ifdef I_AM_HEAPSORT_B
int
-heapsort_b(vbase, nmemb, size, compar)
- void *vbase;
- size_t nmemb, size;
- heapsort_block compar;
+heapsort_b(void *vbase, size_t nmemb, size_t size, heapsort_block compar)
#else
int
-heapsort(vbase, nmemb, size, compar)
- void *vbase;
- size_t nmemb, size;
- int (*compar)(const void *, const void *);
+heapsort(void *vbase, size_t nmemb, size_t size,
+ int (*compar)(const void *, const void *))
#endif
{
size_t cnt, i, j, l;
OpenPOWER on IntegriCloud