From dd95310c73900f04904e37bc2d52cbc71fe03998 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 10 Jun 2023 18:14:06 +0200 Subject: [PATCH] Suppress warning about implicit sign conversions The conversion from unsigned int to int should be ok here. --- conversion/stringconversion.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conversion/stringconversion.cpp b/conversion/stringconversion.cpp index 864c559..126129f 100644 --- a/conversion/stringconversion.cpp +++ b/conversion/stringconversion.cpp @@ -215,14 +215,14 @@ std::wstring convertMultiByteToWide(std::error_code &ec, std::string_view inputB auto bufferSize = static_cast(std::clamp(inputBuffer.size(), 0, std::numeric_limits::max())); auto size = MultiByteToWideChar(CP_UTF8, 0, inputBuffer.data(), bufferSize, nullptr, 0); if (size <= 0) { - ec = std::error_code(GetLastError(), std::system_category()); + ec = std::error_code(static_cast(GetLastError()), std::system_category()); return widePath; } // do the actual conversion widePath.resize(static_cast(size)); size = MultiByteToWideChar(CP_UTF8, 0, inputBuffer.data(), bufferSize, widePath.data(), size); if (size <= 0) { - ec = std::error_code(GetLastError(), std::system_category()); + ec = std::error_code(static_cast(GetLastError()), std::system_category()); widePath.clear(); } return widePath; @@ -240,14 +240,14 @@ WideStringData convertMultiByteToWide(std::error_code &ec, const char *inputBuff WideStringData widePath; widePath.second = MultiByteToWideChar(CP_UTF8, 0, inputBuffer, inputBufferSize, nullptr, 0); if (widePath.second <= 0) { - ec = std::error_code(GetLastError(), std::system_category()); + ec = std::error_code(static_cast(GetLastError()), std::system_category()); return widePath; } // do the actual conversion widePath.first = make_unique(static_cast(widePath.second)); widePath.second = MultiByteToWideChar(CP_UTF8, 0, inputBuffer, inputBufferSize, widePath.first.get(), widePath.second); if (widePath.second <= 0) { - ec = std::error_code(GetLastError(), std::system_category()); + ec = std::error_code(static_cast(GetLastError()), std::system_category()); widePath.first.reset(); } return widePath;