Browse Source

windows: more HANDLE -> HMODULE changes.

Ozkan Sezer 2 years ago
parent
commit
321c30db57
2 changed files with 7 additions and 7 deletions
  1. 6 6
      src/core/windows/SDL_xinput.c
  2. 1 1
      src/thread/windows/SDL_systhread.c

+ 6 - 6
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;

+ 1 - 1
src/thread/windows/SDL_systhread.c

@@ -131,7 +131,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"));