Use __DECONST to avoid compiler warnings (and thus build failures)
with gcc on sparc64, mips, and powerpc after r271173.
This commit is contained in:
parent
313ef9368f
commit
afa0a6efe0
@ -52,9 +52,9 @@ memmem(const void *l, size_t l_len, const void *s, size_t s_len)
|
||||
return memchr(l, (int)*cs, l_len);
|
||||
|
||||
/* the last position where its possible to find "s" in "l" */
|
||||
last = (char *)cl + l_len - s_len;
|
||||
last = __DECONST(char *, cl) + l_len - s_len;
|
||||
|
||||
for (cur = (char *)cl; cur <= last; cur++)
|
||||
for (cur = __DECONST(char *, cl); cur <= last; cur++)
|
||||
if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0)
|
||||
return cur;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user