Use the __DECONST macro rather than hand rolling the same thing.
Sponsored by: DARPA, AFRL
This commit is contained in:
parent
6bd000838c
commit
052260fe0a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273614
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user