From c5429bd975e0ced31046cb88dcc4ed9beb542a41 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 4 Nov 2017 22:06:40 -0700 Subject: [PATCH] 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 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index d7c032dfe..6496ea059 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