InputSource: Fix Wcast-function-type-mismatch

This commit is contained in:
Stenzek 2025-02-14 18:28:24 +10:00
parent 5913de947f
commit 9b2cf0abbd
No known key found for this signature in database
2 changed files with 11 additions and 11 deletions

View File

@ -69,10 +69,10 @@ bool DInputSource::Initialize(const SettingsInterface& si, std::unique_lock<std:
return false; return false;
} }
PFNDIRECTINPUT8CREATE create = PFNDIRECTINPUT8CREATE create = reinterpret_cast<PFNDIRECTINPUT8CREATE>(
reinterpret_cast<PFNDIRECTINPUT8CREATE>(GetProcAddress(m_dinput_module, "DirectInput8Create")); reinterpret_cast<void*>(GetProcAddress(m_dinput_module, "DirectInput8Create")));
PFNGETDFDIJOYSTICK get_joystick_data_format = PFNGETDFDIJOYSTICK get_joystick_data_format =
reinterpret_cast<PFNGETDFDIJOYSTICK>(GetProcAddress(m_dinput_module, "GetdfDIJoystick")); reinterpret_cast<PFNGETDFDIJOYSTICK>(reinterpret_cast<void*>(GetProcAddress(m_dinput_module, "GetdfDIJoystick")));
if (!create || !get_joystick_data_format) if (!create || !get_joystick_data_format)
{ {
ERROR_LOG("Failed to get DInput function pointers."); ERROR_LOG("Failed to get DInput function pointers.");

View File

@ -126,17 +126,17 @@ bool XInputSource::Initialize(const SettingsInterface& si, std::unique_lock<std:
} }
// Try the hidden version of XInputGetState(), which lets us query the guide button. // Try the hidden version of XInputGetState(), which lets us query the guide button.
m_xinput_get_state = m_xinput_get_state = reinterpret_cast<decltype(m_xinput_get_state)>(
reinterpret_cast<decltype(m_xinput_get_state)>(GetProcAddress(m_xinput_module, reinterpret_cast<LPCSTR>(100))); reinterpret_cast<void*>(GetProcAddress(m_xinput_module, reinterpret_cast<LPCSTR>(100))));
if (!m_xinput_get_state) if (!m_xinput_get_state)
{ {
m_xinput_get_state = m_xinput_get_state = reinterpret_cast<decltype(m_xinput_get_state)>(
reinterpret_cast<decltype(m_xinput_get_state)>(GetProcAddress(m_xinput_module, "XInputGetState")); reinterpret_cast<void*>(GetProcAddress(m_xinput_module, "XInputGetState")));
} }
m_xinput_set_state = m_xinput_set_state = reinterpret_cast<decltype(m_xinput_set_state)>(
reinterpret_cast<decltype(m_xinput_set_state)>(GetProcAddress(m_xinput_module, "XInputSetState")); reinterpret_cast<void*>(GetProcAddress(m_xinput_module, "XInputSetState")));
m_xinput_get_capabilities = m_xinput_get_capabilities = reinterpret_cast<decltype(m_xinput_get_capabilities)>(
reinterpret_cast<decltype(m_xinput_get_capabilities)>(GetProcAddress(m_xinput_module, "XInputGetCapabilities")); reinterpret_cast<void*>(GetProcAddress(m_xinput_module, "XInputGetCapabilities")));
if (!m_xinput_get_state || !m_xinput_set_state || !m_xinput_get_capabilities) if (!m_xinput_get_state || !m_xinput_set_state || !m_xinput_get_capabilities)
{ {