From 5b904a103ad3bd58c13c82b11e32e97a91bafcfb Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sat, 31 Dec 2022 08:00:00 +0300 Subject: [PATCH] windows: more HANDLE -> HMODULE changes. --- src/core/windows/SDL_xinput.c | 12 ++++++------ src/thread/windows/SDL_systhread.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/windows/SDL_xinput.c b/src/core/windows/SDL_xinput.c index 3015e6e21..5bd9d16af 100644 --- a/src/core/windows/SDL_xinput.c +++ b/src/core/windows/SDL_xinput.c @@ -33,7 +33,7 @@ XInputGetCapabilities_t SDL_XInputGetCapabilities = NULL; XInputGetBatteryInformation_t SDL_XInputGetBatteryInformation = NULL; DWORD SDL_XInputVersion = 0; -static HANDLE s_pXInputDLL = 0; +static HMODULE s_pXInputDLL = NULL; static int s_XInputDLLRefCount = 0; #if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__) @@ -105,13 +105,13 @@ int WIN_LoadXInputDLL(void) s_XInputDLLRefCount = 1; /* 100 is the ordinal for _XInputGetStateEx, which returns the same struct as XinputGetState, but with extra data in wButtons for the guide button, we think... */ - SDL_XInputGetState = (XInputGetState_t)GetProcAddress((HMODULE)s_pXInputDLL, (LPCSTR)100); + SDL_XInputGetState = (XInputGetState_t)GetProcAddress(s_pXInputDLL, (LPCSTR)100); if (SDL_XInputGetState == NULL) { - SDL_XInputGetState = (XInputGetState_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetState"); + SDL_XInputGetState = (XInputGetState_t)GetProcAddress(s_pXInputDLL, "XInputGetState"); } - SDL_XInputSetState = (XInputSetState_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputSetState"); - SDL_XInputGetCapabilities = (XInputGetCapabilities_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetCapabilities"); - SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetBatteryInformation"); + SDL_XInputSetState = (XInputSetState_t)GetProcAddress(s_pXInputDLL, "XInputSetState"); + SDL_XInputGetCapabilities = (XInputGetCapabilities_t)GetProcAddress(s_pXInputDLL, "XInputGetCapabilities"); + SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)GetProcAddress(s_pXInputDLL, "XInputGetBatteryInformation"); if (SDL_XInputGetState == NULL || SDL_XInputSetState == NULL || SDL_XInputGetCapabilities == NULL) { WIN_UnloadXInputDLL(); return -1; diff --git a/src/thread/windows/SDL_systhread.c b/src/thread/windows/SDL_systhread.c index 391871b58..720ab3a02 100644 --- a/src/thread/windows/SDL_systhread.c +++ b/src/thread/windows/SDL_systhread.c @@ -150,7 +150,7 @@ void SDL_SYS_SetupThread(const char *name) if (name != NULL) { #ifndef __WINRT__ /* !!! FIXME: There's no LoadLibrary() in WinRT; don't know if SetThreadDescription is available there at all at the moment. */ static pfnSetThreadDescription pSetThreadDescription = NULL; - static HMODULE kernel32 = 0; + static HMODULE kernel32 = NULL; if (!kernel32) { kernel32 = GetModuleHandle(TEXT("kernel32.dll"));