diff options
| author | Greg Clayton <gclayton@apple.com> | 2013-05-08 21:35:24 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2013-05-08 21:35:24 +0000 |
| commit | 610f9260fa07436fbefbfcbfa71d6bd721122ea6 (patch) | |
| tree | 499a4a5a59224733bd7f4afa395a669504aba495 | |
| parent | 80d8308b5707b92626ef6f7adda976327507adaa (diff) | |
| download | bcm5719-llvm-610f9260fa07436fbefbfcbfa71d6bd721122ea6.tar.gz bcm5719-llvm-610f9260fa07436fbefbfcbfa71d6bd721122ea6.zip | |
Quiet g++-4.7 warnings about const issues and fix the scope of the "if (IsValid())".
llvm-svn: 181474
| -rw-r--r-- | lldb/include/lldb/Core/Value.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lldb/include/lldb/Core/Value.h b/lldb/include/lldb/Core/Value.h index 128bdb742d0..3ca7301a5df 100644 --- a/lldb/include/lldb/Core/Value.h +++ b/lldb/include/lldb/Core/Value.h @@ -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; } }; |

