From: Aaron Ballman Date: Wed, 12 Nov 2014 14:01:17 +0000 (+0000) Subject: Fixing more -Wcast-qual warnings; NFC. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1caf520205579bcd803f26bdfc644eabc8cdcf14;p=oota-llvm.git Fixing more -Wcast-qual warnings; NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221782 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp index 5b7f6d56c72..32ca4445be5 100644 --- a/tools/llvm-objdump/MachODump.cpp +++ b/tools/llvm-objdump/MachODump.cpp @@ -1613,7 +1613,8 @@ static void DisassembleInputMachO2(StringRef Filename, StringRef BytesStr; Sections[SectIdx].getContents(BytesStr); - ArrayRef Bytes((uint8_t *)BytesStr.data(), BytesStr.size()); + ArrayRef Bytes(reinterpret_cast(BytesStr.data()), + BytesStr.size()); uint64_t SectAddress = Sections[SectIdx].getAddress(); bool symbolTableWorked = false; @@ -1748,7 +1749,9 @@ static void DisassembleInputMachO2(StringRef Filename, DTI->second.getLength(Length); uint16_t Kind; DTI->second.getKind(Kind); - Size = DumpDataInCode((char *)Bytes.data() + Index, Length, Kind); + Size = DumpDataInCode(reinterpret_cast(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(StringRef Filename, DebugOut, Annotations); if (gotInst) { if (!NoShowRawInsn) { - DumpBytes(StringRef((char *)Bytes.data() + Index, Size)); + DumpBytes(StringRef( + reinterpret_cast(Bytes.data()) + Index, Size)); } formatted_raw_ostream FormattedOS(outs()); Annotations.flush(); @@ -1823,7 +1827,9 @@ static void DisassembleInputMachO2(StringRef Filename, } if (!NoShowRawInsn) { outs() << "\t"; - DumpBytes(StringRef((char *)Bytes.data() + Index, InstSize)); + DumpBytes( + StringRef(reinterpret_cast(Bytes.data()) + Index, + InstSize)); } IP->printInst(&Inst, outs(), ""); outs() << "\n"; diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp index eb06f7722fe..da5c275be8d 100644 --- a/tools/llvm-objdump/llvm-objdump.cpp +++ b/tools/llvm-objdump/llvm-objdump.cpp @@ -377,7 +377,8 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { StringRef BytesStr; if (error(Section.getContents(BytesStr))) break; - ArrayRef Bytes((uint8_t *)BytesStr.data(), BytesStr.size()); + ArrayRef Bytes(reinterpret_cast(BytesStr.data()), + BytesStr.size()); uint64_t Size; uint64_t Index; @@ -411,7 +412,8 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { outs() << format("%8" PRIx64 ":", SectionAddr + Index); if (!NoShowRawInsn) { outs() << "\t"; - DumpBytes(StringRef((char *)Bytes.data() + Index, Size)); + DumpBytes(StringRef( + reinterpret_cast(Bytes.data()) + Index, Size)); } IP->printInst(&Inst, outs(), ""); outs() << CommentStream.str();