Remove fall-through pragmas

This commit is contained in:
Krzysiek Egzmont
2023-10-16 16:52:32 +02:00
parent d3a2a7bee9
commit a26c397417
10 changed files with 21 additions and 73 deletions

View File

@@ -403,11 +403,9 @@ void MENU_AcceptSetting(void)
gRequestSaveChannel = 1;
return;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
case MENU_T_CTCS:
pConfig = &gTxVfo->freq_config_TX;
[[fallthrough]];
case MENU_R_CTCS:
if (gSubMenuSelection == 0)
{
@@ -434,8 +432,6 @@ void MENU_AcceptSetting(void)
gRequestSaveChannel = 1;
return;
#pragma GCC diagnostic pop
case MENU_SFT_D:
gTxVfo->TX_OFFSET_FREQUENCY_DIRECTION = gSubMenuSelection;
gRequestSaveChannel = 1;
@@ -1154,7 +1150,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
if (edit_index < 10)
{
if (Key >= KEY_0 && Key <= KEY_9)
if (Key <= KEY_9)
{
edit[edit_index] = '0' + Key - KEY_0;
@@ -1177,9 +1173,6 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
if (!gIsInSubMenu)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
switch (gInputBoxIndex)
{
case 2:
@@ -1199,7 +1192,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gInputBox[0] = gInputBox[1];
gInputBoxIndex = 1;
[[fallthrough]];
case 1:
Value = gInputBox[0];
if (Value > 0 && Value <= gMenuListCount)
@@ -1211,8 +1204,6 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
break;
}
#pragma GCC diagnostic pop
gInputBoxIndex = 0;
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
@@ -1653,9 +1644,6 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
VFO = 0;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
switch (GetCurrentMenuId())
{
case MENU_DEL_CH:
@@ -1666,6 +1654,7 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
case MENU_SLIST2:
VFO = 1;
[[fallthrough]];
case MENU_SLIST1:
bCheckScanList = true;
break;
@@ -1676,8 +1665,6 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
return;
}
#pragma GCC diagnostic pop
Channel = RADIO_FindNextChannel(gSubMenuSelection + Direction, Direction, bCheckScanList, VFO);
if (Channel != 0xFF)
gSubMenuSelection = Channel;