diff --git a/src/corelib/global/qoperatingsystemversion_win.cpp b/src/corelib/global/qoperatingsystemversion_win.cpp index f3662ae1f9..7659fb2550 100644 --- a/src/corelib/global/qoperatingsystemversion_win.cpp +++ b/src/corelib/global/qoperatingsystemversion_win.cpp @@ -97,7 +97,7 @@ static inline OSVERSIONINFOEX determineWinOsVersion() // because linking to it at load time will not pass the Windows App Certification Kit // https://msdn.microsoft.com/en-us/library/windows/hardware/ff561910.aspx RtlGetVersionFunction pRtlGetVersion = reinterpret_cast( - GetProcAddressA(ntdll, "RtlGetVersion")); + reinterpret_cast(GetProcAddressA(ntdll, "RtlGetVersion"))); if (Q_UNLIKELY(!pRtlGetVersion)) return result; diff --git a/src/corelib/io/qlockfile_win.cpp b/src/corelib/io/qlockfile_win.cpp index 6b8028460c..277f8d4230 100644 --- a/src/corelib/io/qlockfile_win.cpp +++ b/src/corelib/io/qlockfile_win.cpp @@ -153,9 +153,8 @@ QString QLockFilePrivate::processNameByPid(qint64 pid) HMODULE hPsapi = LoadLibraryA("psapi"); if (!hPsapi) return QString(); - - GetModuleFileNameExFunc qGetModuleFileNameEx - = (GetModuleFileNameExFunc)GetProcAddress(hPsapi, "GetModuleFileNameExW"); + GetModuleFileNameExFunc qGetModuleFileNameEx = reinterpret_cast( + reinterpret_cast(GetProcAddress(hPsapi, "GetModuleFileNameExW"))); if (!qGetModuleFileNameEx) { FreeLibrary(hPsapi); return QString(); diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp index a3ccf13e82..c995e3fef2 100644 --- a/src/network/kernel/qauthenticator.cpp +++ b/src/network/kernel/qauthenticator.cpp @@ -1454,8 +1454,8 @@ static bool q_NTLM_SSPI_library_load() securityDLLHandle = LoadLibrary(L"secur32.dll"); if (securityDLLHandle != NULL) { INIT_SECURITY_INTERFACE pInitSecurityInterface = - (INIT_SECURITY_INTERFACE)GetProcAddress(securityDLLHandle, - "InitSecurityInterfaceW"); + reinterpret_cast( + reinterpret_cast(GetProcAddress(securityDLLHandle, "InitSecurityInterfaceW"))); if (pInitSecurityInterface != NULL) pSecurityFunctionTable = pInitSecurityInterface(); } diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index acd676833e..f5668c274e 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1603,8 +1603,10 @@ DebugSymbolResolver::DebugSymbolResolver(HANDLE process) bool success = false; m_dbgHelpLib = LoadLibraryW(L"dbghelp.dll"); if (m_dbgHelpLib) { - SymInitializeType symInitialize = (SymInitializeType)(GetProcAddress(m_dbgHelpLib, "SymInitialize")); - m_symFromAddr = (SymFromAddrType)(GetProcAddress(m_dbgHelpLib, "SymFromAddr")); + SymInitializeType symInitialize = reinterpret_cast( + reinterpret_cast(GetProcAddress(m_dbgHelpLib, "SymInitialize"))); + m_symFromAddr = reinterpret_cast( + reinterpret_cast(GetProcAddress(m_dbgHelpLib, "SymFromAddr"))); success = symInitialize && m_symFromAddr && symInitialize(process, NULL, TRUE); } if (!success)