From 03b17210edf9302037068143643c1e06386de92e Mon Sep 17 00:00:00 2001 From: rodrigc Date: Mon, 14 Sep 2015 18:44:13 +0000 Subject: Use ANSI C prototypes. Eliminates gcc 4.9 warnings. --- lib/libc/stdlib/heapsort.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'lib/libc/stdlib/heapsort.c') diff --git a/lib/libc/stdlib/heapsort.c b/lib/libc/stdlib/heapsort.c index 673a6a1..16c1bfe 100644 --- a/lib/libc/stdlib/heapsort.c +++ b/lib/libc/stdlib/heapsort.c @@ -147,16 +147,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; -- cgit v1.1 From 08c0b3cae7201b8a0e94863e7c07d51f4ececd04 Mon Sep 17 00:00:00 2001 From: rodrigc Date: Sun, 20 Sep 2015 03:53:08 +0000 Subject: Add declarations to eliminate -Wmissing-prototypes warnings. --- lib/libc/stdlib/heapsort.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/libc/stdlib/heapsort.c') diff --git a/lib/libc/stdlib/heapsort.c b/lib/libc/stdlib/heapsort.c index 16c1bfe..3f4a894 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 *vbase, size_t nmemb, size_t size, heapsort_block compar); +#else +int heapsort(void *vbase, size_t nmemb, size_t size, + int (*compar)(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, -- cgit v1.1 From 1737b90d795e125dbcc28ae33d27ed4fe8c5e33d Mon Sep 17 00:00:00 2001 From: rodrigc Date: Sun, 20 Sep 2015 20:15:44 +0000 Subject: Remove names from prototypes --- lib/libc/stdlib/heapsort.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libc/stdlib/heapsort.c') diff --git a/lib/libc/stdlib/heapsort.c b/lib/libc/stdlib/heapsort.c index 3f4a894..a7a4a26 100644 --- a/lib/libc/stdlib/heapsort.c +++ b/lib/libc/stdlib/heapsort.c @@ -139,10 +139,10 @@ typedef DECLARE_BLOCK(int, heapsort_block, const void *, const void *); } #ifdef I_AM_HEAPSORT_B -int heapsort_b(void *vbase, size_t nmemb, size_t size, heapsort_block compar); +int heapsort_b(void *, size_t, size_t, heapsort_block); #else -int heapsort(void *vbase, size_t nmemb, size_t size, - int (*compar)(const void *, const void *)); +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 -- cgit v1.1