]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Change the return type of the replacement function for rawmemchr
authorFlorian Krohm <florian@eich-krohm.de>
Wed, 22 Oct 2014 12:06:22 +0000 (12:06 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Wed, 22 Oct 2014 12:06:22 +0000 (12:06 +0000)
to match that of glibc's rawmemchr.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14651

shared/vg_replace_strmem.c

index 11d72b949b8c69f00b92763eab1a430b92596453..78923ebe28bf8c34ceb00ef67d2fedcdfa66ce38 100644 (file)
@@ -1229,15 +1229,15 @@ static inline void my_exit ( int x )
 
 /* Find the first occurrence of C in S.  */
 #define GLIBC232_RAWMEMCHR(soname, fnname) \
-   char* VG_REPLACE_FUNCTION_EZU(20260,soname,fnname) \
-            (const char* s, int c_in); \
-   char* VG_REPLACE_FUNCTION_EZU(20260,soname,fnname) \
-            (const char* s, int c_in) \
+   void* VG_REPLACE_FUNCTION_EZU(20260,soname,fnname) \
+            (const void* s, int c_in); \
+   void* VG_REPLACE_FUNCTION_EZU(20260,soname,fnname) \
+            (const void* s, int c_in) \
    { \
-      UChar  c        = (UChar) c_in; \
-      UChar* char_ptr = (UChar *)s; \
+      UChar c = (UChar) c_in; \
+      const UChar* char_ptr = s; \
       while (1) { \
-        if (*char_ptr == c) return (HChar *)char_ptr;   \
+         if (*char_ptr == c) return (void *)char_ptr;  \
          char_ptr++; \
       } \
    }