Cleanup c-style casts from Platform.Win32.cpp

This commit is contained in:
Tulio Leao 2020-07-14 12:56:24 -03:00 committed by Gymnasiast
parent e032ba091d
commit 720c17eea6
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
1 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ namespace Platform
std::wstring result; std::wstring result;
auto wname = String::ToWideChar(name); auto wname = String::ToWideChar(name);
wchar_t wvalue[256]; wchar_t wvalue[256];
auto valueSize = GetEnvironmentVariableW(wname.c_str(), wvalue, (DWORD)std::size(wvalue)); auto valueSize = GetEnvironmentVariableW(wname.c_str(), wvalue, static_cast<DWORD>(std::size(wvalue)));
if (valueSize < std::size(wvalue)) if (valueSize < std::size(wvalue))
{ {
result = wvalue; result = wvalue;
@ -181,7 +181,7 @@ namespace Platform
LONGLONG ll = Int32x32To64(timestamp, 10000000) + 116444736000000000; LONGLONG ll = Int32x32To64(timestamp, 10000000) + 116444736000000000;
FILETIME ft; FILETIME ft;
ft.dwLowDateTime = (DWORD)ll; ft.dwLowDateTime = static_cast<DWORD>(ll);
ft.dwHighDateTime = ll >> 32; ft.dwHighDateTime = ll >> 32;
SYSTEMTIME st; SYSTEMTIME st;
@ -234,7 +234,7 @@ namespace Platform
# pragma GCC diagnostic push # pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type" # pragma GCC diagnostic ignored "-Wcast-function-type"
# endif # endif
auto fn = (RtlGetVersionPtr)GetProcAddress(hModule, "RtlGetVersion"); auto fn = reinterpret_cast<RtlGetVersionPtr>(GetProcAddress(hModule, "RtlGetVersion"));
# if defined(__GNUC__) && __GNUC__ >= 8 # if defined(__GNUC__) && __GNUC__ >= 8
# pragma GCC diagnostic pop # pragma GCC diagnostic pop
# endif # endif