Bruno Jesus : dinput: Ensure variable is initialized when #define is not found (Cppcheck).
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Nov 4 09:19:31 CST 2014
Module: wine
Branch: master
Commit: 7e2f26d6fa5d69650eaeb1994328840d0f2251d6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7e2f26d6fa5d69650eaeb1994328840d0f2251d6
Author: Bruno Jesus <00cpxxx at gmail.com>
Date: Mon Nov 3 20:23:02 2014 -0200
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 ce04986..4d40124 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)
More information about the wine-cvs
mailing list