Fix some Wimplicit-fallthrough
authorRobin Gareus <robin@gareus.org>
Fri, 26 Oct 2018 12:30:26 +0000 (14:30 +0200)
committerRobin Gareus <robin@gareus.org>
Fri, 26 Oct 2018 12:53:44 +0000 (14:53 +0200)
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
libs/ardour/lua_api.cc
libs/ardour/session_playlists.cc
libs/evoral/src/Curve.cpp
libs/widgets/ardour_icon.cc

index 65b83b4b6ea03fb4a701f4017074df2a60f34b79..2f60024ff027858b865df73853d4e49ac0bb5384 100644 (file)
@@ -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;
index 7332f62fc96fffb7377557875d5e0afe7e57210c..d4e2bb23b45a88f2cc7242231fedb757a039d160 100644 (file)
@@ -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);
index 50bc710347ab4935a7940437dd40455402f9e01c..2f66cd61b28fb8f51dc8163d13c006cd49246df8 100644 (file)
@@ -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);
index e7eeeccb9fc0c0f72de721a7f0387249ef3e948e..31909e3a39443ffc69403747d350f837b0454be0 100644 (file)
@@ -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));
                }
        }
index 0980ad95f563a8bf8a92c707008525e89974be83..0c5ea1f0554b9b24a755574becab039c5e9d8794 100644 (file)
@@ -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;