diff --git a/include/dxc/Support/dxcapi.use.h b/include/dxc/Support/dxcapi.use.h index 44fe23bad6..747a7ca2dd 100644 --- a/include/dxc/Support/dxcapi.use.h +++ b/include/dxc/Support/dxcapi.use.h @@ -34,7 +34,7 @@ class DxcDllSupport { m_dll = LoadLibraryA(dllName); if (m_dll == nullptr) return HRESULT_FROM_WIN32(GetLastError()); - m_createFn = (DxcCreateInstanceProc)GetProcAddress(m_dll, fnName); + m_createFn = reinterpret_cast(reinterpret_cast(GetProcAddress(m_dll, fnName))); if (m_createFn == nullptr) { HRESULT hr = HRESULT_FROM_WIN32(GetLastError()); @@ -64,7 +64,7 @@ class DxcDllSupport { fnName2[s] = '2'; fnName2[s + 1] = '\0'; #ifdef _WIN32 - m_createFn2 = (DxcCreateInstance2Proc)GetProcAddress(m_dll, fnName2); + m_createFn2 = reinterpret_cast(reinterpret_cast(GetProcAddress(m_dll, fnName2))); #else m_createFn2 = (DxcCreateInstance2Proc)::dlsym(m_dll, fnName2); #endif diff --git a/include/llvm/CodeGen/SchedulerRegistry.h b/include/llvm/CodeGen/SchedulerRegistry.h index e4570a8adc..04d2441259 100644 --- a/include/llvm/CodeGen/SchedulerRegistry.h +++ b/include/llvm/CodeGen/SchedulerRegistry.h @@ -40,7 +40,7 @@ class RegisterScheduler : public MachinePassRegistryNode { static MachinePassRegistry Registry; RegisterScheduler(const char *N, const char *D, FunctionPassCtor C) - : MachinePassRegistryNode(N, D, (MachinePassCtor)C) + : MachinePassRegistryNode(N, D, reinterpret_cast(reinterpret_cast(C))) { Registry.Add(this); } ~RegisterScheduler() { Registry.Remove(this); } @@ -54,10 +54,10 @@ class RegisterScheduler : public MachinePassRegistryNode { return (RegisterScheduler *)Registry.getList(); } static FunctionPassCtor getDefault() { - return (FunctionPassCtor)Registry.getDefault(); + return reinterpret_cast(reinterpret_cast(Registry.getDefault())); } static void setDefault(FunctionPassCtor C) { - Registry.setDefault((MachinePassCtor)C); + Registry.setDefault(reinterpret_cast(reinterpret_cast(C))); } static void setListener(MachinePassRegistryListener *L) { Registry.setListener(L); diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index 2c00a2522c..490ef5cc30 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -90,7 +90,8 @@ void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext) { unwrap(C)->setDiagnosticHandler( - LLVM_EXTENSION reinterpret_cast(Handler), + reinterpret_cast( + reinterpret_cast(Handler)), DiagnosticContext); } diff --git a/lib/MSSupport/MSFileSystemImpl.cpp b/lib/MSSupport/MSFileSystemImpl.cpp index 38fc105d7a..ca734f7b4d 100644 --- a/lib/MSSupport/MSFileSystemImpl.cpp +++ b/lib/MSSupport/MSFileSystemImpl.cpp @@ -322,8 +322,9 @@ typedef BOOLEAN(WINAPI *PtrCreateSymbolicLinkW)( /*__in*/ DWORD dwFlags); PtrCreateSymbolicLinkW create_symbolic_link_api = - PtrCreateSymbolicLinkW(::GetProcAddress(::GetModuleHandleW(L"Kernel32.dll"), - "CreateSymbolicLinkW")); + PtrCreateSymbolicLinkW(reinterpret_cast(::GetProcAddress( + ::GetModuleHandleW(L"Kernel32.dll"), + "CreateSymbolicLinkW"))); } // namespace #endif diff --git a/lib/Support/Windows/RWMutex.inc b/lib/Support/Windows/RWMutex.inc index d7ab99f45e..4691a56328 100644 --- a/lib/Support/Windows/RWMutex.inc +++ b/lib/Support/Windows/RWMutex.inc @@ -49,21 +49,16 @@ static bool loadSRW() { sChecked = true; if (HMODULE hLib = ::GetModuleHandleW(L"Kernel32.dll")) { - fpInitializeSRWLock = - (VOID (WINAPI *)(PSRWLOCK))::GetProcAddress(hLib, - "InitializeSRWLock"); - fpAcquireSRWLockExclusive = - (VOID (WINAPI *)(PSRWLOCK))::GetProcAddress(hLib, - "AcquireSRWLockExclusive"); - fpAcquireSRWLockShared = - (VOID (WINAPI *)(PSRWLOCK))::GetProcAddress(hLib, - "AcquireSRWLockShared"); - fpReleaseSRWLockExclusive = - (VOID (WINAPI *)(PSRWLOCK))::GetProcAddress(hLib, - "ReleaseSRWLockExclusive"); - fpReleaseSRWLockShared = - (VOID (WINAPI *)(PSRWLOCK))::GetProcAddress(hLib, - "ReleaseSRWLockShared"); + fpInitializeSRWLock = reinterpret_cast( + reinterpret_cast(::GetProcAddress(hLib, "InitializeSRWLock"))); + fpAcquireSRWLockExclusive = reinterpret_cast( + reinterpret_cast(::GetProcAddress(hLib, "AcquireSRWLockExclusive"))); + fpAcquireSRWLockShared = reinterpret_cast( + reinterpret_cast(::GetProcAddress(hLib, "AcquireSRWLockShared"))); + fpReleaseSRWLockExclusive = reinterpret_cast( + reinterpret_cast(::GetProcAddress(hLib, "ReleaseSRWLockExclusive"))); + fpReleaseSRWLockShared = reinterpret_cast( + reinterpret_cast(::GetProcAddress(hLib, "ReleaseSRWLockShared"))); if (fpInitializeSRWLock != NULL) { sHasSRW = true; @@ -73,6 +68,7 @@ static bool loadSRW() { return sHasSRW; } + RWMutexImpl::RWMutexImpl() { // TODO: harden to allocation failures - HLSL Change if (loadSRW()) {