From 7e2f26d6fa5d69650eaeb1994328840d0f2251d6 Mon Sep 17 00:00:00 2001 From: Bruno Jesus <00cpxxx@gmail.com> Date: Mon, 3 Nov 2014 20:23:02 -0200 Subject: [PATCH] dinput: Ensure variable is initialized when #define is not found (Cppcheck). --- dlls/dinput/joystick_linux.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index ce04986c9ed..4d40124975b 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -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)