Fixed bug 3939 - Remove static vm_error and vm_event from SDL_x11modes.c
authorSam Lantinga <slouken@libsdl.org>
Sat, 04 Nov 2017 22:06:40 -0700
changeset 1168964ec7aae69e3
parent 11688 e4d90d54cb01
child 11690 3c2e9a37881e
Fixed bug 3939 - Remove static vm_error and vm_event from SDL_x11modes.c

tomwardio

Remove static int vm_error and vm_event, use local variables instead.

This fixes unused variable errors when compiling with SDL_VIDEO_DRIVER_X11_XINERAMA undefined.

src/video/x11/SDL_x11modes.c:505:22: error: unused variable 'vm_error' [-Werror,-Wunused-variable]

src/video/x11/SDL_x11modes.c:505:12: error: unused variable 'vm_event' [-Werror,-Wunused-variable]
src/video/x11/SDL_x11modes.c
     1.1 --- a/src/video/x11/SDL_x11modes.c	Sat Nov 04 22:03:28 2017 -0700
     1.2 +++ b/src/video/x11/SDL_x11modes.c	Sat Nov 04 22:06:40 2017 -0700
     1.3 @@ -148,9 +148,6 @@
     1.4      return SDL_PIXELFORMAT_UNKNOWN;
     1.5  }
     1.6  
     1.7 -/* Global for the error handler */
     1.8 -static int vm_event, vm_error = -1;
     1.9 -
    1.10  #if SDL_VIDEO_DRIVER_X11_XINERAMA
    1.11  static SDL_bool
    1.12  CheckXinerama(Display * display, int *major, int *minor)
    1.13 @@ -509,6 +506,7 @@
    1.14  static SDL_bool
    1.15  CheckVidMode(Display * display, int *major, int *minor)
    1.16  {
    1.17 +    int vm_event, vm_error = -1;
    1.18      /* Default the extension not available */
    1.19      *major = *minor = 0;
    1.20  
    1.21 @@ -528,7 +526,6 @@
    1.22      }
    1.23  
    1.24      /* Query the extension version */
    1.25 -    vm_error = -1;
    1.26      if (!X11_XF86VidModeQueryExtension(display, &vm_event, &vm_error)
    1.27          || !X11_XF86VidModeQueryVersion(display, major, minor)) {
    1.28  #ifdef X11MODES_DEBUG