From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Alaa Ali <alaanourali@gmail.com>, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master] sandbox: sdl: fix use of variable before it was defined
Date: Wed, 4 Dec 2024 15:02:27 +0100 [thread overview]
Message-ID: <20241204140227.170560-1-a.fatoum@pengutronix.de> (raw)
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
next reply other threads:[~2024-12-04 15:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 14:02 Ahmad Fatoum [this message]
2024-12-06 10:00 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241204140227.170560-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=alaanourali@gmail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox