|
From: <sv...@va...> - 2014-10-21 17:15:23
|
Author: florian
Date: Tue Oct 21 18:15:14 2014
New Revision: 14647
Log:
Rewritten to avoid cast that drops const qualification.
Modified:
trunk/helgrind/hg_intercepts.c
trunk/shared/vg_replace_strmem.c
Modified: trunk/helgrind/hg_intercepts.c
==============================================================================
--- trunk/helgrind/hg_intercepts.c (original)
+++ trunk/helgrind/hg_intercepts.c Tue Oct 21 18:15:14 2014
@@ -136,7 +136,7 @@
#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, \
Modified: trunk/shared/vg_replace_strmem.c
==============================================================================
--- trunk/shared/vg_replace_strmem.c (original)
+++ trunk/shared/vg_replace_strmem.c Tue Oct 21 18:15:14 2014
@@ -1327,8 +1327,6 @@
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 @@
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++; \
} \
|