From f02e5d3a9ff65d1399afd8b3d927e8b79b74b976 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 19 May 2023 05:33:56 +0200 Subject: [PATCH] C++11 fallthrough (1/2) --- .../AUCarbonViewBase/AUCarbonViewControl.cpp | 2 +- libs/ardour/automatable.cc | 2 +- libs/ardour/gain_control.cc | 10 +++++----- libs/ardour/lua_api.cc | 4 ++-- libs/ardour/parameter_descriptor.cc | 12 ++++++------ libs/ardour/plugin_insert.cc | 2 +- libs/ardour/session_events.cc | 2 +- libs/ardour/session_playlists.cc | 2 +- libs/ardour/session_state.cc | 2 +- libs/ardour/vst3_plugin.cc | 2 +- .../portaudio/winmmemidi_output_device.cc | 4 ++-- libs/evoral/Curve.cc | 6 +++--- libs/gtkmm2ext/keyboard.cc | 2 +- libs/midi++2/parser.cc | 2 +- libs/pbd/pbd/natsort.h | 2 +- libs/surfaces/faderport8/faderport8.cc | 2 +- .../launch_control_xl/launch_control_xl.cc | 2 +- libs/surfaces/osc/osc.cc | 16 ++++++++-------- libs/widgets/ardour_icon.cc | 8 ++++---- session_utils/export.cc | 2 +- 20 files changed, 43 insertions(+), 43 deletions(-) diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp index 0867869140..531bf22785 100644 --- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp +++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp @@ -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); diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index 08e0d3707a..c9457e9f5f 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -375,7 +375,7 @@ Automatable::protect_automation () l->set_automation_state (Off); break; case Latch: - /* fallthrough */ + [[fallthrough]]; case Touch: l->set_automation_state (Play); break; diff --git a/libs/ardour/gain_control.cc b/libs/ardour/gain_control.cc index 4c2c471032..f11c07cf15 100644 --- a/libs/ardour/gain_control.cc +++ b/libs/ardour/gain_control.cc @@ -39,9 +39,9 @@ static std::string gain_control_name (Evoral::Parameter const& param) { switch (param.type()) { case GainAutomation: - /* fallthrough */ + [[fallthrough]]; case BusSendLevel: - /* fallthrough */ + [[fallthrough]]; case InsertReturnLevel: return X_("gaincontrol"); case TrimAutomation: @@ -61,11 +61,11 @@ static std::shared_ptr automation_list_new (Evoral::Parameter co { switch (param.type()) { case GainAutomation: - /* fallthrough */ + [[fallthrough]]; case BusSendLevel: - /* fallthrough */ + [[fallthrough]]; case InsertReturnLevel: - /* fallthrough */ + [[fallthrough]]; case TrimAutomation: return std::shared_ptr (new AutomationList (param, Temporal::AudioTime)); case MainOutVolume: diff --git a/libs/ardour/lua_api.cc b/libs/ardour/lua_api.cc index a29f75ac2b..4840f7bd86 100644 --- a/libs/ardour/lua_api.cc +++ b/libs/ardour/lua_api.cc @@ -839,9 +839,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: diff --git a/libs/ardour/parameter_descriptor.cc b/libs/ardour/parameter_descriptor.cc index 3a0a1954d5..2c72b182c3 100644 --- a/libs/ardour/parameter_descriptor.cc +++ b/libs/ardour/parameter_descriptor.cc @@ -56,10 +56,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; @@ -325,16 +325,16 @@ 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 TrimAutomation: - /* fallthrough */ + [[fallthrough]]; case MainOutVolume: { const float lower_db = accurate_coefficient_to_dB (lower); diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index b06bd6090b..601d33d920 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -2073,7 +2073,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 */ diff --git a/libs/ardour/session_events.cc b/libs/ardour/session_events.cc index 7cedffa520..f41536966b 100644 --- a/libs/ardour/session_events.cc +++ b/libs/ardour/session_events.cc @@ -389,7 +389,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; diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index a3b48d17aa..f0936c0dce 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -495,7 +495,7 @@ SessionPlaylists::maybe_delete_unused (boost::functioncoeff[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)); } diff --git a/libs/gtkmm2ext/keyboard.cc b/libs/gtkmm2ext/keyboard.cc index bf0a4a47c5..04985b84e0 100644 --- a/libs/gtkmm2ext/keyboard.cc +++ b/libs/gtkmm2ext/keyboard.cc @@ -561,7 +561,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"); diff --git a/libs/midi++2/parser.cc b/libs/midi++2/parser.cc index da75aec248..30f4fe5c07 100644 --- a/libs/midi++2/parser.cc +++ b/libs/midi++2/parser.cc @@ -501,7 +501,7 @@ Parser::scanner (unsigned char inbyte) if (msgindex < 3) { return; } - /* fallthrough */ + [[fallthrough]]; case NEEDONEBYTE: /* We've completed a 1 or 2 byte message. */ diff --git a/libs/pbd/pbd/natsort.h b/libs/pbd/pbd/natsort.h index 3ba37fb703..ca86a10053 100644 --- a/libs/pbd/pbd/natsort.h +++ b/libs/pbd/pbd/natsort.h @@ -52,7 +52,7 @@ order_of_magnitude (const char* i) case 'd': return 100; case 'k': - /* fallthrough */ + [[fallthrough]]; case 'K': return 1e6; case 'M': diff --git a/libs/surfaces/faderport8/faderport8.cc b/libs/surfaces/faderport8/faderport8.cc index d7e10de772..6a276eb945 100644 --- a/libs/surfaces/faderport8/faderport8.cc +++ b/libs/surfaces/faderport8/faderport8.cc @@ -1002,7 +1002,7 @@ FaderPort8::filter_stripables (StripableList& strips) const break; default: assert (0); - /* fallthrough */ + [[fallthrough]]; case MixAll: allow_master = true; flt = &flt_all; diff --git a/libs/surfaces/launch_control_xl/launch_control_xl.cc b/libs/surfaces/launch_control_xl/launch_control_xl.cc index 3938cafd82..4444f040f0 100644 --- a/libs/surfaces/launch_control_xl/launch_control_xl.cc +++ b/libs/surfaces/launch_control_xl/launch_control_xl.cc @@ -999,7 +999,7 @@ LaunchControlXL::filter_stripables(StripableList& strips) const switch ((int)template_number()) { default: - /* FALLTHROUGH */ + [[fallthrough]]; case 8: flt = &flt_default; break; diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 824c4312aa..64f93eec89 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -1686,56 +1686,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); diff --git a/libs/widgets/ardour_icon.cc b/libs/widgets/ardour_icon.cc index e222fd2a9a..4717e4d11f 100644 --- a/libs/widgets/ardour_icon.cc +++ b/libs/widgets/ardour_icon.cc @@ -1377,9 +1377,9 @@ ArdourWidgets::ArdourIcon::render (cairo_t* cr icon_transport_panic (cr, width, height); break; case TransportStart: - /* fallthrough */ + [[fallthrough]]; case TransportEnd: - /* fallthrough */ + [[fallthrough]]; case TransportRange: icon_transport_ck (cr, icon, width, height); break; @@ -1417,9 +1417,9 @@ ArdourWidgets::ArdourIcon::render (cairo_t* cr icon_nudge_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; diff --git a/session_utils/export.cc b/session_utils/export.cc index 735a2189db..2e5fd18ed4 100644 --- a/session_utils/export.cc +++ b/session_utils/export.cc @@ -277,7 +277,7 @@ int main (int argc, char* argv[]) settings._sample_format = ExportFormatBase::SF_Float; break; } - /* fallthrough */ + [[fallthrough]]; default: fprintf(stderr, "Invalid Bit Depth\n"); break;