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

Bruno Jesus 00cpxxx at gmail.com
Mon Nov 3 16:23:02 CST 2014


-------------- next part --------------
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-patches mailing list