diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-07-06 00:20:50 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-07-06 00:20:50 +0000 |
commit | a67c6273255c0357bf1e14ea35005b47c9a94e6c (patch) | |
tree | 34bce2531223bbc738b0c4e13fa25aeca2d1d79e /libc/stdlib/qsort.c | |
parent | 42ee079162ef0aacb93181dcc0df86c9d33f75c5 (diff) |
Lots and lots of cleanups.
-Erik
Diffstat (limited to 'libc/stdlib/qsort.c')
-rw-r--r-- | libc/stdlib/qsort.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libc/stdlib/qsort.c b/libc/stdlib/qsort.c index cee53c398..b45716c83 100644 --- a/libc/stdlib/qsort.c +++ b/libc/stdlib/qsort.c @@ -14,7 +14,7 @@ char *_qbuf = 0; /* pointer to storage for qsort() */ #define PIVOT ((i+j)>>1) #define moveitem(dst,src,size) if(dst != src) memcpy(dst, src, size) -static +static void _wqsort(base, lo, hi, cmp) register int *base; register int lo; @@ -56,7 +56,7 @@ register int (*cmp) (); } } -static +static void _lqsort(base, lo, hi, cmp) register long *base; register int lo; @@ -98,7 +98,7 @@ register int (*cmp) (); } } -static +static void _nqsort(base, lo, hi, size, cmp) register char *base; register int lo; @@ -141,7 +141,7 @@ register int (*cmp) (); } } -qsort(base, num, size, cmp) +extern int qsort(base, num, size, cmp) char *base; int num; int size; @@ -152,7 +152,7 @@ int (*cmp) (); if (_qbuf == 0) { if (size > sizeof(_qtemp))/* records too large! */ - return; + return 1; _qbuf = _qtemp; } if (size == 2) @@ -163,4 +163,5 @@ int (*cmp) (); _nqsort(base, 0, num - 1, size, cmp); if (_qbuf == _qtemp) _qbuf = 0; + return 0; } |