Fix a warning in bsearch(). Like index() etc, it de-qualifies its
arguments. Caveat Emptor. However, the only two consumer of it (cam) deals with it correctly and preserves the constness.
This commit is contained in:
parent
d76e231677
commit
531c9dd5f4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=83289
@ -74,7 +74,7 @@ bsearch(key, base0, nmemb, size, compar)
|
||||
p = base + (lim >> 1) * size;
|
||||
cmp = (*compar)(key, p);
|
||||
if (cmp == 0)
|
||||
return ((void *)p);
|
||||
return ((void *)(uintptr_t)p);
|
||||
if (cmp > 0) { /* key > p: move right */
|
||||
base = (const char *)p + size;
|
||||
lim--;
|
||||
|
Loading…
Reference in New Issue
Block a user