Use C++17 style [[fallthrough]] (1/2)

This commit is contained in:
Robin Gareus committed 2026-09-17 05:39:32 +02:00
1 parent cd6c7901b1
commit 4ee6a46cc4
24 files changed
+59 -59

No files matched your search

@@ -327,7 +327,7 @@ bool AUCarbonViewControl::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef
case kEventControlSetFocusPart: // tab
handled = !handled; // fall through to next case
mLastControl = this;
/* fallthrough */
[[fallthrough]];
case kEventControlValueFieldChanged:
GetEventParameter(event, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &control);
verify(control == mControl);
+1 -1
View File
@@ -432,7 +432,7 @@ Automatable::protect_automation ()
l->set_automation_state (Off);
break;
case Latch:
/* fallthrough */
[[fallthrough]];
case Touch:
l->set_automation_state (Play);
break;
+7 -7
View File
@@ -39,11 +39,11 @@ static std::string gain_control_name (Evoral::Parameter const& param)
{
switch (param.type()) {
case GainAutomation:
/* fallthrough */
[[fallthrough]];
case BusSendLevel:
/* fallthrough */
[[fallthrough]];
case SurroundSendLevel:
/* fallthrough */
[[fallthrough]];
case InsertReturnLevel:
return X_("gaincontrol");
case TrimAutomation:
@@ -63,13 +63,13 @@ static std::shared_ptr<AutomationList> automation_list_new (Evoral::Parameter co
{
switch (param.type()) {
case GainAutomation:
/* fallthrough */
[[fallthrough]];
case BusSendLevel:
/* fallthrough */
[[fallthrough]];
case SurroundSendLevel:
/* fallthrough */
[[fallthrough]];
case InsertReturnLevel:
/* fallthrough */
[[fallthrough]];
case TrimAutomation:
return std::shared_ptr<AutomationList> (new AutomationList (param, Temporal::TimeDomainProvider (Temporal::AudioTime)));
case MainOutVolume:
+2 -2
View File
@@ -963,9 +963,9 @@ LuaTableRef::set (lua_State* L)
}
// invalid userdata -- fall through
}
/* fallthrough */
[[fallthrough]];
case LUA_TFUNCTION: // no support -- we could... string.format("%q", string.dump(value, true))
/* fallthrough */
[[fallthrough]];
case LUA_TTABLE: // no nested tables, sorry.
case LUA_TNIL:
default:
+8 -8
View File
@@ -58,10 +58,10 @@ ParameterDescriptor::ParameterDescriptor(const Evoral::Parameter& parameter)
switch((AutomationType)parameter.type()) {
case BusSendLevel:
/* fallthrough */
[[fallthrough]];
case InsertReturnLevel:
inline_ctrl = true;
/* fallthrough */
[[fallthrough]];
case GainAutomation:
upper = Config->get_max_gain();
normal = 1.0f;
@@ -72,7 +72,7 @@ ParameterDescriptor::ParameterDescriptor(const Evoral::Parameter& parameter)
toggled = true;
break;
case SurroundSendLevel:
/* fallthrough */
[[fallthrough]];
case TrimAutomation:
upper = 10; // +20dB
lower = .1; // -20dB
@@ -430,18 +430,18 @@ ParameterDescriptor::to_interface (float val, bool rotary) const
val = std::min (upper, std::max (lower, val));
switch(type) {
case GainAutomation:
/* fallthrough */
[[fallthrough]];
case BusSendLevel:
/* fallthrough */
[[fallthrough]];
case InsertReturnLevel:
/* fallthrough */
[[fallthrough]];
case EnvelopeAutomation:
val = gain_to_slider_position_with_max (val, upper);
break;
case SurroundSendLevel:
/* fallthrough */
[[fallthrough]];
case TrimAutomation:
/* fallthrough */
[[fallthrough]];
case MainOutVolume:
{
const float lower_db = accurate_coefficient_to_dB (lower);
+1 -1
View File
@@ -2054,7 +2054,7 @@ PluginInsert::configure_io (ChanCount in, ChanCount out)
/* configure plugins */
switch (_match.method) {
case Split:
/* fallthrough */
[[fallthrough]];
case Hide:
if (_plugins.front()->reconfigure_io (natural_input_streams(), ChanCount (), out) == false) {
PluginIoReConfigure (); /* EMIT SIGNAL */
+1 -1
View File
@@ -1010,7 +1010,7 @@ RegionFxPlugin::configure_io (ChanCount in, ChanCount out)
/* configure plugins */
switch (_match.method) {
case Split:
/* fallthrough */
[[fallthrough]];
case Hide:
if (_plugins.front ()->reconfigure_io (natural_input_streams, ChanCount (), out) == false) {
return false;
+2 -2
View File
@@ -228,10 +228,10 @@ RTMidiBufferBase<TimeType,DistanceType>::write (TimeType time, Evoral::EventType
switch (size) {
case 3:
_data[_size].bytes[3] = buf[2];
/* fallthru */
[[fallthrough]];
case 2:
_data[_size].bytes[2] = buf[1];
/* fallthru */
[[fallthrough]];
case 1:
_data[_size].bytes[1] = buf[0];
break;
+1 -1
View File
@@ -388,7 +388,7 @@ std::ostream& operator<<(std::ostream& o, ARDOUR::SessionEvent const& ev) {
o << " force: " << ev.yes_or_no;
break;
case SessionEvent::SetDefaultPlaySpeed:
/* fallthrough */
[[fallthrough]];
case SessionEvent::SetTransportSpeed:
o << " speed: " << ev.speed;
break;
+1 -1
View File
@@ -499,7 +499,7 @@ SessionPlaylists::maybe_delete_unused (std::function<int(std::shared_ptr<Playlis
// delete this and all later
delete_remaining = true;
/* fallthrough */
[[fallthrough]];
case 1:
// delete this
playlists_tbd.push_back (*x);
+2 -2
View File
@@ -3465,7 +3465,7 @@ retry:
case 3:
no_questions_about_missing_files = true;
/* fallthrough */
[[fallthrough]];
case -1:
default:
@@ -5080,7 +5080,7 @@ Session::config_changed (std::string p, bool ours)
#ifndef HAVE_RF64_RIFF
switch (config.get_native_file_header_format ()) {
case MBWF:
/* fallthrough */
[[fallthrough]];
case RF64_WAV:
config.set_native_file_header_format (RF64);
return;
+1 -1
View File
@@ -131,7 +131,7 @@ VST3Plugin::parameter_change_handler (VST3PI::ParameterChange t, uint32_t param,
break;
case VST3PI::ValueChange:
_parameter_queue.write_one (PV (param, value));
/* fallthrough */
[[fallthrough]];
case VST3PI::ParamValueChanged:
/* emit ParameterChangedExternally, mark preset dirty */
Plugin::parameter_changed_externally (param, value);
@@ -430,10 +430,10 @@ WinMMEMidiOutputDevice::midi_output_thread ()
switch (h.size) {
case 3:
message |= (((DWORD)data[2]) << 16);
/* fallthrough */
[[fallthrough]];
case 2:
message |= (((DWORD)data[1]) << 8);
/* fallthrough */
[[fallthrough]];
case 1:
message |= (DWORD)data[0];
result = midiOutShortMsg (m_handle, message);
+2 -2
View File
@@ -715,13 +715,13 @@ clearlooks_style_draw_box (DRAW_ARGS)
{
case (ClearlooksOrientation) GTK_PROGRESS_RIGHT_TO_LEFT:
tmp.x -= 1;
/* fallthrough */
[[fallthrough]];
case (ClearlooksOrientation) GTK_PROGRESS_LEFT_TO_RIGHT:
tmp.width += 1;
break;
case (ClearlooksOrientation) GTK_PROGRESS_BOTTOM_TO_TOP:
tmp.y -= 1;
/* fallthrough */
[[fallthrough]];
case (ClearlooksOrientation) GTK_PROGRESS_TOP_TO_BOTTOM:
tmp.height += 1;
break;
+3 -3
View File
@@ -334,7 +334,7 @@ Curve::_get_vector (Temporal::timepos_t x0, Temporal::timepos_t x1, float *vec,
assert (0);
case ControlList::Curved:
/* no 2 point spline */
/* fallthrough */
[[fallthrough]];
default: // Linear:
for (int i = 0; i < veclen; ++i) {
vec[i] = (lx * (m_num / m_den) + m_num * i * dx_num / (m_den * dx_den)) + c;
@@ -355,7 +355,7 @@ Curve::_get_vector (Temporal::timepos_t x0, Temporal::timepos_t x1, float *vec,
assert (0);
case ControlList::Curved:
/* no 2 point spline */
/* fallthrough */
[[fallthrough]];
default: // Linear:
vec[0] = interpolate_linear (lval, uval, fraction);
break;
@@ -472,7 +472,7 @@ Curve::multipoint_eval (Temporal::timepos_t const & x) const
double xv2 = xv * xv;
return ev->coeff[0] + (ev->coeff[1] * xv) + (ev->coeff[2] * xv2) + (ev->coeff[3] * xv2 * xv);
}
/* fallthrough */
[[fallthrough]];
case ControlList::Linear:
return before->value + (vdelta * (tdelta / trange));
}
+6 -6
View File
@@ -796,17 +796,17 @@ SMF::load_markers ()
allow_empty = true;
break;
case 0x01: // "Text:"
/* fallthtough */
[[fallthrough]];
case 0x02: // "Copyright:"
/* fallthtough */
[[fallthrough]];
case 0x03: // "Sequence/Track Name:"
/* fallthtough */
[[fallthrough]];
case 0x04: // "Instrument:"
/* fallthtough */
[[fallthrough]];
case 0x08: // "Program Name:"
/* fallthtough */
[[fallthrough]];
case 0x09: // "Device (Port) Name:"
/* fallthtough */
[[fallthrough]];
default:
continue;
}
+1 -1
View File
@@ -575,7 +575,7 @@ Keyboard::leave_window (GdkEventCrossing* ev, Gtk::Window* /*win*/)
case GDK_NOTIFY_VIRTUAL:
DEBUG_TRACE (DEBUG::Keyboard, "VIRTUAL crossing ... out\n");
/* fallthrough */
[[fallthrough]];
default:
DEBUG_TRACE (DEBUG::Keyboard, "REAL crossing ... out\n");
+1 -1
View File
@@ -500,7 +500,7 @@ Parser::scanner (unsigned char inbyte)
if (msgindex < 3) {
return;
}
/* fallthrough */
[[fallthrough]];
case NEEDONEBYTE:
/* We've completed a 1 or 2 byte message. */
+1 -1
View File
@@ -53,7 +53,7 @@ order_of_magnitude (const char* i)
case 'd':
return 100;
case 'k':
/* fallthrough */
[[fallthrough]];
case 'K':
return 1e6;
case 'M':
+1 -1
View File
@@ -1013,7 +1013,7 @@ FaderPort8::filter_stripables (StripableList& strips) const
break;
default:
assert (0);
/* fallthrough */
[[fallthrough]];
case MixAll:
allow_master = true;
allow_surround = true;
+8 -8
View File
@@ -1689,56 +1689,56 @@ OSC::surface_parse (const char *path, const char* types, lo_arg **argv, int argc
} else {
linkid = argv[8]->i;
}
/* fallthrough */
[[fallthrough]];
case 8:
if (types[7] == 'f') {
linkset = (int) argv[7]->f;
} else {
linkset = argv[7]->i;
}
/* fallthrough */
[[fallthrough]];
case 7:
if (types[6] == 'f') {
port = (int) argv[6]->f;
} else {
port = argv[6]->i;
}
/* fallthrough */
[[fallthrough]];
case 6:
if (types[5] == 'f') {
pi_page = (int) argv[5]->f;
} else {
pi_page = argv[5]->i;
}
/* fallthrough */
[[fallthrough]];
case 5:
if (types[4] == 'f') {
se_page = (int) argv[4]->f;
} else {
se_page = argv[4]->i;
}
/* fallthrough */
[[fallthrough]];
case 4:
if (types[3] == 'f') {
fadermode = (int) argv[3]->f;
} else {
fadermode = argv[3]->i;
}
/* fallthrough */
[[fallthrough]];
case 3:
if (types[2] == 'f') {
feedback = (int) argv[2]->f;
} else {
feedback = argv[2]->i;
}
/* fallthrough */
[[fallthrough]];
case 2:
if (types[1] == 'f') {
strip_types = (int) argv[1]->f;
} else {
strip_types = argv[1]->i;
}
/* fallthrough */
[[fallthrough]];
case 1:
bank_size = data;
set_surface_port (port, msg);
+1 -1
View File
@@ -3179,7 +3179,7 @@ gdk_event_translate (MSG *msg,
generate_grab_broken_event (_gdk_display->keyboard_grab.window, TRUE, NULL);
}
/* fallthrough */
[[fallthrough]];
case WM_SETFOCUS:
if (_gdk_display->keyboard_grab.window != NULL &&
!_gdk_display->keyboard_grab.owner_events)
+4 -4
View File
@@ -2162,9 +2162,9 @@ ArdourWidgets::ArdourIcon::render (cairo_t* cr
icon_show_eye (cr, width, height, fg_color);
break;
case TransportStart:
/* fallthrough */
[[fallthrough]];
case TransportEnd:
/* fallthrough */
[[fallthrough]];
case TransportRange:
icon_transport_ck (cr, icon, width, height, fg_color);
break;
@@ -2208,9 +2208,9 @@ ArdourWidgets::ArdourIcon::render (cairo_t* cr
icon_arrow_right (cr, width, height, fg_color);
break;
case ZoomIn:
/* fallthrough */
[[fallthrough]];
case ZoomOut:
/* fallthrough */
[[fallthrough]];
case ZoomFull:
icon_zoom (cr, icon, width, height, fg_color);
break;
+1 -1
View File
@@ -281,7 +281,7 @@ int main (int argc, char* argv[])
settings._sample_format = ExportFormatBase::SF_Float;
break;
}
/* fallthrough */
[[fallthrough]];
default:
fprintf(stderr, "Invalid Bit Depth\n");
break;