[llvm] r215643 - Silencing some -Wcast-qual warnings and removing some C-style casts at the same time. NFC.
Aaron Ballman
aaron at aaronballman.com
Thu Aug 14 06:53:19 PDT 2014
Author: aaronballman
Date: Thu Aug 14 08:53:19 2014
New Revision: 215643
URL: http://llvm.org/viewvc/llvm-project?rev=215643&view=rev
Log:
Silencing some -Wcast-qual warnings and removing some C-style casts at the same time. NFC.
Modified:
llvm/trunk/tools/llvm-objdump/MachODump.cpp
Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=215643&r1=215642&r2=215643&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Thu Aug 14 08:53:19 2014
@@ -710,7 +710,8 @@ static void printCompressedSecondLevelUn
uint16_t EncodingsStart = readNext<uint16_t>(Pos);
readNext<uint16_t>(Pos);
- auto PageEncodings = (support::ulittle32_t *)(PageStart + EncodingsStart);
+ const auto *PageEncodings = reinterpret_cast<const support::ulittle32_t *>(
+ PageStart + EncodingsStart);
Pos = PageStart + EntriesStart;
for (unsigned i = 0; i < NumEntries; ++i) {
@@ -891,7 +892,7 @@ printMachOUnwindInfoSection(const MachOO
<< format("0x%08" PRIx32, IndexEntries[i].FunctionOffset) << '\n';
Pos = Contents.data() + IndexEntries[i].SecondLevelPageStart;
- uint32_t Kind = *(support::ulittle32_t *)Pos;
+ uint32_t Kind = *reinterpret_cast<const support::ulittle32_t *>(Pos);
if (Kind == 2)
printRegularSecondLevelUnwindPage(Pos);
else if (Kind == 3)
More information about the llvm-commits
mailing list