cmake: add -Wimplicit-fallthrough warning
parent
086a7a4687
commit
f59dbf6a12
|
@ -105,6 +105,11 @@ function(SDL_AddCommonCompilerFlags TARGET)
|
|||
if(HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS)
|
||||
sdl_target_compile_option_all_languages(${TARGET} "-Wno-unused-local-typedefs")
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag(-Wimplicit-fallthrough HAVE_GCC_WIMPLICIT_FALLTHROUGH)
|
||||
if(HAVE_GCC_WIMPLICIT_FALLTHROUGH)
|
||||
sdl_target_compile_option_all_languages(${TARGET} "-Wimplicit-fallthrough")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_WERROR)
|
||||
|
|
|
@ -542,6 +542,7 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode,
|
|||
if (down == 0) {
|
||||
chg_vc_kbd_led(kbd, ALKED);
|
||||
}
|
||||
SDL_FALLTHROUGH;
|
||||
case LSH: /* left shift */
|
||||
case RSH: /* right shift */
|
||||
k_shift(kbd, 0, down == 0);
|
||||
|
@ -551,6 +552,7 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode,
|
|||
if (down == 0) {
|
||||
chg_vc_kbd_led(kbd, ALKED);
|
||||
}
|
||||
SDL_FALLTHROUGH;
|
||||
case LCTR: /* left ctrl */
|
||||
case RCTR: /* right ctrl */
|
||||
k_shift(kbd, 1, down == 0);
|
||||
|
@ -560,6 +562,7 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode,
|
|||
if (down == 0) {
|
||||
chg_vc_kbd_led(kbd, ALKED);
|
||||
}
|
||||
SDL_FALLTHROUGH;
|
||||
case LALT: /* left alt */
|
||||
case RALT: /* right alt */
|
||||
k_shift(kbd, 2, down == 0);
|
||||
|
|
|
@ -573,6 +573,7 @@ int SDL_SendPenMotion(Uint64 timestamp,
|
|||
event.motion.yrel = last_y - y;
|
||||
return (SDL_PushEvent(&event) > 0) || posted;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -2005,6 +2005,7 @@ static void HandleInputEvents(SDL_Joystick *joystick)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -2095,6 +2096,7 @@ static void HandleInputEvents(SDL_Joystick *joystick)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -404,6 +404,7 @@ void VITA_ImeEventHandler(void *arg, const SceImeEventData *e)
|
|||
break;
|
||||
case SCE_IME_EVENT_PRESS_ENTER:
|
||||
SDL_SendKeyboardKeyAutoRelease(0, SDL_SCANCODE_RETURN);
|
||||
break;
|
||||
case SCE_IME_EVENT_PRESS_CLOSE:
|
||||
sceImeClose();
|
||||
videodata->ime_active = SDL_FALSE;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue