summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/heapsort.c
diff options
context:
space:
mode:
authorpat <>2005-03-30 18:51:49 +0000
committerpat <>2005-03-30 18:51:49 +0000
commit894b6ab0099e7d9ca2ad9acb75246cd0a4542167 (patch)
treef9fb8e9324f6cbdc10d72cab8b889d470252465a /src/lib/libc/stdlib/heapsort.c
parent162f8b042bf31ab94714a6f194e9836c08c085f5 (diff)
downloadopenbsd-894b6ab0099e7d9ca2ad9acb75246cd0a4542167.tar.gz
openbsd-894b6ab0099e7d9ca2ad9acb75246cd0a4542167.tar.bz2
openbsd-894b6ab0099e7d9ca2ad9acb75246cd0a4542167.zip
ansi + de-register
ok otto deraadt
Diffstat (limited to 'src/lib/libc/stdlib/heapsort.c')
-rw-r--r--src/lib/libc/stdlib/heapsort.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/libc/stdlib/heapsort.c b/src/lib/libc/stdlib/heapsort.c
index f4aeeef7a3..dcc0c8baad 100644
--- a/src/lib/libc/stdlib/heapsort.c
+++ b/src/lib/libc/stdlib/heapsort.c
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: heapsort.c,v 1.6 2003/09/08 16:24:05 deraadt Exp $"; 34static char *rcsid = "$OpenBSD: heapsort.c,v 1.7 2005/03/30 18:51:49 pat Exp $";
35#endif /* LIBC_SCCS and not lint */ 35#endif /* LIBC_SCCS and not lint */
36 36
37#include <sys/types.h> 37#include <sys/types.h>
@@ -134,13 +134,11 @@ static char *rcsid = "$OpenBSD: heapsort.c,v 1.6 2003/09/08 16:24:05 deraadt Exp
134 * only advantage over quicksort is that it requires little additional memory. 134 * only advantage over quicksort is that it requires little additional memory.
135 */ 135 */
136int 136int
137heapsort(vbase, nmemb, size, compar) 137heapsort(void *vbase, size_t nmemb, size_t size,
138 void *vbase; 138 int (*compar)(const void *, const void *))
139 size_t nmemb, size;
140 int (*compar)(const void *, const void *);
141{ 139{
142 register int cnt, i, j, l; 140 int cnt, i, j, l;
143 register char tmp, *tmp1, *tmp2; 141 char tmp, *tmp1, *tmp2;
144 char *base, *k, *p, *t; 142 char *base, *k, *p, *t;
145 143
146 if (nmemb <= 1) 144 if (nmemb <= 1)