[llvm] r221782 - Fixing more -Wcast-qual warnings; NFC.
Aaron Ballman
aaron at aaronballman.com
Wed Nov 12 06:01:17 PST 2014
Author: aaronballman
Date: Wed Nov 12 08:01:17 2014
New Revision: 221782
URL: http://llvm.org/viewvc/llvm-project?rev=221782&view=rev
Log:
Fixing more -Wcast-qual warnings; NFC.
Modified:
llvm/trunk/tools/llvm-objdump/MachODump.cpp
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=221782&r1=221781&r2=221782&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Wed Nov 12 08:01:17 2014
@@ -1613,7 +1613,8 @@ static void DisassembleInputMachO2(Strin
StringRef BytesStr;
Sections[SectIdx].getContents(BytesStr);
- ArrayRef<uint8_t> Bytes((uint8_t *)BytesStr.data(), BytesStr.size());
+ ArrayRef<uint8_t> Bytes(reinterpret_cast<const uint8_t *>(BytesStr.data()),
+ BytesStr.size());
uint64_t SectAddress = Sections[SectIdx].getAddress();
bool symbolTableWorked = false;
@@ -1748,7 +1749,9 @@ static void DisassembleInputMachO2(Strin
DTI->second.getLength(Length);
uint16_t Kind;
DTI->second.getKind(Kind);
- Size = DumpDataInCode((char *)Bytes.data() + Index, Length, Kind);
+ Size = DumpDataInCode(reinterpret_cast<const char *>(Bytes.data()) +
+ Index,
+ Length, Kind);
if ((Kind == MachO::DICE_KIND_JUMP_TABLE8) &&
(PC == (DTI->first + Length - 1)) && (Length & 1))
Size++;
@@ -1767,7 +1770,8 @@ static void DisassembleInputMachO2(Strin
DebugOut, Annotations);
if (gotInst) {
if (!NoShowRawInsn) {
- DumpBytes(StringRef((char *)Bytes.data() + Index, Size));
+ DumpBytes(StringRef(
+ reinterpret_cast<const char *>(Bytes.data()) + Index, Size));
}
formatted_raw_ostream FormattedOS(outs());
Annotations.flush();
@@ -1823,7 +1827,9 @@ static void DisassembleInputMachO2(Strin
}
if (!NoShowRawInsn) {
outs() << "\t";
- DumpBytes(StringRef((char *)Bytes.data() + Index, InstSize));
+ DumpBytes(
+ StringRef(reinterpret_cast<const char *>(Bytes.data()) + Index,
+ InstSize));
}
IP->printInst(&Inst, outs(), "");
outs() << "\n";
Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=221782&r1=221781&r2=221782&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Wed Nov 12 08:01:17 2014
@@ -377,7 +377,8 @@ static void DisassembleObject(const Obje
StringRef BytesStr;
if (error(Section.getContents(BytesStr)))
break;
- ArrayRef<uint8_t> Bytes((uint8_t *)BytesStr.data(), BytesStr.size());
+ ArrayRef<uint8_t> Bytes(reinterpret_cast<const uint8_t *>(BytesStr.data()),
+ BytesStr.size());
uint64_t Size;
uint64_t Index;
@@ -411,7 +412,8 @@ static void DisassembleObject(const Obje
outs() << format("%8" PRIx64 ":", SectionAddr + Index);
if (!NoShowRawInsn) {
outs() << "\t";
- DumpBytes(StringRef((char *)Bytes.data() + Index, Size));
+ DumpBytes(StringRef(
+ reinterpret_cast<const char *>(Bytes.data()) + Index, Size));
}
IP->printInst(&Inst, outs(), "");
outs() << CommentStream.str();
More information about the llvm-commits
mailing list