silence a couple of -Wqual-cast warning from GCC (NFC)
Cast to `const uint8_t *` instead of `uint8_t *` to avoid the warning
from GCC.
EmulationStateARM.cpp:206:34: warning: cast from type 'const void*' to type 'uint8_t* {aka unsigned char*}' casts away qualifiers [-Wcast-qual]
Cast to `const uint32_t *` and the explicitly cast away the const-ness
of the value. This seems pretty sketchy as the `DataExtractor` holds a
const reference to the data. However, this is no worse than before.
ObjectFilePECOFF.cpp:540:78: warning: cast from type 'const uint8_t* {aka const unsigned char*}' to type 'uint32_t* {aka unsigned int*}' casts away qualifiers [-Wcast-qual]
llvm-svn: 308489
This commit is contained in:
@@ -537,7 +537,8 @@ Symtab *ObjectFilePECOFF::GetSymtab() {
|
||||
|
||||
// First 4 bytes should be zeroed after strtab_size has been read,
|
||||
// because it is used as offset 0 to encode a NULL string.
|
||||
uint32_t *strtab_data_start = (uint32_t *)strtab_data.GetDataStart();
|
||||
uint32_t *strtab_data_start = const_cast<uint32_t *>(
|
||||
reinterpret_cast<const uint32_t *>(strtab_data.GetDataStart()));
|
||||
strtab_data_start[0] = 0;
|
||||
|
||||
offset = 0;
|
||||
|
||||
Reference in New Issue
Block a user