C++11 fallthrough (1/2)

This commit is contained in:
Robin Gareus 2023-05-19 05:33:56 +02:00
parent d0a66ca389
commit f02e5d3a9f
20 changed files with 43 additions and 43 deletions

View file

@ -327,7 +327,7 @@ bool AUCarbonViewControl::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef
case kEventControlSetFocusPart: // tab case kEventControlSetFocusPart: // tab
handled = !handled; // fall through to next case handled = !handled; // fall through to next case
mLastControl = this; mLastControl = this;
/* fallthrough */ [[fallthrough]];
case kEventControlValueFieldChanged: case kEventControlValueFieldChanged:
GetEventParameter(event, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &control); GetEventParameter(event, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &control);
verify(control == mControl); verify(control == mControl);

View file

@ -375,7 +375,7 @@ Automatable::protect_automation ()
l->set_automation_state (Off); l->set_automation_state (Off);
break; break;
case Latch: case Latch:
/* fallthrough */ [[fallthrough]];
case Touch: case Touch:
l->set_automation_state (Play); l->set_automation_state (Play);
break; break;

View file

@ -39,9 +39,9 @@ static std::string gain_control_name (Evoral::Parameter const& param)
{ {
switch (param.type()) { switch (param.type()) {
case GainAutomation: case GainAutomation:
/* fallthrough */ [[fallthrough]];
case BusSendLevel: case BusSendLevel:
/* fallthrough */ [[fallthrough]];
case InsertReturnLevel: case InsertReturnLevel:
return X_("gaincontrol"); return X_("gaincontrol");
case TrimAutomation: case TrimAutomation:
@ -61,11 +61,11 @@ static std::shared_ptr<AutomationList> automation_list_new (Evoral::Parameter co
{ {
switch (param.type()) { switch (param.type()) {
case GainAutomation: case GainAutomation:
/* fallthrough */ [[fallthrough]];
case BusSendLevel: case BusSendLevel:
/* fallthrough */ [[fallthrough]];
case InsertReturnLevel: case InsertReturnLevel:
/* fallthrough */ [[fallthrough]];
case TrimAutomation: case TrimAutomation:
return std::shared_ptr<AutomationList> (new AutomationList (param, Temporal::AudioTime)); return std::shared_ptr<AutomationList> (new AutomationList (param, Temporal::AudioTime));
case MainOutVolume: case MainOutVolume:

View file

@ -839,9 +839,9 @@ LuaTableRef::set (lua_State* L)
} }
// invalid userdata -- fall through // invalid userdata -- fall through
} }
/* fallthrough */ [[fallthrough]];
case LUA_TFUNCTION: // no support -- we could... string.format("%q", string.dump(value, true)) 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_TTABLE: // no nested tables, sorry.
case LUA_TNIL: case LUA_TNIL:
default: default:

View file

@ -56,10 +56,10 @@ ParameterDescriptor::ParameterDescriptor(const Evoral::Parameter& parameter)
switch((AutomationType)parameter.type()) { switch((AutomationType)parameter.type()) {
case BusSendLevel: case BusSendLevel:
/* fallthrough */ [[fallthrough]];
case InsertReturnLevel: case InsertReturnLevel:
inline_ctrl = true; inline_ctrl = true;
/* fallthrough */ [[fallthrough]];
case GainAutomation: case GainAutomation:
upper = Config->get_max_gain(); upper = Config->get_max_gain();
normal = 1.0f; normal = 1.0f;
@ -325,16 +325,16 @@ ParameterDescriptor::to_interface (float val, bool rotary) const
val = std::min (upper, std::max (lower, val)); val = std::min (upper, std::max (lower, val));
switch(type) { switch(type) {
case GainAutomation: case GainAutomation:
/* fallthrough */ [[fallthrough]];
case BusSendLevel: case BusSendLevel:
/* fallthrough */ [[fallthrough]];
case InsertReturnLevel: case InsertReturnLevel:
/* fallthrough */ [[fallthrough]];
case EnvelopeAutomation: case EnvelopeAutomation:
val = gain_to_slider_position_with_max (val, upper); val = gain_to_slider_position_with_max (val, upper);
break; break;
case TrimAutomation: case TrimAutomation:
/* fallthrough */ [[fallthrough]];
case MainOutVolume: case MainOutVolume:
{ {
const float lower_db = accurate_coefficient_to_dB (lower); const float lower_db = accurate_coefficient_to_dB (lower);

View file

@ -2073,7 +2073,7 @@ PluginInsert::configure_io (ChanCount in, ChanCount out)
/* configure plugins */ /* configure plugins */
switch (_match.method) { switch (_match.method) {
case Split: case Split:
/* fallthrough */ [[fallthrough]];
case Hide: case Hide:
if (_plugins.front()->reconfigure_io (natural_input_streams(), ChanCount (), out) == false) { if (_plugins.front()->reconfigure_io (natural_input_streams(), ChanCount (), out) == false) {
PluginIoReConfigure (); /* EMIT SIGNAL */ PluginIoReConfigure (); /* EMIT SIGNAL */

View file

@ -389,7 +389,7 @@ std::ostream& operator<<(std::ostream& o, ARDOUR::SessionEvent const& ev) {
o << " force: " << ev.yes_or_no; o << " force: " << ev.yes_or_no;
break; break;
case SessionEvent::SetDefaultPlaySpeed: case SessionEvent::SetDefaultPlaySpeed:
/* fallthrough */ [[fallthrough]];
case SessionEvent::SetTransportSpeed: case SessionEvent::SetTransportSpeed:
o << " speed: " << ev.speed; o << " speed: " << ev.speed;
break; break;

View file

@ -495,7 +495,7 @@ SessionPlaylists::maybe_delete_unused (boost::function<int(std::shared_ptr<Playl
// delete this and all later // delete this and all later
delete_remaining = true; delete_remaining = true;
/* fallthrough */ [[fallthrough]];
case 1: case 1:
// delete this // delete this
playlists_tbd.push_back (*x); playlists_tbd.push_back (*x);

View file

@ -2735,7 +2735,7 @@ retry:
case 3: case 3:
no_questions_about_missing_files = true; no_questions_about_missing_files = true;
/* fallthrough */ [[fallthrough]];
case -1: case -1:
default: default:

View file

@ -131,7 +131,7 @@ VST3Plugin::parameter_change_handler (VST3PI::ParameterChange t, uint32_t param,
break; break;
case VST3PI::ValueChange: case VST3PI::ValueChange:
_parameter_queue.write_one (PV (param, value)); _parameter_queue.write_one (PV (param, value));
/* fallthrough */ [[fallthrough]];
case VST3PI::ParamValueChanged: case VST3PI::ParamValueChanged:
/* emit ParameterChangedExternally, mark preset dirty */ /* emit ParameterChangedExternally, mark preset dirty */
Plugin::parameter_changed_externally (param, value); Plugin::parameter_changed_externally (param, value);

View file

@ -430,10 +430,10 @@ WinMMEMidiOutputDevice::midi_output_thread ()
switch (h.size) { switch (h.size) {
case 3: case 3:
message |= (((DWORD)data[2]) << 16); message |= (((DWORD)data[2]) << 16);
/* fallthrough */ [[fallthrough]];
case 2: case 2:
message |= (((DWORD)data[1]) << 8); message |= (((DWORD)data[1]) << 8);
/* fallthrough */ [[fallthrough]];
case 1: case 1:
message |= (DWORD)data[0]; message |= (DWORD)data[0];
result = midiOutShortMsg (m_handle, message); result = midiOutShortMsg (m_handle, message);

View file

@ -336,7 +336,7 @@ Curve::_get_vector (Temporal::timepos_t x0, Temporal::timepos_t x1, float *vec,
assert (0); assert (0);
case ControlList::Curved: case ControlList::Curved:
/* no 2 point spline */ /* no 2 point spline */
/* fallthrough */ [[fallthrough]];
default: // Linear: default: // Linear:
for (int i = 0; i < veclen; ++i) { for (int i = 0; i < veclen; ++i) {
vec[i] = (lx * (m_num / m_den) + m_num * i * dx_num / (m_den * dx_den)) + c; vec[i] = (lx * (m_num / m_den) + m_num * i * dx_num / (m_den * dx_den)) + c;
@ -357,7 +357,7 @@ Curve::_get_vector (Temporal::timepos_t x0, Temporal::timepos_t x1, float *vec,
assert (0); assert (0);
case ControlList::Curved: case ControlList::Curved:
/* no 2 point spline */ /* no 2 point spline */
/* fallthrough */ [[fallthrough]];
default: // Linear: default: // Linear:
vec[0] = interpolate_linear (lval, uval, fraction); vec[0] = interpolate_linear (lval, uval, fraction);
break; break;
@ -474,7 +474,7 @@ Curve::multipoint_eval (Temporal::timepos_t const & x) const
double xv2 = xv * xv; double xv2 = xv * xv;
return ev->coeff[0] + (ev->coeff[1] * xv) + (ev->coeff[2] * xv2) + (ev->coeff[3] * xv2 * xv); return ev->coeff[0] + (ev->coeff[1] * xv) + (ev->coeff[2] * xv2) + (ev->coeff[3] * xv2 * xv);
} }
/* fallthrough */ [[fallthrough]];
case ControlList::Linear: case ControlList::Linear:
return before->value + (vdelta * (tdelta / trange)); return before->value + (vdelta * (tdelta / trange));
} }

View file

@ -561,7 +561,7 @@ Keyboard::leave_window (GdkEventCrossing* ev, Gtk::Window* /*win*/)
case GDK_NOTIFY_VIRTUAL: case GDK_NOTIFY_VIRTUAL:
DEBUG_TRACE (DEBUG::Keyboard, "VIRTUAL crossing ... out\n"); DEBUG_TRACE (DEBUG::Keyboard, "VIRTUAL crossing ... out\n");
/* fallthrough */ [[fallthrough]];
default: default:
DEBUG_TRACE (DEBUG::Keyboard, "REAL crossing ... out\n"); DEBUG_TRACE (DEBUG::Keyboard, "REAL crossing ... out\n");

View file

@ -501,7 +501,7 @@ Parser::scanner (unsigned char inbyte)
if (msgindex < 3) { if (msgindex < 3) {
return; return;
} }
/* fallthrough */ [[fallthrough]];
case NEEDONEBYTE: case NEEDONEBYTE:
/* We've completed a 1 or 2 byte message. */ /* We've completed a 1 or 2 byte message. */

View file

@ -52,7 +52,7 @@ order_of_magnitude (const char* i)
case 'd': case 'd':
return 100; return 100;
case 'k': case 'k':
/* fallthrough */ [[fallthrough]];
case 'K': case 'K':
return 1e6; return 1e6;
case 'M': case 'M':

View file

@ -1002,7 +1002,7 @@ FaderPort8::filter_stripables (StripableList& strips) const
break; break;
default: default:
assert (0); assert (0);
/* fallthrough */ [[fallthrough]];
case MixAll: case MixAll:
allow_master = true; allow_master = true;
flt = &flt_all; flt = &flt_all;

View file

@ -999,7 +999,7 @@ LaunchControlXL::filter_stripables(StripableList& strips) const
switch ((int)template_number()) { switch ((int)template_number()) {
default: default:
/* FALLTHROUGH */ [[fallthrough]];
case 8: case 8:
flt = &flt_default; flt = &flt_default;
break; break;

View file

@ -1686,56 +1686,56 @@ OSC::surface_parse (const char *path, const char* types, lo_arg **argv, int argc
} else { } else {
linkid = argv[8]->i; linkid = argv[8]->i;
} }
/* fallthrough */ [[fallthrough]];
case 8: case 8:
if (types[7] == 'f') { if (types[7] == 'f') {
linkset = (int) argv[7]->f; linkset = (int) argv[7]->f;
} else { } else {
linkset = argv[7]->i; linkset = argv[7]->i;
} }
/* fallthrough */ [[fallthrough]];
case 7: case 7:
if (types[6] == 'f') { if (types[6] == 'f') {
port = (int) argv[6]->f; port = (int) argv[6]->f;
} else { } else {
port = argv[6]->i; port = argv[6]->i;
} }
/* fallthrough */ [[fallthrough]];
case 6: case 6:
if (types[5] == 'f') { if (types[5] == 'f') {
pi_page = (int) argv[5]->f; pi_page = (int) argv[5]->f;
} else { } else {
pi_page = argv[5]->i; pi_page = argv[5]->i;
} }
/* fallthrough */ [[fallthrough]];
case 5: case 5:
if (types[4] == 'f') { if (types[4] == 'f') {
se_page = (int) argv[4]->f; se_page = (int) argv[4]->f;
} else { } else {
se_page = argv[4]->i; se_page = argv[4]->i;
} }
/* fallthrough */ [[fallthrough]];
case 4: case 4:
if (types[3] == 'f') { if (types[3] == 'f') {
fadermode = (int) argv[3]->f; fadermode = (int) argv[3]->f;
} else { } else {
fadermode = argv[3]->i; fadermode = argv[3]->i;
} }
/* fallthrough */ [[fallthrough]];
case 3: case 3:
if (types[2] == 'f') { if (types[2] == 'f') {
feedback = (int) argv[2]->f; feedback = (int) argv[2]->f;
} else { } else {
feedback = argv[2]->i; feedback = argv[2]->i;
} }
/* fallthrough */ [[fallthrough]];
case 2: case 2:
if (types[1] == 'f') { if (types[1] == 'f') {
strip_types = (int) argv[1]->f; strip_types = (int) argv[1]->f;
} else { } else {
strip_types = argv[1]->i; strip_types = argv[1]->i;
} }
/* fallthrough */ [[fallthrough]];
case 1: case 1:
bank_size = data; bank_size = data;
set_surface_port (port, msg); set_surface_port (port, msg);

View file

@ -1377,9 +1377,9 @@ ArdourWidgets::ArdourIcon::render (cairo_t* cr
icon_transport_panic (cr, width, height); icon_transport_panic (cr, width, height);
break; break;
case TransportStart: case TransportStart:
/* fallthrough */ [[fallthrough]];
case TransportEnd: case TransportEnd:
/* fallthrough */ [[fallthrough]];
case TransportRange: case TransportRange:
icon_transport_ck (cr, icon, width, height); icon_transport_ck (cr, icon, width, height);
break; break;
@ -1417,9 +1417,9 @@ ArdourWidgets::ArdourIcon::render (cairo_t* cr
icon_nudge_right (cr, width, height, fg_color); icon_nudge_right (cr, width, height, fg_color);
break; break;
case ZoomIn: case ZoomIn:
/* fallthrough */ [[fallthrough]];
case ZoomOut: case ZoomOut:
/* fallthrough */ [[fallthrough]];
case ZoomFull: case ZoomFull:
icon_zoom (cr, icon, width, height, fg_color); icon_zoom (cr, icon, width, height, fg_color);
break; break;

View file

@ -277,7 +277,7 @@ int main (int argc, char* argv[])
settings._sample_format = ExportFormatBase::SF_Float; settings._sample_format = ExportFormatBase::SF_Float;
break; break;
} }
/* fallthrough */ [[fallthrough]];
default: default:
fprintf(stderr, "Invalid Bit Depth\n"); fprintf(stderr, "Invalid Bit Depth\n");
break; break;