Fixed building with C89 compiler

main
Sam Lantinga 2022-05-30 12:02:08 -07:00
parent 4ddf85b1d5
commit c87b0142fe
1 changed files with 7 additions and 6 deletions

View File

@ -116,6 +116,8 @@ Android_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display
SDL_LockMutex(Android_ActivityMutex);
if (window == Android_Window) {
SDL_WindowData *data;
int old_w, old_h, new_w, new_h;
/* If the window is being destroyed don't change visible state */
if (!window->is_destroying) {
@ -132,8 +134,7 @@ Android_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display
goto endfunction;
}
SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
data = (SDL_WindowData *)window->driverdata;
if (!data || !data->native_window) {
if (data && !data->native_window) {
SDL_SetError("Missing native window");
@ -141,11 +142,11 @@ Android_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display
goto endfunction;
}
int old_w = window->w;
int old_h = window->h;
old_w = window->w;
old_h = window->h;
int new_w = ANativeWindow_getWidth(data->native_window);
int new_h = ANativeWindow_getHeight(data->native_window);
new_w = ANativeWindow_getWidth(data->native_window);
new_h = ANativeWindow_getHeight(data->native_window);
if (new_w < 0 || new_h < 0) {
SDL_SetError("ANativeWindow_getWidth/Height() fails");