summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-10-26 14:30:26 +0200
committerRobin Gareus <robin@gareus.org>2018-10-26 14:53:44 +0200
commitc98fc1099d151f9d16a2dc8d2b59d16ea539bb21 (patch)
treea711dfd008aba013520dce2c57ba2dbef08e40a2 /libs
parent08d205c533fa3380a97d646b3a50c9f9426f3a80 (diff)
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
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/automatable.cc2
-rw-r--r--libs/ardour/lua_api.cc5
-rw-r--r--libs/ardour/session_playlists.cc2
-rw-r--r--libs/evoral/src/Curve.cpp4
-rw-r--r--libs/widgets/ardour_icon.cc12
5 files changed, 15 insertions, 10 deletions
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::function<int(boost::shared_ptr<Pla
case 2:
// delete this and all later
delete_remaining = true;
- // no break;
+ /* fall through */
case 1:
// delete this
playlists_tbd.push_back (*x);
diff --git a/libs/evoral/src/Curve.cpp b/libs/evoral/src/Curve.cpp
index e7eeeccb9f..31909e3a39 100644
--- a/libs/evoral/src/Curve.cpp
+++ b/libs/evoral/src/Curve.cpp
@@ -438,8 +438,8 @@ Curve::multipoint_eval (double x) const
double x2 = x * x;
return ev->coeff[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;