summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2017-01-04 15:20:31 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2017-01-04 15:20:31 +0000
commit08274384cec8b62291e3e24751474baca5d50fa2 (patch)
tree8a72a0e4801402c417660a89a9db233615128a4c /lib/libc/stdlib
parente478dc5be4bc6c4eeb41d7fb8bb6de9d5bb02c4b (diff)
Remove unnecessary casts of 'a' to char * since 'a' is already char *.
This is a remnant from the original 4.4BSD code that had 'a' as void * in the function args. No binary change. OK bluhm@
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/qsort.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c
index 1d9b1e91221..f16f9d0ebf8 100644
--- a/lib/libc/stdlib/qsort.c
+++ b/lib/libc/stdlib/qsort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qsort.c,v 1.13 2015/09/13 08:31:47 guenther Exp $ */
+/* $OpenBSD: qsort.c,v 1.14 2017/01/04 15:20:30 millert Exp $ */
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -90,16 +90,16 @@ qsort(void *aa, size_t n, size_t es, int (*cmp)(const void *, const void *))
loop: SWAPINIT(a, es);
if (n < 7) {
- for (pm = (char *)a + es; pm < (char *) a + n * es; pm += es)
- for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
+ for (pm = a + es; pm < a + n * es; pm += es)
+ for (pl = pm; pl > a && cmp(pl - es, pl) > 0;
pl -= es)
swap(pl, pl - es);
return;
}
- pm = (char *)a + (n / 2) * es;
+ pm = a + (n / 2) * es;
if (n > 7) {
- pl = (char *)a;
- pn = (char *)a + (n - 1) * es;
+ pl = a;
+ pn = a + (n - 1) * es;
if (n > 40) {
d = (n / 8) * es;
pl = med3(pl, pl + d, pl + 2 * d, cmp);
@@ -109,9 +109,9 @@ loop: SWAPINIT(a, es);
pm = med3(pl, pm, pn, cmp);
}
swap(a, pm);
- pa = pb = (char *)a + es;
+ pa = pb = a + es;
- pc = pd = (char *)a + (n - 1) * es;
+ pc = pd = a + (n - 1) * es;
for (;;) {
while (pb <= pc && (cmp_result = cmp(pb, a)) <= 0) {
if (cmp_result == 0) {
@@ -134,8 +134,8 @@ loop: SWAPINIT(a, es);
pc -= es;
}
- pn = (char *)a + n * es;
- r = min(pa - (char *)a, pb - pa);
+ pn = a + n * es;
+ r = min(pa - a, pb - pa);
vecswap(a, pb - r, r);
r = min(pd - pc, pn - pd - es);
vecswap(pb, pn - r, r);