]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Rewritten to avoid cast that drops const qualification.
authorFlorian Krohm <florian@eich-krohm.de>
Tue, 21 Oct 2014 17:15:14 +0000 (17:15 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Tue, 21 Oct 2014 17:15:14 +0000 (17:15 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14647

helgrind/hg_intercepts.c
shared/vg_replace_strmem.c

index fb9963a4760cc6fa8fc74ba5430bc66cfc542d5d..f109bf3e1f081d552f6e2ea263eaf3e19f3682ba 100644 (file)
 
 #define DO_PthAPIerror(_fnnameF, _errF)                  \
    do {                                                  \
-      char* _fnname = (char*)(_fnnameF);                 \
+      const char* _fnname = (_fnnameF);                  \
       long  _err    = (long)(int)(_errF);                \
       const char* _errstr = lame_strerror(_err);         \
       DO_CREQ_v_WWW(_VG_USERREQ__HG_PTH_API_ERROR,       \
index addf1fae661860bff0e6e821ac8a60c68ba3f9aa..11d72b949b8c69f00b92763eab1a430b92596453 100644 (file)
@@ -1327,8 +1327,6 @@ static inline void my_exit ( int x )
    void* VG_REPLACE_FUNCTION_EZU(20290,soname,fnname) \
             ( void *dst, const void *src, SizeT len ) \
    { \
-      register HChar *d; \
-      register HChar *s; \
       SizeT len_saved = len; \
       \
       if (len == 0) \
@@ -1338,14 +1336,14 @@ static inline void my_exit ( int x )
          RECORD_OVERLAP_ERROR("mempcpy", dst, src, len); \
       \
       if ( dst > src ) { \
-         d = (char *)dst + len - 1; \
-         s = (char *)src + len - 1; \
+         register HChar *d = (char *)dst + len - 1; \
+         register const HChar *s = (const char *)src + len - 1; \
          while ( len-- ) { \
             *d-- = *s--; \
          } \
       } else if ( dst < src ) { \
-         d = (char *)dst; \
-         s = (char *)src; \
+         register HChar *d = dst; \
+         register const HChar *s = src; \
          while ( len-- ) { \
             *d++ = *s++; \
          } \