diff options
author | bapt <bapt@FreeBSD.org> | 2015-10-13 19:44:36 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-10-13 19:44:36 +0000 |
commit | c8d6d4a78596005d50c30c7ab4f623a601ef0b39 (patch) | |
tree | e5218cae2f48913719be46210d8d92085cb2511f /lib/libc/stdlib/heapsort.c | |
parent | 2a77c3b71d27973d4ffac086902715be69266202 (diff) | |
parent | 384c892651c52e57063356328dfcd28914bc4b15 (diff) | |
download | FreeBSD-src-c8d6d4a78596005d50c30c7ab4f623a601ef0b39.zip FreeBSD-src-c8d6d4a78596005d50c30c7ab4f623a601ef0b39.tar.gz |
Merge from head
Diffstat (limited to 'lib/libc/stdlib/heapsort.c')
-rw-r--r-- | lib/libc/stdlib/heapsort.c | 17 |
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; |