Compare commits

...

3 Commits

Author SHA1 Message Date
Robin Gareus 66c03fea25
amend f02e5d3a 2023-05-19 05:45:51 +02:00
Robin Gareus 157ccbbdb5 C++11 fallthrough (2/2) 2023-05-19 05:34:25 +02:00
Robin Gareus f02e5d3a9f C++11 fallthrough (1/2) 2023-05-19 05:33:56 +02:00
32 changed files with 77 additions and 78 deletions

View File

@ -810,7 +810,7 @@ If you still wish to proceed, please use the\n\n\
msg.run ();
return;
}
/* fallthrough */
[[fallthrough]];
case 0:
_session->remove_pending_capture_state ();
break;
@ -970,7 +970,7 @@ If you still wish to proceed, please use the\n\n\
msg.run ();
return;
}
/* fallthrough */
[[fallthrough]];
case 0:
_session->remove_pending_capture_state ();
break;

View File

@ -489,7 +489,7 @@ AudioClock::end_edit (bool modify)
break;
case Seconds:
/* fallthrough */
[[fallthrough]];
case Samples:
if (edit_string.length() < 1) {
edit_string = pre_edit_string;

View File

@ -5176,8 +5176,7 @@ Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_
break;
}
}
/* fallthrough */
[[fallthrough]];
default:
case EditAtMouse:
if (!mouse_sample (ms, ignored)) {
@ -6840,14 +6839,14 @@ Editor::default_time_domain () const
switch (_grid_type) {
case GridTypeNone:
/* fallthrough */
[[fallthrough]];
case GridTypeMinSec:
/* fallthrough */
[[fallthrough]];
case GridTypeCDFrame:
/* fallthrough */
[[fallthrough]];
case GridTypeTimecode:
/* fallthrough */
return AudioTime;
[[fallthrough]];
default:
break;
}

View File

@ -1073,7 +1073,7 @@ Editor::finish_bringing_in_material (std::shared_ptr<Region> region,
}
case ImportAsTrigger:
/* fallthrough */
[[fallthrough]];
case ImportAsTrack:
{
if (!existing_track) {

View File

@ -2738,7 +2738,7 @@ Editor::cut_copy_section (bool copy)
break;
case SectionSelectRetainAndMovePlayhead:
_session->request_locate (copy ? to_end.samples (): to.samples ());
/* fallthough */
[[fallthrough]];
case SectionSelectRetain:
if (!copy || to < end) {
selection->set (to, to_end);

View File

@ -190,8 +190,8 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, std::s
*/
switch (_type) {
case Mark: /* fallthough */
case RegionCue: /* fallthough */
case Mark: [[fallthrough]];
case RegionCue: [[fallthrough]];
case BBTPosition:
points = new ArdourCanvas::Points ();
@ -297,13 +297,13 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, std::s
switch (_type) {
case RegionCue:
/* fallthrough */
[[fallthrough]];
case Meter:
/* fallthrough */
[[fallthrough]];
case Tempo:
/* fallthrough */
[[fallthrough]];
case SelectionStart:
/* fallthrough */
[[fallthrough]];
case SelectionEnd:
_name_flag = 0;
break;
@ -325,7 +325,7 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, std::s
switch (_type) {
case SelectionStart:
/* fallthrough */
[[fallthrough]];
case SelectionEnd:
_pcue->hide();
_pmark->show();

View File

@ -516,7 +516,7 @@ meter_render_ticks (Gtk::Widget& w, MeterType type, vector<ARDOUR::DataType> typ
points.insert (std::pair<float,float>( 3, 1.0));
points.insert (std::pair<float,float>( 4, 0.5));
points.insert (std::pair<float,float>( 5, 0.5));
/* fallthrough */
[[fallthrough]];
case MeterPeak0dB:
points.insert (std::pair<float,float>(-60, 0.5));
points.insert (std::pair<float,float>(-50, 1.0));
@ -752,12 +752,12 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
points.insert (std::pair<float,string>( 0.0f, "+20"));
break;
case MeterPeak:
/* fallthrough */
[[fallthrough]];
case MeterKrms:
/* fallthrough */
[[fallthrough]];
default:
points.insert (std::pair<float,string>( 3.0f, "+3"));
/* fallthrough */
[[fallthrough]];
case MeterPeak0dB:
points.insert (std::pair<float,string>(-50.0f, "-50"));
points.insert (std::pair<float,string>(-40.0f, "-40"));

View File

@ -327,16 +327,16 @@ APianoKeyboard::handle_fixed_keys (GdkEventKey* ev)
} else if (ev->type == GDK_KEY_RELEASE) {
switch (ev->keyval) {
case GDK_KEY_F1:
/* fallthrough */
[[fallthrough]];
case GDK_KEY_F2:
/* fallthrough */
[[fallthrough]];
case GDK_KEY_F3:
/* fallthrough */
[[fallthrough]];
case GDK_KEY_F4:
PitchBend (8192, false);
break;
case GDK_KEY_Up:
/* fallthrough */
[[fallthrough]];
case GDK_KEY_Down:
PitchBend (8192, true);
return true;

View File

@ -615,12 +615,12 @@ TrackRecordAxis::entry_key_press (GdkEventKey* ev)
{
switch (ev->keyval) {
case GDK_Escape:
/* fallthrough */
[[fallthrough]];
case GDK_ISO_Left_Tab:
/* fallthrough */
[[fallthrough]];
case GDK_Tab:
/* fallthrough */
return true;
[[fallthrough]];
default:
break;
}

View File

@ -339,12 +339,12 @@ TriggerUI::entry_key_press (GdkEventKey* ev)
{
switch (ev->keyval) {
case GDK_Escape:
/* fallthrough */
[[fallthrough]];
case GDK_ISO_Left_Tab:
/* fallthrough */
[[fallthrough]];
case GDK_Tab:
/* fallthrough */
return true;
[[fallthrough]];
default:
break;
}

View File

@ -231,7 +231,7 @@ VSTPluginUI::dispatch_effeditkey (GdkEventKey* gdk_key)
special_key = 15;
break;
case GDK_Page_Down:
/* fallthrough */
[[fallthrough]];
case GDK_KP_Page_Down:
special_key = 16;
break;

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

@ -219,10 +219,10 @@ RTMidiBuffer::write (TimeType time, Evoral::EventType /*type*/, uint32_t size, c
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;

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;