mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-11 06:28:24 +02:00
cmake: add -Wimplicit-fallthrough warning
This commit is contained in:
committed by
Anonymous Maarten
parent
086a7a4687
commit
f59dbf6a12
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -282,6 +282,7 @@ static void loop(void)
|
||||
if (event.key.keysym.sym != SDLK_ESCAPE) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user