Browse Source

Fixed warnings building for UWP

Sam Lantinga 1 year ago
parent
commit
fa5bfe577c

+ 2 - 2
src/joystick/windows/SDL_windows_gaming_input.c

@@ -61,7 +61,7 @@ typedef struct WindowsGamingInputControllerState
     int steam_virtual_gamepad_slot;
 } WindowsGamingInputControllerState;
 
-typedef HRESULT(WINAPI *CoIncrementMTAUsage_t)(PVOID *pCookie);
+typedef HRESULT(WINAPI *CoIncrementMTAUsage_t)(CO_MTA_USAGE_COOKIE *pCookie);
 typedef HRESULT(WINAPI *RoGetActivationFactory_t)(HSTRING activatableClassId, REFIID iid, void **factory);
 typedef HRESULT(WINAPI *WindowsCreateStringReference_t)(PCWSTR sourceString, UINT32 length, HSTRING_HEADER *hstringHeader, HSTRING *string);
 typedef HRESULT(WINAPI *WindowsDeleteString_t)(HSTRING string);
@@ -626,7 +626,7 @@ static int WGI_JoystickInit(void)
          * As a workaround, we will keep a reference to the MTA to prevent COM from unloading DLLs later.
          * See https://github.com/libsdl-org/SDL/issues/5552 for more details.
          */
-        static PVOID cookie = NULL;
+        static CO_MTA_USAGE_COOKIE cookie = NULL;
         if (!cookie) {
             hr = wgi.CoIncrementMTAUsage(&cookie);
             if (FAILED(hr)) {

+ 1 - 1
src/thread/stdcpp/SDL_sysmutex.cpp

@@ -55,7 +55,7 @@ extern "C" void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS  /
     if (mutex != NULL) {
         try {
             mutex->cpp_mutex.lock();
-        } catch (std::system_error &ex) {
+        } catch (std::system_error &/*ex*/) {
             SDL_assert(!"Error trying to lock mutex");  // assume we're in a lot of trouble if this assert fails.
             //return SDL_SetError("unable to lock a C++ mutex: code=%d; %s", ex.code(), ex.what());
         }

+ 2 - 2
src/thread/stdcpp/SDL_sysrwlock.cpp

@@ -56,7 +56,7 @@ extern "C" void SDL_LockRWLockForReading(SDL_RWLock *rwlock) SDL_NO_THREAD_SAFET
     if (rwlock) {
         try {
             rwlock->cpp_mutex.lock_shared();
-        } catch (std::system_error &ex) {
+        } catch (std::system_error &/*ex*/) {
             SDL_assert(!"Error trying to lock rwlock for reading");  // assume we're in a lot of trouble if this assert fails.
             //return SDL_SetError("unable to lock a C++ rwlock: code=%d; %s", ex.code(), ex.what());
         }
@@ -69,7 +69,7 @@ extern "C" void SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SDL_NO_THREAD_SAFET
         try {
             rwlock->cpp_mutex.lock();
             rwlock->write_owner = SDL_GetCurrentThreadID();
-        } catch (std::system_error &ex) {
+        } catch (std::system_error &/*ex*/) {
             SDL_assert(!"Error trying to lock rwlock for writing");  // assume we're in a lot of trouble if this assert fails.
             //return SDL_SetError("unable to lock a C++ rwlock: code=%d; %s", ex.code(), ex.what());
         }