Commit c5429bd975e0ced31046cb88dcc4ed9beb542a41

Sam Lantinga 2017-11-04T22:06:40

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]

diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c
index d7c032d..6496ea0 100644
--- a/src/video/x11/SDL_x11modes.c
+++ b/src/video/x11/SDL_x11modes.c
@@ -148,9 +148,6 @@ X11_GetPixelFormatFromVisualInfo(Display * display, XVisualInfo * vinfo)
     return SDL_PIXELFORMAT_UNKNOWN;
 }
 
-/* Global for the error handler */
-static int vm_event, vm_error = -1;
-
 #if SDL_VIDEO_DRIVER_X11_XINERAMA
 static SDL_bool
 CheckXinerama(Display * display, int *major, int *minor)
@@ -509,6 +506,7 @@ X11_InitModes_XRandR(_THIS)
 static SDL_bool
 CheckVidMode(Display * display, int *major, int *minor)
 {
+    int vm_event, vm_error = -1;
     /* Default the extension not available */
     *major = *minor = 0;
 
@@ -528,7 +526,6 @@ CheckVidMode(Display * display, int *major, int *minor)
     }
 
     /* Query the extension version */
-    vm_error = -1;
     if (!X11_XF86VidModeQueryExtension(display, &vm_event, &vm_error)
         || !X11_XF86VidModeQueryVersion(display, major, minor)) {
 #ifdef X11MODES_DEBUG