diff --git a/llvm/tools/llvm-rc/ResourceFileWriter.cpp b/llvm/tools/llvm-rc/ResourceFileWriter.cpp index 3d72e16bf6e2f31fb0e5b530bd4ff581437a31be..1a9f4eba1898174c498c653630aade3f62ff0b19 100644 --- a/llvm/tools/llvm-rc/ResourceFileWriter.cpp +++ b/llvm/tools/llvm-rc/ResourceFileWriter.cpp @@ -166,9 +166,7 @@ static Error processString(StringRef Str, NullHandlingMethod NullHandler, } } - // Make sure to write little-endian strings, regardless of the host - // byte-order. - Result.push_back(endian::byte_swap(Char, little)); + Result.push_back(Char); return Error::success(); }; @@ -1131,7 +1129,7 @@ Error ResourceFileWriter::writeMenuDefinitionList( Error ResourceFileWriter::writeMenuBody(const RCResource *Base) { // At first, MENUHEADER structure. In fact, these are two WORDs equal to 0. // Ref: msdn.microsoft.com/en-us/library/windows/desktop/ms648018.aspx - writeObject(0); + writeInt(0); return writeMenuDefinitionList(cast(Base)->Elements); } @@ -1250,9 +1248,9 @@ Error ResourceFileWriter::writeVersionInfoBlock(const VersionInfoBlock &Blk) { uint64_t LengthLoc; if (OutputHeader) { - LengthLoc = writeObject(0); - writeObject(0); - writeObject(true); + LengthLoc = writeInt(0); + writeInt(0); + writeInt(1); // true RETURN_IF_ERROR(writeCString(Blk.Name)); padStream(sizeof(uint32_t)); } @@ -1304,9 +1302,9 @@ Error ResourceFileWriter::writeVersionInfoValue(const VersionInfoValue &Val) { return createError(Twine("VALUE ") + Val.Key + " cannot contain both strings and integers"); - auto LengthLoc = writeObject(0); - auto ValLengthLoc = writeObject(0); - writeObject(HasStrings); + auto LengthLoc = writeInt(0); + auto ValLengthLoc = writeInt(0); + writeInt(HasStrings); RETURN_IF_ERROR(writeCString(Val.Key)); padStream(sizeof(uint32_t));