From ad0f73573fcc59c7c428ef5e529f8fec6a1cfbe6 Mon Sep 17 00:00:00 2001 From: David Cole Date: Mon, 3 Dec 2012 13:35:29 -0500 Subject: [PATCH] CPack: Fix dashboard warnings (#11575) Fix int vs. size_t conversion warnings that only showed up in the 64-bit builds. --- Source/CPack/WiX/cmWIXSourceWriter.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx index cc00e5749..b890ccde2 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx @@ -115,7 +115,7 @@ std::string cmWIXSourceWriter::WindowsCodepageToUtf8(const std::string& value) } int characterCount = MultiByteToWideChar( - CP_ACP, 0, value.c_str(), value.size(), 0, 0); + CP_ACP, 0, value.c_str(), static_cast(value.size()), 0, 0); if(characterCount == 0) { @@ -125,10 +125,11 @@ std::string cmWIXSourceWriter::WindowsCodepageToUtf8(const std::string& value) std::vector utf16(characterCount); MultiByteToWideChar( - CP_ACP, 0, value.c_str(), value.size(), &utf16[0], utf16.size()); + CP_ACP, 0, value.c_str(), static_cast(value.size()), + &utf16[0], static_cast(utf16.size())); - int utf8ByteCount = - WideCharToMultiByte(CP_UTF8, 0, &utf16[0], utf16.size(), 0, 0, 0, 0); + int utf8ByteCount = WideCharToMultiByte( + CP_UTF8, 0, &utf16[0], static_cast(utf16.size()), 0, 0, 0, 0); if(utf8ByteCount == 0) { @@ -137,8 +138,8 @@ std::string cmWIXSourceWriter::WindowsCodepageToUtf8(const std::string& value) std::vector utf8(utf8ByteCount); - WideCharToMultiByte(CP_UTF8, 0, &utf16[0], utf16.size(), - &utf8[0], utf8.size(), 0, 0); + WideCharToMultiByte(CP_UTF8, 0, &utf16[0], static_cast(utf16.size()), + &utf8[0], static_cast(utf8.size()), 0, 0); return std::string(&utf8[0], utf8.size()); }