Compile fix for android.
authorSam Lantinga <slouken@libsdl.org>
Tue, 14 Mar 2017 07:22:08 -0700
changeset 109379ff840e45cfb
parent 10936 7ef6524d95c4
child 10938 90e5cb81c483
Compile fix for android.

"ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]"

Moving some variable declarations to the top of Android_SetScreenResolution()
src/video/android/SDL_androidvideo.c
     1.1 --- a/src/video/android/SDL_androidvideo.c	Tue Mar 14 07:20:14 2017 -0700
     1.2 +++ b/src/video/android/SDL_androidvideo.c	Tue Mar 14 07:22:08 2017 -0700
     1.3 @@ -193,6 +193,8 @@
     1.4  void
     1.5  Android_SetScreenResolution(int width, int height, Uint32 format, float rate)
     1.6  {
     1.7 +	SDL_VideoDevice* device;
     1.8 +	SDL_VideoDisplay *display;
     1.9      Android_ScreenWidth = width;
    1.10      Android_ScreenHeight = height;
    1.11      Android_ScreenFormat = format;
    1.12 @@ -204,10 +206,10 @@
    1.13        example happen when the Activity enters or exists immersive mode,
    1.14        which can happen after VideoInit().
    1.15      */
    1.16 -    SDL_VideoDevice* device = SDL_GetVideoDevice();
    1.17 +    device = SDL_GetVideoDevice();
    1.18      if (device && device->num_displays > 0)
    1.19      {
    1.20 -        SDL_VideoDisplay* display = &device->displays[0];
    1.21 +        display = &device->displays[0];
    1.22          display->desktop_mode.format = Android_ScreenFormat;
    1.23          display->desktop_mode.w = Android_ScreenWidth;
    1.24          display->desktop_mode.h = Android_ScreenHeight;
    1.25 @@ -219,7 +221,7 @@
    1.26  
    1.27          /* Force the current mode to match the resize otherwise the SDL_WINDOWEVENT_RESTORED event
    1.28           * will fall back to the old mode */
    1.29 -        SDL_VideoDisplay *display = SDL_GetDisplayForWindow(Android_Window);
    1.30 +        display = SDL_GetDisplayForWindow(Android_Window);
    1.31  
    1.32          display->current_mode.format = format;
    1.33          display->current_mode.w = width;