diff options
author | millert <> | 2017-01-04 15:20:30 +0000 |
---|---|---|
committer | millert <> | 2017-01-04 15:20:30 +0000 |
commit | 998a53b51abdb1c283caafeba6e9b6517e13c7f0 (patch) | |
tree | 78dfb080ee37510d3cc7c2620ccb76e0d6083906 /src | |
parent | 1dfa989674c3d00414647d647fa08ad8146a4cad (diff) | |
download | openbsd-998a53b51abdb1c283caafeba6e9b6517e13c7f0.tar.gz openbsd-998a53b51abdb1c283caafeba6e9b6517e13c7f0.tar.bz2 openbsd-998a53b51abdb1c283caafeba6e9b6517e13c7f0.zip |
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 'src')
-rw-r--r-- | src/lib/libc/stdlib/qsort.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/libc/stdlib/qsort.c b/src/lib/libc/stdlib/qsort.c index 1d9b1e9122..f16f9d0ebf 100644 --- a/src/lib/libc/stdlib/qsort.c +++ b/src/lib/libc/stdlib/qsort.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: qsort.c,v 1.13 2015/09/13 08:31:47 guenther Exp $ */ | 1 | /* $OpenBSD: qsort.c,v 1.14 2017/01/04 15:20:30 millert Exp $ */ |
2 | /*- | 2 | /*- |
3 | * Copyright (c) 1992, 1993 | 3 | * Copyright (c) 1992, 1993 |
4 | * The Regents of the University of California. All rights reserved. | 4 | * 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 *)) | |||
90 | 90 | ||
91 | loop: SWAPINIT(a, es); | 91 | loop: SWAPINIT(a, es); |
92 | if (n < 7) { | 92 | if (n < 7) { |
93 | for (pm = (char *)a + es; pm < (char *) a + n * es; pm += es) | 93 | for (pm = a + es; pm < a + n * es; pm += es) |
94 | for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; | 94 | for (pl = pm; pl > a && cmp(pl - es, pl) > 0; |
95 | pl -= es) | 95 | pl -= es) |
96 | swap(pl, pl - es); | 96 | swap(pl, pl - es); |
97 | return; | 97 | return; |
98 | } | 98 | } |
99 | pm = (char *)a + (n / 2) * es; | 99 | pm = a + (n / 2) * es; |
100 | if (n > 7) { | 100 | if (n > 7) { |
101 | pl = (char *)a; | 101 | pl = a; |
102 | pn = (char *)a + (n - 1) * es; | 102 | pn = a + (n - 1) * es; |
103 | if (n > 40) { | 103 | if (n > 40) { |
104 | d = (n / 8) * es; | 104 | d = (n / 8) * es; |
105 | pl = med3(pl, pl + d, pl + 2 * d, cmp); | 105 | pl = med3(pl, pl + d, pl + 2 * d, cmp); |
@@ -109,9 +109,9 @@ loop: SWAPINIT(a, es); | |||
109 | pm = med3(pl, pm, pn, cmp); | 109 | pm = med3(pl, pm, pn, cmp); |
110 | } | 110 | } |
111 | swap(a, pm); | 111 | swap(a, pm); |
112 | pa = pb = (char *)a + es; | 112 | pa = pb = a + es; |
113 | 113 | ||
114 | pc = pd = (char *)a + (n - 1) * es; | 114 | pc = pd = a + (n - 1) * es; |
115 | for (;;) { | 115 | for (;;) { |
116 | while (pb <= pc && (cmp_result = cmp(pb, a)) <= 0) { | 116 | while (pb <= pc && (cmp_result = cmp(pb, a)) <= 0) { |
117 | if (cmp_result == 0) { | 117 | if (cmp_result == 0) { |
@@ -134,8 +134,8 @@ loop: SWAPINIT(a, es); | |||
134 | pc -= es; | 134 | pc -= es; |
135 | } | 135 | } |
136 | 136 | ||
137 | pn = (char *)a + n * es; | 137 | pn = a + n * es; |
138 | r = min(pa - (char *)a, pb - pa); | 138 | r = min(pa - a, pb - pa); |
139 | vecswap(a, pb - r, r); | 139 | vecswap(a, pb - r, r); |
140 | r = min(pd - pc, pn - pd - es); | 140 | r = min(pd - pc, pn - pd - es); |
141 | vecswap(pb, pn - r, r); | 141 | vecswap(pb, pn - r, r); |