[lld] r231139 - Fix -Wcast-qual warning.
Rui Ueyama
ruiu at google.com
Tue Mar 3 13:38:38 PST 2015
Author: ruiu
Date: Tue Mar 3 15:38:38 2015
New Revision: 231139
URL: http://llvm.org/viewvc/llvm-project?rev=231139&view=rev
Log:
Fix -Wcast-qual warning.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp?rev=231139&r1=231138&r2=231139&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp Tue Mar 3 15:38:38 2015
@@ -1049,7 +1049,7 @@ StringRef FileCOFF::ArrayRefToString(Arr
}
if (array.empty())
return "";
- StringRef s((char *)array.data(), array.size());
+ StringRef s(reinterpret_cast<const char *>(array.data()), array.size());
s = s.substr(0, s.find_first_of('\0'));
std::string *contents = new (_alloc) std::string(s.data(), s.size());
return StringRef(*contents).trim();
More information about the llvm-commits
mailing list