Global: Cleanup initialization/pointer checks.

Cleaning up a lot of cases of uninitialized data, unchecked return values
for failures, and similar.
This commit is contained in:
Unknown W. Brackets committed 2022-12-10 21:13:36 -08:00
1 parent a7b7bf7826
commit 9cfcbc46e6
41 files changed
+190 -138

No files matched your search

+3 -3
View File
@@ -38,7 +38,7 @@ static XInputGetState_t PPSSPP_XInputGetState = nullptr;
static XInputSetState_t PPSSPP_XInputSetState = nullptr;
static XInputGetCapabilitiesEx_t PPSSPP_XInputGetCapabilitiesEx = nullptr;
static DWORD PPSSPP_XInputVersion = 0;
static HMODULE s_pXInputDLL = 0;
static HMODULE s_pXInputDLL = nullptr;
static int s_XInputDLLRefCount = 0;
static void UnloadXInputDLL();
@@ -105,7 +105,7 @@ static void UnloadXInputDLL() {
if ( s_pXInputDLL ) {
if (--s_XInputDLLRefCount == 0) {
FreeLibrary( s_pXInputDLL );
s_pXInputDLL = NULL;
s_pXInputDLL = nullptr;
}
}
}
@@ -206,7 +206,7 @@ void XinputDevice::UpdatePad(int pad, const XINPUT_STATE &state, XINPUT_VIBRATIO
if (!notified[pad]) {
notified[pad] = true;
#if !PPSSPP_PLATFORM(UWP)
XINPUT_CAPABILITIES_EX caps;
XINPUT_CAPABILITIES_EX caps{};
if (PPSSPP_XInputGetCapabilitiesEx != nullptr && PPSSPP_XInputGetCapabilitiesEx(1, pad, 0, &caps) == ERROR_SUCCESS) {
KeyMap::NotifyPadConnected(DEVICE_ID_XINPUT_0 + pad, StringFromFormat("Xbox 360 Pad: %d/%d", caps.vendorId, caps.productId));
} else {