Skip to content

Commit

Permalink
Fixed some compilation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
punesemu committed Dec 28, 2021
1 parent 2e52e59 commit aaebcf6
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/gui/windows/os_jstick.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,8 @@ static BOOL CALLBACK cb_enum_obj(LPCDIDEVICEOBJECTINSTANCEW instance, LPVOID con
}
} else if (instance->dwType & DIDFT_AXIS) {
DIPROPRANGE range;
DIPROPDWORD deadZone;
BYTE finded = TRUE;
_js_axis *jsx;
DIPROPDWORD deadzone;
_js_axis *jsx = NULL;
HRESULT rc;

if (!memcmp(&instance->guidType, &GUID_XAxis, sizeof(instance->guidType))) {
Expand Down Expand Up @@ -888,11 +887,9 @@ static BOOL CALLBACK cb_enum_obj(LPCDIDEVICEOBJECTINSTANCEW instance, LPVOID con
//jsx->offset = ABS_THROTTLE + jdev->info.sliders;
//jsx->offset_di8 = DIJOFS_SLIDER(jdev->info.sliders);
jdev->info.sliders++;
} else {
finded = FALSE;
}

if (finded) {
if (jsx) {
range.diph.dwSize = sizeof(range);
range.diph.dwHeaderSize = sizeof(range.diph);
range.diph.dwObj = instance->dwType;
Expand All @@ -904,12 +901,12 @@ static BOOL CALLBACK cb_enum_obj(LPCDIDEVICEOBJECTINSTANCEW instance, LPVOID con
fprintf(stderr, "IDIrectInputDevice8_SetProperty : 0x%X\n", (unsigned int)rc);
}

deadZone.diph.dwSize = sizeof(deadZone);
deadZone.diph.dwHeaderSize = sizeof(deadZone.diph);
deadZone.diph.dwObj = instance->dwType;
deadZone.diph.dwHow = DIPH_BYID;
deadZone.dwData = 0;
if ((rc = IDirectInputDevice8_SetProperty(JDEVIDID8W, DIPROP_DEADZONE, &deadZone.diph)) != DI_OK) {
deadzone.diph.dwSize = sizeof(deadzone);
deadzone.diph.dwHeaderSize = sizeof(deadzone.diph);
deadzone.diph.dwObj = instance->dwType;
deadzone.diph.dwHow = DIPH_BYID;
deadzone.dwData = 0;
if ((rc = IDirectInputDevice8_SetProperty(JDEVIDID8W, DIPROP_DEADZONE, &deadzone.diph)) != DI_OK) {
fprintf(stderr, "IDIrectInputDevice8_SetProperty : 0x%X\n", (unsigned int)rc);
}

Expand Down

0 comments on commit aaebcf6

Please sign in to comment.