[Lldb-commits] [lldb] r181474 - Quiet g++-4.7 warnings about const issues and fix the scope of the "if (IsValid())".
Greg Clayton
gclayton at apple.com
Wed May 8 14:35:24 PDT 2013
Author: gclayton
Date: Wed May 8 16:35:24 2013
New Revision: 181474
URL: http://llvm.org/viewvc/llvm-project?rev=181474&view=rev
Log:
Quiet g++-4.7 warnings about const issues and fix the scope of the "if (IsValid())".
Modified:
lldb/trunk/include/lldb/Core/Value.h
Modified: lldb/trunk/include/lldb/Core/Value.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Value.h?rev=181474&r1=181473&r2=181474&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Value.h (original)
+++ lldb/trunk/include/lldb/Core/Value.h Wed May 8 16:35:24 2013
@@ -100,15 +100,17 @@ public:
{
Scalar scalar;
if (IsValid())
- if (length == 1) scalar = *(uint8_t *)bytes;
- if (length == 2) scalar = *(uint16_t *)bytes;
- if (length == 4) scalar = *(uint32_t *)bytes;
- if (length == 8) scalar = *(uint64_t *)bytes;
+ {
+ if (length == 1) scalar = *(const uint8_t *)bytes;
+ else if (length == 2) scalar = *(const uint16_t *)bytes;
+ else if (length == 4) scalar = *(const uint32_t *)bytes;
+ else if (length == 8) scalar = *(const uint64_t *)bytes;
#if defined (ENABLE_128_BIT_SUPPORT)
- if (length >= 16) scalar = *(__uint128_t *)bytes;
+ else if (length >= 16) scalar = *(const __uint128_t *)bytes;
#else
- if (length >= 16) scalar = *(__uint64_t *)bytes;
+ else if (length >= 16) scalar = *(const __uint64_t *)bytes;
#endif
+ }
return scalar;
}
};
More information about the lldb-commits
mailing list