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
@ -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…
x
Reference in New Issue
Block a user