[libcxxabi] r235829 - libc++abi: clear up some -Wqual-cast warnings
Saleem Abdulrasool
compnerd at compnerd.org
Sun Apr 26 19:21:55 PDT 2015
Author: compnerd
Date: Sun Apr 26 21:21:55 2015
New Revision: 235829
URL: http://llvm.org/viewvc/llvm-project?rev=235829&view=rev
Log:
libc++abi: clear up some -Wqual-cast warnings
Cleans up cast qualifier warnings identified by GCC 4.9.2.
Modified:
libcxxabi/trunk/src/cxa_personality.cpp
libcxxabi/trunk/src/private_typeinfo.cpp
Modified: libcxxabi/trunk/src/cxa_personality.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_personality.cpp?rev=235829&r1=235828&r2=235829&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_personality.cpp (original)
+++ libcxxabi/trunk/src/cxa_personality.cpp Sun Apr 26 21:21:55 2015
@@ -249,8 +249,7 @@ readEncodedPointer(const uint8_t** data,
switch (encoding & 0x0F)
{
case DW_EH_PE_absptr:
- result = *((uintptr_t*)p);
- p += sizeof(uintptr_t);
+ result = readPointerHelper<uintptr_t>(p);
break;
case DW_EH_PE_uleb128:
result = readULEB128(&p);
Modified: libcxxabi/trunk/src/private_typeinfo.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/private_typeinfo.cpp?rev=235829&r1=235828&r2=235829&view=diff
==============================================================================
--- libcxxabi/trunk/src/private_typeinfo.cpp (original)
+++ libcxxabi/trunk/src/private_typeinfo.cpp Sun Apr 26 21:21:55 2015
@@ -599,7 +599,7 @@ __dynamic_cast(const void* static_ptr,
// Currently clang always sets src2dst_offset to -1 (no hint).
// Get (dynamic_ptr, dynamic_type) from static_ptr
- void** vtable = *(void***)static_ptr;
+ void **vtable = *static_cast<void ** const *>(static_ptr);
ptrdiff_t offset_to_derived = reinterpret_cast<ptrdiff_t>(vtable[-2]);
const void* dynamic_ptr = static_cast<const char*>(static_ptr) + offset_to_derived;
const __class_type_info* dynamic_type = static_cast<const __class_type_info*>(vtable[-1]);
More information about the cfe-commits
mailing list