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
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);

View File

@ -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;

View File

@ -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<AutomationList> 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<AutomationList> (new AutomationList (param, Temporal::AudioTime));
case MainOutVolume:

View File

@ -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:

View File

@ -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);

View File

@ -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 */

View File

@ -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;

View File

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

View File

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

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);

View File

@ -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);

View File

@ -336,7 +336,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;
@ -357,7 +357,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;
@ -474,7 +474,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));
}

View File

@ -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");

View File

@ -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. */

View File

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

View File

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

View File

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

View File

@ -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);

View File

@ -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;

View File

@ -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;