From 9e5b242142cda73a8b1ae8ae52aa927999b5481d Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 21 Oct 2022 15:48:40 +0200 Subject: [PATCH] removed unused function parameter This issue was found by using GCC with option "-Wextra". --- src/events.c | 9 +++------ src/libgame/system.c | 2 +- src/libgame/system.h | 2 +- src/screens.c | 6 +++--- src/tools.c | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/events.c b/src/events.c index c1c5e00d..39a1e4e9 100644 --- a/src/events.c +++ b/src/events.c @@ -1458,16 +1458,13 @@ void HandlePauseResumeEvent(PauseResumeEvent *event) void HandleKeyEvent(KeyEvent *event) { int key_status = (event->type == EVENT_KEYPRESS ? KEY_PRESSED : KEY_RELEASED); - boolean with_modifiers = (game_status == GAME_MODE_PLAYING ? FALSE : TRUE); - Key key = GetEventKey(event, with_modifiers); - Key keymod = (with_modifiers ? GetEventKey(event, FALSE) : key); + Key key = GetEventKey(event); #if DEBUG_EVENTS_KEY - Debug("event:key", "key was %s, keysym.scancode == %d, keysym.sym == %d, keymod = %d, GetKeyModState() = 0x%04x, resulting key == %d (%s)", + Debug("event:key", "key was %s, keysym.scancode == %d, keysym.sym == %d, GetKeyModState() = 0x%04x, resulting key == %d (%s)", event->type == EVENT_KEYPRESS ? "pressed" : "released", event->keysym.scancode, event->keysym.sym, - keymod, GetKeyModState(), key, getKeyNameFromKey(key)); @@ -1495,7 +1492,7 @@ void HandleKeyEvent(KeyEvent *event) } #endif - HandleKeyModState(keymod, key_status); + HandleKeyModState(key, key_status); // process all keys if not in text input mode or if non-printable keys if (!checkTextInputKey(key)) diff --git a/src/libgame/system.c b/src/libgame/system.c index fcde13d3..b1d667c2 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -1717,7 +1717,7 @@ void CheckQuitEvent(void) program.exit_function(0); } -Key GetEventKey(KeyEvent *event, boolean with_modifiers) +Key GetEventKey(KeyEvent *event) { // key up/down events in SDL2 do not return text characters anymore return event->keysym.sym; diff --git a/src/libgame/system.h b/src/libgame/system.h index c1da0145..9b4dece1 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -2046,7 +2046,7 @@ void WaitEvent(Event *event); void PeekEvent(Event *event); void PumpEvents(void); void CheckQuitEvent(void); -Key GetEventKey(KeyEvent *, boolean); +Key GetEventKey(KeyEvent *); KeyMod HandleKeyModState(Key, int); KeyMod GetKeyModState(void); KeyMod GetKeyModStateFromEvents(void); diff --git a/src/screens.c b/src/screens.c index 3411595b..b7ad82d4 100644 --- a/src/screens.c +++ b/src/screens.c @@ -7682,7 +7682,7 @@ static Key getSetupKey(void) { case EVENT_KEYPRESS: { - key = GetEventKey((KeyEvent *)&event, TRUE); + key = GetEventKey((KeyEvent *)&event); // press 'Escape' or 'Enter' to keep the existing key binding if (key == KSYM_Escape || key == KSYM_Return) @@ -8479,7 +8479,7 @@ static boolean CustomizeKeyboardMain(int player_nr) { case EVENT_KEYPRESS: { - Key key = GetEventKey((KeyEvent *)&event, FALSE); + Key key = GetEventKey((KeyEvent *)&event); // press 'Escape' to abort and keep the old key bindings if (key == KSYM_Escape) @@ -9130,7 +9130,7 @@ static boolean ConfigureVirtualButtonsMain(void) case EVENT_KEYPRESS: { - Key key = GetEventKey((KeyEvent *)&event, FALSE); + Key key = GetEventKey((KeyEvent *)&event); action = (key == KSYM_Escape ? ACTION_ESCAPE : key == KSYM_BackSpace || diff --git a/src/tools.c b/src/tools.c index ed526420..627c77c6 100644 --- a/src/tools.c +++ b/src/tools.c @@ -4603,7 +4603,7 @@ static int RequestHandleEvents(unsigned int req_state, int draw_buffer_game) case EVENT_KEYPRESS: { - Key key = GetEventKey((KeyEvent *)&event, TRUE); + Key key = GetEventKey((KeyEvent *)&event); switch (key) { -- 2.34.1