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