From 9a42a9b9d9eca8e1f08c8aabd6b097e83c1f0982 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 6 Dec 2024 00:12:38 -0600 Subject: [PATCH] [nfde] Fix Windows warnings --- deps/nfde/src/nfd_win.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deps/nfde/src/nfd_win.cpp b/deps/nfde/src/nfd_win.cpp index 772dfb27..a551f858 100644 --- a/deps/nfde/src/nfd_win.cpp +++ b/deps/nfde/src/nfd_win.cpp @@ -201,7 +201,7 @@ nfdresult_t SetDefaultExtension(::IFileDialog* fileOpenDialog, } if (*p_spec) { // multiple file extensions for this type (need to allocate memory) - size_t numChars = p_spec - filterList[0].spec; + size_t numChars = static_cast(p_spec - filterList[0].spec); // allocate one more char space for the '\0' nfdnchar_t* extnBuf = NFDi_Malloc(sizeof(nfdnchar_t) * (numChars + 1)); if (!extnBuf) { @@ -710,7 +710,7 @@ nfdresult_t CopyCharToWChar(const nfdu8char_t* inStr, nfdnchar_t*& outStr) { int charsNeeded = MultiByteToWideChar(CP_UTF8, 0, inStr, -1, nullptr, 0); assert(charsNeeded); - nfdnchar_t* tmp_outStr = NFDi_Malloc(sizeof(nfdnchar_t) * charsNeeded); + nfdnchar_t* tmp_outStr = NFDi_Malloc(sizeof(nfdnchar_t) * static_cast(charsNeeded)); if (!tmp_outStr) { return NFD_ERROR; } @@ -727,7 +727,7 @@ nfdresult_t CopyWCharToNFDChar(const nfdnchar_t* inStr, nfdu8char_t*& outStr) { int bytesNeeded = WideCharToMultiByte(CP_UTF8, 0, inStr, -1, nullptr, 0, nullptr, nullptr); assert(bytesNeeded); - nfdu8char_t* tmp_outStr = NFDi_Malloc(sizeof(nfdu8char_t) * bytesNeeded); + nfdu8char_t* tmp_outStr = NFDi_Malloc(sizeof(nfdu8char_t) * static_cast(bytesNeeded)); if (!tmp_outStr) { return NFD_ERROR; }