From c98fc1099d151f9d16a2dc8d2b59d16ea539bb21 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 26 Oct 2018 14:30:26 +0200 Subject: Fix some Wimplicit-fallthrough A "fall through" comment is most portable way to indicate "no break, fallthru" cases. * __attribute__ ((fallthrough)) // is not portable * [[fallthrough]]; // is C++17 --- libs/ardour/automatable.cc | 2 +- libs/ardour/lua_api.cc | 5 +++-- libs/ardour/session_playlists.cc | 2 +- libs/evoral/src/Curve.cpp | 4 ++-- libs/widgets/ardour_icon.cc | 12 ++++++++---- 5 files changed, 15 insertions(+), 10 deletions(-) (limited to 'libs') diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index 65b83b4b6e..2f60024ff0 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -333,7 +333,7 @@ Automatable::protect_automation () l->set_automation_state (Off); break; case Latch: - // no break + /* fall through */ case Touch: l->set_automation_state (Play); break; diff --git a/libs/ardour/lua_api.cc b/libs/ardour/lua_api.cc index 7332f62fc9..d4e2bb23b4 100644 --- a/libs/ardour/lua_api.cc +++ b/libs/ardour/lua_api.cc @@ -681,10 +681,11 @@ LuaTableRef::set (lua_State* L) } // invalid userdata -- fall through } - // no break + /* fall through */ case LUA_TFUNCTION: // no support -- we could... string.format("%q", string.dump(value, true)) + /* fall through */ case LUA_TTABLE: // no nested tables, sorry. - case LUA_TNIL: // fallthrough + case LUA_TNIL: default: // invalid value lua_pop (L, 2); diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index 50bc710347..2f66cd61b2 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -400,8 +400,8 @@ SessionPlaylists::maybe_delete_unused (boost::functioncoeff[0] + (ev->coeff[1] * x) + (ev->coeff[2] * x2) + (ev->coeff[3] * x2 * x); } - // no break, fallthru - default: // Linear + /* fall through */ + case ControlList::Linear: return before->value + (vdelta * (tdelta / trange)); } } diff --git a/libs/widgets/ardour_icon.cc b/libs/widgets/ardour_icon.cc index 0980ad95f5..0c5ea1f055 100644 --- a/libs/widgets/ardour_icon.cc +++ b/libs/widgets/ardour_icon.cc @@ -1037,8 +1037,10 @@ ArdourWidgets::ArdourIcon::render (cairo_t *cr, case TransportPanic: icon_transport_panic (cr, width, height); break; - case TransportStart: // no break - case TransportEnd: // no break + case TransportStart: + /* fall through */ + case TransportEnd: + /* fall through */ case TransportRange: icon_transport_ck (cr, icon, width, height); break; @@ -1063,8 +1065,10 @@ ArdourWidgets::ArdourIcon::render (cairo_t *cr, case NudgeRight: icon_nudge_right (cr, width, height, fg_color); break; - case ZoomIn: // no break - case ZoomOut: // no break + case ZoomIn: + /* fall through */ + case ZoomOut: + /* fall through */ case ZoomFull: icon_zoom (cr, icon, width, height, fg_color); break; -- cgit v1.2.3