Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Sep 2014 08:12:09 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271251 - head/sys/libkern
Message-ID:  <201409080812.s888C9x6022439@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Mon Sep  8 08:12:09 2014
New Revision: 271251
URL: http://svnweb.freebsd.org/changeset/base/271251

Log:
  Use __DECONST to avoid compiler warnings (and thus build failures)
  with gcc on sparc64, mips, and powerpc after r271173.

Modified:
  head/sys/libkern/memmem.c

Modified: head/sys/libkern/memmem.c
==============================================================================
--- head/sys/libkern/memmem.c	Mon Sep  8 07:37:03 2014	(r271250)
+++ head/sys/libkern/memmem.c	Mon Sep  8 08:12:09 2014	(r271251)
@@ -52,9 +52,9 @@ memmem(const void *l, size_t l_len, cons
                 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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409080812.s888C9x6022439>