Fix some casts that removed const-ness as pointed out by
GCC's -Wcast-qual.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13138 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_libcbase.c b/coregrind/m_libcbase.c
index 3567882..59396d7 100644
--- a/coregrind/m_libcbase.c
+++ b/coregrind/m_libcbase.c
@@ -303,8 +303,8 @@
Int VG_(strcmp) ( const HChar* s1, const HChar* s2 )
{
while (True) {
- if (*(UChar*)s1 < *(UChar*)s2) return -1;
- if (*(UChar*)s1 > *(UChar*)s2) return 1;
+ if (*(const UChar*)s1 < *(const UChar*)s2) return -1;
+ if (*(const UChar*)s1 > *(const UChar*)s2) return 1;
/* *s1 == *s2 */
if (*s1 == 0) return 0;
@@ -333,8 +333,8 @@
SizeT n = 0;
while (True) {
if (n >= nmax) return 0;
- if (*(UChar*)s1 < *(UChar*)s2) return -1;
- if (*(UChar*)s1 > *(UChar*)s2) return 1;
+ if (*(const UChar*)s1 < *(const UChar*)s2) return -1;
+ if (*(const UChar*)s1 > *(const UChar*)s2) return 1;
/* *s1 == *s2 */
if (*s1 == 0) return 0;
@@ -569,12 +569,12 @@
return dest;
if (dest < src) {
for (i = 0; i < sz; i++) {
- ((UChar*)dest)[i] = ((UChar*)src)[i];
+ ((UChar*)dest)[i] = ((const UChar*)src)[i];
}
}
else if (dest > src) {
for (i = 0; i < sz; i++) {
- ((UChar*)dest)[sz-i-1] = ((UChar*)src)[sz-i-1];
+ ((UChar*)dest)[sz-i-1] = ((const UChar*)src)[sz-i-1];
}
}
return dest;