summaryrefslogtreecommitdiff
path: root/libc/stdlib/qsort.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib/qsort.c')
-rw-r--r--libc/stdlib/qsort.c11
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;
}