Explicitly cast size_t to integer types

This commit is contained in:
msuih 2019-06-28 15:41:47 +03:00 committed by Nekotekina
parent 146e43b6ec
commit d57124d075
14 changed files with 30 additions and 29 deletions

View file

@ -1460,8 +1460,9 @@ const std::string& fs::get_config_dir()
#ifdef _WIN32
wchar_t buf[32768];
if (GetEnvironmentVariable(L"RPCS3_CONFIG_DIR", buf, std::size(buf)) - 1 >= std::size(buf) - 1 &&
GetModuleFileName(NULL, buf, std::size(buf)) - 1 >= std::size(buf) - 1)
constexpr DWORD size = static_cast<DWORD>(std::size(buf));
if (GetEnvironmentVariable(L"RPCS3_CONFIG_DIR", buf, size) - 1 >= size - 1 &&
GetModuleFileName(NULL, buf, size) - 1 >= size - 1)
{
MessageBoxA(0, fmt::format("GetModuleFileName() failed: error %u.", GetLastError()).c_str(), "fs::get_config_dir()", MB_ICONERROR);
return dir; // empty