From d41e48e4c68481945d326911e22040583867d92b Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 30 May 2024 02:04:37 +0300 Subject: [PATCH] WIN_AdjustWindowRectWithStyle: silence gcc maybe-uninitialized warnings /tmp/SDL3/src/video/windows/SDL_windowswindow.c: In function 'WIN_SetWindowPositionInternal': /tmp/SDL3/src/video/windows/SDL_windowswindow.c:216:17: warning: 'h' may be used uninitialized in this function [-Wmaybe-uninitialized] rect.bottom = *height; ~~~~~~~~~~~~^~~~~~~~~ /tmp/SDL3/src/video/windows/SDL_windowswindow.c:320:12: note: 'h' was declared here int w, h; ^ /tmp/SDL3/src/video/windows/SDL_windowswindow.c:215:16: warning: 'w' may be used uninitialized in this function [-Wmaybe-uninitialized] rect.right = *width; ~~~~~~~~~~~^~~~~~~~ /tmp/SDL3/src/video/windows/SDL_windowswindow.c:320:9: note: 'w' was declared here int w, h; ^ --- src/video/windows/SDL_windowswindow.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index 542a8dbf69..65185ec87c 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -206,6 +206,8 @@ static int WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, DWORD default: /* Should never be here */ SDL_assert_release(SDL_FALSE); + *width = 0; + *height = 0; } /* Copy the client size in pixels into this rect structure,