From 6cd2d18d9e52b0aca7240440548ad0f5709c8136 Mon Sep 17 00:00:00 2001 From: Alex Vakulenko Date: Fri, 17 Jan 2020 08:10:47 -0500 Subject: [PATCH] Fix build break on VS2019 due to implicit wchar_t->char conversion Converting std::wstring to std::string by constructing the latter with wchar_t iterators result in implicit conversion of wchar_t to char which trips Visual Studio 2019 compiler into throwing a warning of potential data loss during conversion. Use conv() helper function to do the conversion and please the compiler at the same time. --- renderdoccmd/renderdoccmd_win32.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/renderdoccmd/renderdoccmd_win32.cpp b/renderdoccmd/renderdoccmd_win32.cpp index 96a00abfa..5bed677f9 100644 --- a/renderdoccmd/renderdoccmd_win32.cpp +++ b/renderdoccmd/renderdoccmd_win32.cpp @@ -541,8 +541,7 @@ struct CrashHandlerCommand : public Command } else { - report += " \"" + std::string(name.begin(), name.end()) + "\": \"" + - std::string(val.begin(), val.end()) + "\",\n"; + report += " \"" + conv(name) + "\": \"" + conv(val) + "\",\n"; } }