summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/radixsort.c
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2015-09-14 18:44:13 +0000
committerrodrigc <rodrigc@FreeBSD.org>2015-09-14 18:44:13 +0000
commit03b17210edf9302037068143643c1e06386de92e (patch)
tree9233dab12e187d6c5c5baddafab2900cdbf513ee /lib/libc/stdlib/radixsort.c
parent5ad1f2444d736f306932d8a69b8357c63297cc83 (diff)
downloadFreeBSD-src-03b17210edf9302037068143643c1e06386de92e.zip
FreeBSD-src-03b17210edf9302037068143643c1e06386de92e.tar.gz
Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
Diffstat (limited to 'lib/libc/stdlib/radixsort.c')
-rw-r--r--lib/libc/stdlib/radixsort.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/lib/libc/stdlib/radixsort.c b/lib/libc/stdlib/radixsort.c
index 8310e6d..205f776 100644
--- a/lib/libc/stdlib/radixsort.c
+++ b/lib/libc/stdlib/radixsort.c
@@ -88,10 +88,7 @@ static void r_sort_b(const u_char **, const u_char **, int, int,
}
int
-radixsort(a, n, tab, endch)
- const u_char **a, *tab;
- int n;
- u_int endch;
+radixsort(const u_char **a, int n, const u_char *tab, u_int endch)
{
const u_char *tr;
int c;
@@ -103,10 +100,7 @@ radixsort(a, n, tab, endch)
}
int
-sradixsort(a, n, tab, endch)
- const u_char **a, *tab;
- int n;
- u_int endch;
+sradixsort(const u_char **a, int n, const u_char *tab, u_int endch)
{
const u_char *tr, **ta;
int c;
@@ -131,11 +125,7 @@ sradixsort(a, n, tab, endch)
/* Unstable, in-place sort. */
static void
-r_sort_a(a, n, i, tr, endch)
- const u_char **a;
- int n, i;
- const u_char *tr;
- u_int endch;
+r_sort_a(const u_char **a, int n, int i, const u_char *tr, u_int endch)
{
static int count[256], nc, bmin;
int c;
@@ -233,11 +223,8 @@ r_sort_a(a, n, i, tr, endch)
/* Stable sort, requiring additional memory. */
static void
-r_sort_b(a, ta, n, i, tr, endch)
- const u_char **a, **ta;
- int n, i;
- const u_char *tr;
- u_int endch;
+r_sort_b(const u_char **a, const u_char **ta, int n, int i, const u_char *tr,
+ u_int endch)
{
static int count[256], nc, bmin;
int c;
@@ -304,12 +291,9 @@ r_sort_b(a, ta, n, i, tr, endch)
}
}
+/* insertion sort */
static inline void
-simplesort(a, n, b, tr, endch) /* insertion sort */
- const u_char **a;
- int n, b;
- const u_char *tr;
- u_int endch;
+simplesort(const u_char **a, int n, int b, const u_char *tr, u_int endch)
{
u_char ch;
const u_char **ak, **ai, *s, *t;
OpenPOWER on IntegriCloud