Make sure we return version 0 if XInput detection fails
authorSam Lantinga <slouken@libsdl.org>
Sun, 02 Mar 2014 11:08:05 -0800
changeset 8285 a6493ee0c9b5
parent 8284 a2910aa6c056
child 8286 81319d3c2305
Make sure we return version 0 if XInput detection fails
src/video/x11/SDL_x11xinput2.c
--- a/src/video/x11/SDL_x11xinput2.c	Sun Mar 02 12:45:51 2014 -0500
+++ b/src/video/x11/SDL_x11xinput2.c	Sun Mar 02 11:08:05 2014 -0800
@@ -61,9 +61,10 @@
 }
 
 static int
-query_xinput2_version(Display *display, int major, int minor)
+query_xinput2_version(Display *display)
 {
     /* We don't care if this fails, so long as it sets major/minor on it's way out the door. */
+    int major = 0, minor = 0;
     X11_XIQueryVersion(display, &major, &minor);
     return ((major * 1000) + minor);
 }
@@ -101,7 +102,7 @@
     }
 
     /* We need at least 2.2 for Multitouch, 2.0 otherwise. */
-    version = query_xinput2_version(data->display, 2, 2);
+    version = query_xinput2_version(data->display);
     if (!xinput2_version_atleast(version, 2, 0)) {
         return; /* X server does not support the version we want at all. */
     }