x11: Move screen_w/h inside the only ifdef they are referenced in to avoid compiler warnings
authorBrandon Schaefer <brandon.schaefer@canonical.com>
Mon, 21 Aug 2017 23:44:46 -0700
changeset 11344039ef928e200
parent 11343 61c9cb81ea51
child 11345 6120f75935f9
x11: Move screen_w/h inside the only ifdef they are referenced in to avoid compiler warnings
src/video/x11/SDL_x11modes.c
     1.1 --- a/src/video/x11/SDL_x11modes.c	Mon Aug 21 17:22:00 2017 -0700
     1.2 +++ b/src/video/x11/SDL_x11modes.c	Mon Aug 21 23:44:46 2017 -0700
     1.3 @@ -825,8 +825,6 @@
     1.4      int nmodes;
     1.5      XF86VidModeModeInfo ** modes;
     1.6  #endif
     1.7 -    int screen_w;
     1.8 -    int screen_h;
     1.9      SDL_DisplayMode mode;
    1.10  
    1.11      /* Unfortunately X11 requires the window to be created with the correct
    1.12 @@ -838,11 +836,14 @@
    1.13      mode.format = sdl_display->current_mode.format;
    1.14      mode.driverdata = NULL;
    1.15  
    1.16 -    screen_w = DisplayWidth(display, data->screen);
    1.17 -    screen_h = DisplayHeight(display, data->screen);
    1.18 -
    1.19  #if SDL_VIDEO_DRIVER_X11_XINERAMA
    1.20      if (data->use_xinerama) {
    1.21 +        int screen_w;
    1.22 +        int screen_h;
    1.23 +
    1.24 +        screen_w = DisplayWidth(display, data->screen);
    1.25 +        screen_h = DisplayHeight(display, data->screen);
    1.26 +
    1.27          if (data->use_vidmode && !data->xinerama_info.x_org && !data->xinerama_info.y_org &&
    1.28             (screen_w > data->xinerama_info.width || screen_h > data->xinerama_info.height)) {
    1.29              SDL_DisplayModeData *modedata;