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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271251
@ -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);
|
return memchr(l, (int)*cs, l_len);
|
||||||
|
|
||||||
/* the last position where its possible to find "s" in "l" */
|
/* 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)
|
if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0)
|
||||||
return cur;
|
return cur;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user