dinput: Ensure variable is initialized when #define is not found (Cppcheck).

This commit is contained in:
Bruno Jesus 2014-11-03 20:23:02 -02:00 committed by Alexandre Julliard
parent e3c44185ed
commit 7e2f26d6fa
1 changed files with 6 additions and 0 deletions

View File

@ -169,6 +169,9 @@ static INT find_joystick_devices(void)
WARN("ioctl(%s,JSIOCGAXES) failed: %s, defauting to 2\n", joydev.device, strerror(errno));
joydev.axis_count = 2;
}
#else
WARN("reading number of joystick axes unsupported in this platform, defaulting to 2\n");
joydev.axis_count = 2;
#endif
#ifdef JSIOCGBUTTONS
if (ioctl(fd, JSIOCGBUTTONS, &joydev.button_count) < 0)
@ -176,6 +179,9 @@ static INT find_joystick_devices(void)
WARN("ioctl(%s,JSIOCGBUTTONS) failed: %s, defauting to 2\n", joydev.device, strerror(errno));
joydev.button_count = 2;
}
#else
WARN("reading number of joystick buttons unsupported in this platform, defaulting to 2\n");
joydev.button_count = 2;
#endif
if (ioctl(fd, JSIOCGAXMAP, axes_map) < 0)