diff --git a/pcsx2/PAD/Windows/PADConfig.cpp b/pcsx2/PAD/Windows/PADConfig.cpp index 8bd3f977f2..2793dd5185 100644 --- a/pcsx2/PAD/Windows/PADConfig.cpp +++ b/pcsx2/PAD/Windows/PADConfig.cpp @@ -378,7 +378,7 @@ void SelChanged(int port, int slot) if (!hWnd) return; HWND hWndTemp, hWndList = GetDlgItem(hWnd, IDC_BINDINGS_LIST); - int j, i = ListView_GetSelectedCount(hWndList); + int i = ListView_GetSelectedCount(hWndList); wchar_t* devName = L"N/A"; wchar_t* key = L"N/A"; wchar_t* command = L"N/A"; @@ -387,20 +387,20 @@ void SelChanged(int port, int slot) int sensitivity = 0; int deadZone = 0; int skipDeadZone = 0; - int nonButtons = 0; // Set if sensitivity != 0, but need to disable flip anyways. // Only used to relative axes. int disableFlip = 0; wchar_t temp[4][1000]; Device* dev; int bFound = 0; - int ffbFound = 0; ForceFeedbackBinding* ffb = 0; Binding* b = 0; if (i >= 1) { int index = -1; int flipped = 0; + int nonButtons = 0; + int ffbFound = 0; while (1) { if (!(config.bind && (!config.configureOnBind || quickSetup))) @@ -411,7 +411,8 @@ void SelChanged(int port, int slot) item.iItem = index; item.mask = LVIF_TEXT; item.pszText = temp[3]; - for (j = 0; j < 3; j++) + int j = 0; + for (; j < 3; j++) { item.iSubItem = j; item.cchTextMax = sizeof(temp[0]) / sizeof(temp[3][0]); diff --git a/pcsx2/PAD/Windows/PADRawInput.cpp b/pcsx2/PAD/Windows/PADRawInput.cpp index 589f8a99ce..62a57d100e 100644 --- a/pcsx2/PAD/Windows/PADRawInput.cpp +++ b/pcsx2/PAD/Windows/PADRawInput.cpp @@ -280,13 +280,13 @@ void EnumRawInputDevices() wchar_t* productID = displayName + 10000; RAWINPUTDEVICELIST* list = (RAWINPUTDEVICELIST*)malloc(sizeof(RAWINPUTDEVICELIST) * count); - int keyboardCount = 1; - int mouseCount = 1; count = GetRawInputDeviceList(list, (unsigned int*)&count, sizeof(RAWINPUTDEVICELIST)); // Not necessary, but reminder that count is -1 on failure. if (count > 0) { + int keyboardCount = 1; + int mouseCount = 1; for (int i = 0; i < count; i++) { if (list[i].dwType != RIM_TYPEKEYBOARD && list[i].dwType != RIM_TYPEMOUSE) diff --git a/pcsx2/PAD/Windows/WindowsMouse.cpp b/pcsx2/PAD/Windows/WindowsMouse.cpp index 4572f3dda1..1e58058ab1 100644 --- a/pcsx2/PAD/Windows/WindowsMouse.cpp +++ b/pcsx2/PAD/Windows/WindowsMouse.cpp @@ -39,18 +39,21 @@ WindowsMouse::WindowsMouse(DeviceAPI api, int hWheel, wchar_t* displayName, wcha wchar_t* WindowsMouse::GetPhysicalControlName(PhysicalControl* control) { - wchar_t* names[9] = { - L"L Button", - L"R Button", - L"M Button", - L"Mouse 4", - L"Mouse 5", - L"X Axis", - L"Y Axis", - L"Y Wheel", - L"X Wheel"}; if (control->id < 9) + { + wchar_t* names[9] = { + L"L Button", + L"R Button", + L"M Button", + L"Mouse 4", + L"Mouse 5", + L"X Axis", + L"Y Axis", + L"Y Wheel", + L"X Wheel"}; + return names[control->id]; + } return Device::GetPhysicalControlName(control); } diff --git a/pcsx2/PAD/Windows/XInputEnum.cpp b/pcsx2/PAD/Windows/XInputEnum.cpp index 8621ccf42e..e39d1a5e26 100644 --- a/pcsx2/PAD/Windows/XInputEnum.cpp +++ b/pcsx2/PAD/Windows/XInputEnum.cpp @@ -116,32 +116,33 @@ public: wchar_t* GetPhysicalControlName(PhysicalControl* c) { - const static wchar_t* names[] = { - L"D-pad Up", - L"D-pad Down", - L"D-pad Left", - L"D-pad Right", - L"Start", - L"Back", - L"Left Thumb", - L"Right Thumb", - L"Left Shoulder", - L"Right Shoulder", - L"Guide", - L"A", - L"B", - L"X", - L"Y", - L"Left Trigger", - L"Right Trigger", - L"Left Thumb X", - L"Left Thumb Y", - L"Right Thumb X", - L"Right Thumb Y", - }; unsigned int i = (unsigned int)(c - physicalControls); if (i < 21) { + const static wchar_t* names[] = { + L"D-pad Up", + L"D-pad Down", + L"D-pad Left", + L"D-pad Right", + L"Start", + L"Back", + L"Left Thumb", + L"Right Thumb", + L"Left Shoulder", + L"Right Shoulder", + L"Guide", + L"A", + L"B", + L"X", + L"Y", + L"Left Trigger", + L"Right Trigger", + L"Left Thumb X", + L"Left Thumb Y", + L"Right Thumb X", + L"Right Thumb Y", + }; + return (wchar_t*)names[i]; } return Device::GetPhysicalControlName(c);