summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2014-10-24 23:25:44 +0000
committerbrooks <brooks@FreeBSD.org>2014-10-24 23:25:44 +0000
commit05042d291ff8e2b64b6214f0cd57939e7dd4ee8e (patch)
treeed67c5db2be2d80fd56406149aa6869b8a920a10 /lib
parent4408ff403c8e3d19dcdb58dff1f63a9dab0dbb36 (diff)
downloadFreeBSD-src-05042d291ff8e2b64b6214f0cd57939e7dd4ee8e.zip
FreeBSD-src-05042d291ff8e2b64b6214f0cd57939e7dd4ee8e.tar.gz
Use the __DECONST macro rather than hand rolling the same thing.
Sponsored by: DARPA, AFRL
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/lsearch.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/libc/stdlib/lsearch.c b/lib/libc/stdlib/lsearch.c
index e4d1dd5..9e9cdba 100644
--- a/lib/libc/stdlib/lsearch.c
+++ b/lib/libc/stdlib/lsearch.c
@@ -39,11 +39,7 @@ lwork(const void *key, const void *base, size_t *nelp, size_t width,
{
uint8_t *ep, *endp;
- /*
- * Cast to an integer value first to avoid the warning for removing
- * 'const' via a cast.
- */
- ep = (uint8_t *)(uintptr_t)base;
+ ep = __DECONST(uint8_t *, base);
for (endp = (uint8_t *)(ep + width * *nelp); ep < endp; ep += width) {
if (compar(key, ep) == 0)
return (ep);
OpenPOWER on IntegriCloud