[nfde] Fix Windows warnings
This commit is contained in:
parent
03a05c511e
commit
9a42a9b9d9
6
deps/nfde/src/nfd_win.cpp
vendored
6
deps/nfde/src/nfd_win.cpp
vendored
@ -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<size_t>(p_spec - filterList[0].spec);
|
||||
// allocate one more char space for the '\0'
|
||||
nfdnchar_t* extnBuf = NFDi_Malloc<nfdnchar_t>(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<nfdnchar_t>(sizeof(nfdnchar_t) * charsNeeded);
|
||||
nfdnchar_t* tmp_outStr = NFDi_Malloc<nfdnchar_t>(sizeof(nfdnchar_t) * static_cast<size_t>(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<nfdu8char_t>(sizeof(nfdu8char_t) * bytesNeeded);
|
||||
nfdu8char_t* tmp_outStr = NFDi_Malloc<nfdu8char_t>(sizeof(nfdu8char_t) * static_cast<size_t>(bytesNeeded));
|
||||
if (!tmp_outStr) {
|
||||
return NFD_ERROR;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user