mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] sandbox: sdl: fix use of variable before it was defined
@ 2024-12-04 14:02 Ahmad Fatoum
  2024-12-06 10:00 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-12-04 14:02 UTC (permalink / raw)
  To: barebox; +Cc: Alaa Ali, Ahmad Fatoum

handle_sdl_events() makes use of the shutdown variable, but that
variable is only defined later. Move the variable definitions earlier to
fix the build breakage when SDL is enabled.

Fixes: 231c906e52df ("sandbox: sdl: Fix unresponsive SDL GUI by handling SDL_QUIT events")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/sandbox/os/sdl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/sandbox/os/sdl.c b/arch/sandbox/os/sdl.c
index 6f87273aced2..87c8265ea99f 100644
--- a/arch/sandbox/os/sdl.c
+++ b/arch/sandbox/os/sdl.c
@@ -13,6 +13,10 @@ static void sdl_perror(const char *what)
 	printf("SDL: Could not %s: %s.\n", what, SDL_GetError());
 }
 
+static struct sdl_fb_info info;
+static SDL_atomic_t shutdown;
+SDL_Window *window;
+
 static void handle_sdl_events(void)
 {
 	SDL_Event event;
@@ -23,10 +27,6 @@ static void handle_sdl_events(void)
 	}
 }
 
-static struct sdl_fb_info info;
-static SDL_atomic_t shutdown;
-SDL_Window *window;
-
 static int scanout(void *ptr)
 {
 	SDL_Renderer *renderer;
-- 
2.39.5




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH master] sandbox: sdl: fix use of variable before it was defined
  2024-12-04 14:02 [PATCH master] sandbox: sdl: fix use of variable before it was defined Ahmad Fatoum
@ 2024-12-06 10:00 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-12-06 10:00 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum; +Cc: Alaa Ali


On Wed, 04 Dec 2024 15:02:27 +0100, Ahmad Fatoum wrote:
> handle_sdl_events() makes use of the shutdown variable, but that
> variable is only defined later. Move the variable definitions earlier to
> fix the build breakage when SDL is enabled.
> 
> 

Applied, thanks!

[1/1] sandbox: sdl: fix use of variable before it was defined
      https://git.pengutronix.de/cgit/barebox/commit/?id=d7e4fab928a6 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-06 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-04 14:02 [PATCH master] sandbox: sdl: fix use of variable before it was defined Ahmad Fatoum
2024-12-06 10:00 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox