From 04e8aeb2478809522fb49ce3bd5ad466053acb4c Mon Sep 17 00:00:00 2001 From: Louis Gombert Date: Sat, 20 Apr 2024 15:11:24 +0200 Subject: [PATCH] Fix -Wswitch --- Descent3/CtlCfgElem.cpp | 6 +++++- Descent3/gamesequence.cpp | 10 ++++++++++ Descent3/mmItem.cpp | 2 ++ ddio_lnx/lnxkey.cpp | 2 ++ lnxcontroller/lnxcontroller.cpp | 2 ++ netgames/dmfc/dmfcstats.cpp | 4 ++++ 6 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Descent3/CtlCfgElem.cpp b/Descent3/CtlCfgElem.cpp index 6ec4ce12..380a0e89 100644 --- a/Descent3/CtlCfgElem.cpp +++ b/Descent3/CtlCfgElem.cpp @@ -296,7 +296,7 @@ char Ctltext_KeyBindings[][16] = {"", "", "", "", - "padƒ\0\0\0\0\0\0", + "pad�\0\0\0\0\0\0", #ifdef MACINTOSH "ctrl\0\0\0\0\0", #else @@ -828,6 +828,8 @@ bool cfg_element::Configure(ct_type *new_elem_type, ubyte *controller, ubyte *ne // check if we can configure this slot. switch (ctype_fn[slot]) { + case ctNone: + break; case ctKey: configure = true; break; @@ -886,6 +888,8 @@ void cfg_element_ui::Create(const char *title, ct_type type, ubyte controller, u newuiSheet *sheet = newuiMessageBox::GetSheet(); switch (type) { + case ctNone: + break; case ctKey: sheet->AddText(TXT_CTLBINDHELP1); break; diff --git a/Descent3/gamesequence.cpp b/Descent3/gamesequence.cpp index c0626a15..65fe44ae 100644 --- a/Descent3/gamesequence.cpp +++ b/Descent3/gamesequence.cpp @@ -1161,6 +1161,14 @@ bool GameSequencer() { // interpret current function mode. switch (GetFunctionMode()) { + case INIT_MODE: + case GAME_MODE: + case EDITOR_MODE: + case EDITOR_GAME_MODE: + case MENU_MODE: + case QUIT_MODE: + case CREDITS_MODE: + break; case RESTORE_GAME_MODE: case LOADDEMO_MODE: case GAMEGAUGE_MODE: @@ -1173,6 +1181,8 @@ bool GameSequencer() { old_game_state = Game_state; switch (Game_state) { + case GAMESTATE_IDLE: + break; case GAMESTATE_NEW: StartNewGame(); SetGameState(GAMESTATE_LVLSTART); diff --git a/Descent3/mmItem.cpp b/Descent3/mmItem.cpp index a5275a2f..f6111c5b 100644 --- a/Descent3/mmItem.cpp +++ b/Descent3/mmItem.cpp @@ -258,6 +258,8 @@ void mmItem::OnDraw() { if ((UI_TIME() - m_last_frametime) >= m_process_speed) { // process special fx. switch (m_curfx) { + case mmItemFXNull: + break; case mmItemFXNormal: m_alpha = MMITEM_ALPHA; m_satcount = MMITEM_SAT; diff --git a/ddio_lnx/lnxkey.cpp b/ddio_lnx/lnxkey.cpp index 1d8a10f3..f1f80a07 100644 --- a/ddio_lnx/lnxkey.cpp +++ b/ddio_lnx/lnxkey.cpp @@ -319,6 +319,8 @@ void ddio_InternalResetKey(ubyte key) { bool ddio_KeyFrame() { switch (Keyboard_mode) { + case Input_sdl: + break; case Input_normal: return ddio_normal_KeyFrame(); case Input_null: diff --git a/lnxcontroller/lnxcontroller.cpp b/lnxcontroller/lnxcontroller.cpp index 19221082..e1e4486f 100644 --- a/lnxcontroller/lnxcontroller.cpp +++ b/lnxcontroller/lnxcontroller.cpp @@ -273,6 +273,8 @@ ct_config_data lnxgameController::get_controller_value(ct_type type_req) { switch (type_req) { int pov_n; + case ctNone: + break; case ctKey: val = makeword(0, ddio_KeyInKey()); break; diff --git a/netgames/dmfc/dmfcstats.cpp b/netgames/dmfc/dmfcstats.cpp index 05264781..29ebac47 100644 --- a/netgames/dmfc/dmfcstats.cpp +++ b/netgames/dmfc/dmfcstats.cpp @@ -644,6 +644,8 @@ redisplay_list: if (!is_dedicated_server || m_PLColInfo[c].type == DSCOL_PILOT_NAME || m_PLColInfo[c].type == DSCOL_BLANK) { switch (m_PLColInfo[c].type) { + case DSCOL_BMP: + break; case DSCOL_KILLS_LEVEL: snprintf(buffer, sizeof(buffer), "%d", pr->dstats.kills[DSTAT_LEVEL]); break; @@ -1081,6 +1083,8 @@ redisplay_list: buffer[0] = '\0'; if (!is_dedicated_server || m_DColInfo[c].type == DSCOL_PILOT_NAME || m_DColInfo[c].type == DSCOL_BLANK) { switch (m_DColInfo[c].type) { + case DSCOL_BMP: + break; case DSCOL_KILLS_LEVEL: snprintf(buffer, sizeof(buffer), "%d", pr->dstats.kills[DSTAT_LEVEL]); break;