aboutsummaryrefslogtreecommitdiff
path: root/sys/libkern/memmem.c
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2014-09-08 08:12:09 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2014-09-08 08:12:09 +0000
commitafa0a6efe0d373ec5ae51a0e597b860bbd01946d (patch)
treeded2e0094776114069c8742908aca7d053692957 /sys/libkern/memmem.c
parent313ef9368f0dbc2e02dbf1fdc438fcd6f98b00a1 (diff)
downloadsrc-afa0a6efe0d373ec5ae51a0e597b860bbd01946d.tar.gz
src-afa0a6efe0d373ec5ae51a0e597b860bbd01946d.zip
Use __DECONST to avoid compiler warnings (and thus build failures)
with gcc on sparc64, mips, and powerpc after r271173.
Notes
Notes: svn path=/head/; revision=271251
Diffstat (limited to 'sys/libkern/memmem.c')
-rw-r--r--sys/libkern/memmem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/libkern/memmem.c b/sys/libkern/memmem.c
index 9c6e0d162eb1..11c3d9eec508 100644
--- a/sys/libkern/memmem.c
+++ b/sys/libkern/memmem.c
@@ -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;