cmake: add -Wimplicit-fallthrough warning

This commit is contained in:
Anonymous Maarten authored and Anonymous Maarten committed 2024-03-18 20:34:50 +01:00
1 parent 086a7a4687
commit f59dbf6a12
10 files changed
+22 -6

No files matched your search

+1
View File
@@ -188,6 +188,7 @@ static int audio_initOpenCloseQuitAudio(void *arg)
desired.freq = 22050;
desired.format = SDL_AUDIO_S16;
desired.channels = 2;
break;
case 1:
/* Set custom desired spec */
+2 -2
View File
@@ -1383,7 +1383,7 @@ pen_movementAndAxes(void *arg)
case SIMPEN_ACTION_PRESS:
SDLTest_AssertCheck(event.type == SDL_EVENT_PEN_BUTTON_DOWN, "Expected PENBUTTONDOWN event (but got 0x%lx)", (unsigned long) event.type);
SDLTest_AssertCheck(event.pbutton.state == SDL_PRESSED, "Expected PRESSED button");
/* Fall through */
SDL_FALLTHROUGH;
case SIMPEN_ACTION_RELEASE:
if (last_action->type == SIMPEN_ACTION_RELEASE) {
SDLTest_AssertCheck(event.type == SDL_EVENT_PEN_BUTTON_UP, "Expected PENBUTTONUP event (but got 0x%lx)", (unsigned long) event.type);
@@ -1401,7 +1401,7 @@ pen_movementAndAxes(void *arg)
case SIMPEN_ACTION_DOWN:
SDLTest_AssertCheck(event.type == SDL_EVENT_PEN_DOWN, "Expected PENBUTTONDOWN event (but got 0x%lx)", (unsigned long) event.type);
SDLTest_AssertCheck(event.ptip.state == SDL_PRESSED, "Expected PRESSED button");
/* Fall through */
SDL_FALLTHROUGH;
case SIMPEN_ACTION_UP:
if (last_action->type == SIMPEN_ACTION_UP) {
SDLTest_AssertCheck(event.type == SDL_EVENT_PEN_UP, "Expected PENBUTTONUP event (but got 0x%lx)", (unsigned long) event.type);
+1
View File
@@ -508,6 +508,7 @@ static void loop(void)
switch (event.key.keysym.sym) {
case SDLK_ESCAPE:
done = 1;
break;
case SDLK_SPACE:
case SDLK_RIGHT:
NextStage();
+1
View File
@@ -282,6 +282,7 @@ static void loop(void)
if (event.key.keysym.sym != SDLK_ESCAPE) {
break;
}
break;
default:
break;
}
+5 -4
View File
@@ -65,7 +65,7 @@ get_channel_name(int channel_index, int channel_count)
case 8:
return "Back Left";
}
SDL_assert(0);
break;
case 5:
switch (channel_count) {
case 6:
@@ -75,7 +75,7 @@ get_channel_name(int channel_index, int channel_count)
case 8:
return "Back Right";
}
SDL_assert(0);
break;
case 6:
switch (channel_count) {
case 7:
@@ -83,11 +83,12 @@ get_channel_name(int channel_index, int channel_count)
case 8:
return "Side Left";
}
SDL_assert(0);
break;
case 7:
return "Side Right";
}
SDLTest_AssertCheck(SDL_FALSE, "Invalid channel_index for channel_count: channel_count=%d channel_index=%d", channel_count, channel_index);
SDL_assert(0);
return NULL;
}