Author: brooks
Date: Fri Oct 24 23:25:44 2014
New Revision: 273614
URL: https://svnweb.freebsd.org/changeset/base/273614

Log:
  Use the __DECONST macro rather than hand rolling the same thing.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/lib/libc/stdlib/lsearch.c

Modified: head/lib/libc/stdlib/lsearch.c
==============================================================================
--- head/lib/libc/stdlib/lsearch.c      Fri Oct 24 23:25:11 2014        
(r273613)
+++ head/lib/libc/stdlib/lsearch.c      Fri Oct 24 23:25:44 2014        
(r273614)
@@ -39,11 +39,7 @@ lwork(const void *key, const void *base,
 {
        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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to