NO-OP: fix some Wimplicit-fallthrough
authorRobin Gareus <robin@gareus.org>
Wed, 18 Sep 2019 15:27:09 +0000 (17:27 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 18 Sep 2019 15:37:54 +0000 (17:37 +0200)
gcc can recognize various regexps in comments. Since C++17 provides
[[fallthrough]], using /* fallthrough */ consistently seems
appropriate until we switch to C++17.

see also https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

15 files changed:
libs/appleutility/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp
libs/ardour/automatable.cc
libs/ardour/lua_api.cc
libs/ardour/session_playlists.cc
libs/ardour/session_state.cc
libs/backends/portaudio/winmmemidi_output_device.cc
libs/clearlooks-newer/clearlooks_style.c
libs/evoral/src/Curve.cpp
libs/gtkmm2ext/keyboard.cc
libs/midi++2/parser.cc
libs/surfaces/faderport8/faderport8.cc
libs/surfaces/osc/osc.cc
libs/widgets/ardour_icon.cc
session_utils/export.cc
tools/luadevel/devel.cc

index c22c50c4a3503aed40b0d74495d290ab0eb7a15f..08678691400808336d9c668570e1483370714d54 100644 (file)
@@ -327,6 +327,7 @@ bool        AUCarbonViewControl::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef
                                case kEventControlSetFocusPart: // tab
                                        handled = !handled;             // fall through to next case
                                        mLastControl = this;
+                                       /* fallthrough */
                                case kEventControlValueFieldChanged:
                                        GetEventParameter(event, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &control);
                                        verify(control == mControl);
index fb2f9b9095bf7387df65bf9fd8c59d926f4b98f4..c146aa9757688c574648d2bb8b83f6aa25a68144 100644 (file)
@@ -354,7 +354,7 @@ Automatable::protect_automation ()
                        l->set_automation_state (Off);
                        break;
                case Latch:
-                       /* fall through */
+                       /* fallthrough */
                case Touch:
                        l->set_automation_state (Play);
                        break;
index 6f85656fc4196d8ae4c4cad50eeed9c460a842e7..7d6d54e5d6e084bb0dd148e76431778c3e050704 100644 (file)
@@ -681,9 +681,9 @@ LuaTableRef::set (lua_State* L)
                                        }
                                        // invalid userdata -- fall through
                                }
-                               /* fall through */
+                               /* fallthrough */
                        case LUA_TFUNCTION: // no support -- we could... string.format("%q", string.dump(value, true))
-                               /* fall through */
+                               /* fallthrough */
                        case LUA_TTABLE: // no nested tables, sorry.
                        case LUA_TNIL:
                        default:
index 6a168e7dcf082b053c6535f3077dd60924a4a0d7..0201c3e71dbe953d67c13463f6c7e46b22a7fea2 100644 (file)
@@ -429,7 +429,7 @@ SessionPlaylists::maybe_delete_unused (boost::function<int(boost::shared_ptr<Pla
                        // delete this and all later
                        delete_remaining = true;
 
-                       /* fall through */
+                       /* fallthrough */
                case 1:
                        // delete this
                        playlists_tbd.push_back (*x);
index 1b9eeea59fba17fd9a6f13aa8813abc7ee19eba3..8b3e164884d03da8eb816b9b80456e2ac7646f1a 100644 (file)
@@ -2446,7 +2446,7 @@ retry:
 
                                case 3:
                                        no_questions_about_missing_files = true;
-                                       /* fallthru */
+                                       /* fallthrough */
 
                                case -1:
                                default:
index 2771a8149078783adc8ce6aa95ec1ace57c0ce06..8d699f25cc82cc18111e2ed2fac98e10b32f8ade 100644 (file)
@@ -432,10 +432,10 @@ WinMMEMidiOutputDevice::midi_output_thread ()
                switch (h.size) {
                case 3:
                        message |= (((DWORD)data[2]) << 16);
-               // Fallthrough on purpose.
+                       /* fallthrough */
                case 2:
                        message |= (((DWORD)data[1]) << 8);
-               // Fallthrough on purpose.
+                       /* fallthrough */
                case 1:
                        message |= (DWORD)data[0];
                        result = midiOutShortMsg (m_handle, message);
index fb0ca33239c0d44c3f016ab74ffa1682d4423b4b..5556a933df574e22bcb58eab72cde2701f192e08 100644 (file)
@@ -56,7 +56,7 @@ static ClearlooksStyleClass *clearlooks_style_class;
 static GtkStyleClass *clearlooks_parent_class;
 
 static void
-clearlooks_set_widget_parameters (GtkWidget      *widget,
+clearlooks_set_widget_parameters (GtkWidget            *widget,
                                   const GtkStyle       *style,
                                   GtkStateType          state_type,
                                   WidgetParameters     *params)
@@ -726,11 +726,13 @@ clearlooks_style_draw_box (DRAW_ARGS)
                                {
                                        case GTK_PROGRESS_RIGHT_TO_LEFT:
                                                tmp.x -= 1;
+                                               /* fallthrough */
                                        case GTK_PROGRESS_LEFT_TO_RIGHT:
                                                tmp.width += 1;
                                                break;
                                        case GTK_PROGRESS_BOTTOM_TO_TOP:
                                                tmp.y -= 1;
+                                               /* fallthrough */
                                        case GTK_PROGRESS_TOP_TO_BOTTOM:
                                                tmp.height += 1;
                                                break;
index 7ccb2bbc552ed0ec4014e199417353d9a3f6ddaa..c4a27069926b965e417eab1235fd1d69103f2722 100644 (file)
@@ -322,7 +322,8 @@ Curve::_get_vector (double x0, double x1, float *vec, int32_t veclen) const
                                        // any discrete vector curves somewhere?
                                        assert (0);
                                case ControlList::Curved:
-                                       // fallthrough, no 2 point spline
+                                       /* no 2 point spline */
+                                       /* 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;
@@ -342,7 +343,8 @@ Curve::_get_vector (double x0, double x1, float *vec, int32_t veclen) const
                                        // any discrete vector curves somewhere?
                                        assert (0);
                                case ControlList::Curved:
-                                       // fallthrough, no 2 point spline
+                                       /* no 2 point spline */
+                                       /* fallthrough */
                                default: // Linear:
                                        vec[0] = interpolate_linear (lval, uval, fraction);
                                        break;
@@ -441,7 +443,7 @@ 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);
                                }
-                               /* fall through */
+                               /* fallthrough */
                        case ControlList::Linear:
                                return before->value + (vdelta * (tdelta / trange));
                }
index c28eb2afddb752bfc79861f06556c10d9d6ade94..1b51b6630a8438db0dcb55ad7af4ec7f2e6b49ad 100644 (file)
@@ -400,7 +400,7 @@ Keyboard::leave_window (GdkEventCrossing *ev, Gtk::Window* /*win*/)
 
                case GDK_NOTIFY_VIRTUAL:
                        DEBUG_TRACE (DEBUG::Keyboard, "VIRTUAL crossing ... out\n");
-                       /* fallthru */
+                       /* fallthrough */
 
                default:
                        DEBUG_TRACE (DEBUG::Keyboard, "REAL crossing ... out\n");
index fa5e796ca7d081d85d87538975030d88877e4963..1b08eea8c1618023194adb1c1e8c010f82e90c52 100644 (file)
@@ -493,9 +493,10 @@ Parser::scanner (unsigned char inbyte)
 
        case NEEDTWOBYTES:
                /* wait for the second byte */
-               if (msgindex < 3)
+               if (msgindex < 3) {
                        return;
-               /*FALLTHRU*/
+               }
+               /* fallthrough */
 
        case NEEDONEBYTE:
                /* We've completed a 1 or 2 byte message. */
index 486412ded0bf9a88750c80fe10c1cad2e96dbdcb..5e5cf498f739ed0d2b0037f1f3a9157231d9e38e 100644 (file)
@@ -959,7 +959,7 @@ FaderPort8::filter_stripables (StripableList& strips) const
                        break;
                default:
                        assert (0);
-                       // fall through
+                       /* fallthrough */
                case MixAll:
                        allow_master = true;
                        flt = &flt_all;
index c75b5221a0f0d54d095e362bbbc6416b9eab69c6..0926739ad3d00d89feef1732559af6a37c2617f8 100644 (file)
@@ -1816,49 +1816,56 @@ OSC::surface_parse (const char *path, const char* types, lo_arg **argv, int argc
                                } else {
                                        linkid = argv[8]->i;
                                }
+                               /* fallthrough */
                        case 8:
                                if (types[7] == 'f') {
                                        linkset = (int) argv[7]->f;
                                } else {
                                        linkset = argv[7]->i;
                                }
+                               /* fallthrough */
                        case 7:
                                if (types[6] == 'f') {
                                        port = (int) argv[6]->f;
                                } else {
                                        port = argv[6]->i;
                                }
+                               /* fallthrough */
                        case 6:
                                if (types[5] == 'f') {
                                        pi_page = (int) argv[5]->f;
                                } else {
                                        pi_page = argv[5]->i;
                                }
+                               /* fallthrough */
                        case 5:
                                if (types[4] == 'f') {
                                        se_page = (int) argv[4]->f;
                                } else {
                                        se_page = argv[4]->i;
                                }
+                               /* fallthrough */
                        case 4:
                                if (types[3] == 'f') {
                                        fadermode = (int) argv[3]->f;
                                } else {
                                        fadermode = argv[3]->i;
                                }
+                               /* fallthrough */
                        case 3:
                                if (types[2] == 'f') {
                                        feedback = (int) argv[2]->f;
                                } else {
                                        feedback = argv[2]->i;
                                }
-                               // [[fallthrough]]; old compiler doesn't like
+                               /* fallthrough */
                        case 2:
                                if (types[1] == 'f') {
                                        strip_types = (int) argv[1]->f;
                                } else {
                                        strip_types = argv[1]->i;
                                }
+                               /* fallthrough */
                        case 1:
                                if (types[0] == 'f') {
                                        bank_size = (int) argv[0]->f;
index 6307c3eaef9ab067c2c44ec2ffa8fe49f6700122..2f96b97470a75d4e3868b5bbeb57c979d1120ac2 100644 (file)
@@ -1315,9 +1315,9 @@ ArdourWidgets::ArdourIcon::render (cairo_t *cr,
                        icon_transport_panic (cr, width, height);
                        break;
                case TransportStart:
-                       /* fall through */
+                       /* fallthrough */
                case TransportEnd:
-                       /* fall through */
+                       /* fallthrough */
                case TransportRange:
                        icon_transport_ck (cr, icon, width, height);
                        break;
@@ -1352,9 +1352,9 @@ ArdourWidgets::ArdourIcon::render (cairo_t *cr,
                        icon_nudge_right (cr, width, height, fg_color);
                        break;
                case ZoomIn:
-                       /* fall through */
+                       /* fallthrough */
                case ZoomOut:
-                       /* fall through */
+                       /* fallthrough */
                case ZoomFull:
                        icon_zoom (cr, icon, width, height, fg_color);
                        break;
index ddd0166910682a774e7d12f45945e18b8b8553ef..3bffc07f0e0d425ad9f9ecbfa1cdc2273c220c67 100644 (file)
@@ -274,7 +274,7 @@ int main (int argc, char* argv[])
                                                        settings._sample_format = ExportFormatBase::SF_Float;
                                                        break;
                                                }
-                                               /* fall through */
+                                               /* fallthrough */
                                        default:
                                                fprintf(stderr, "Invalid Bit Depth\n");
                                                break;
index 7d0deecbcf69e4a6d1331531284dc2dbcb405269..92539881ec75177e1541888ccc5f3244376b9366 100644 (file)
@@ -155,10 +155,11 @@ class LuaTableRef {
                                                        // invalid userdata -- fall through
                                                }
 
-                                               /* fall through */
+                                               /* fallthrough */
                                        case LUA_TFUNCTION: // no support -- we could... string.format("%q", string.dump(value, true))
                                        case LUA_TTABLE: // no nested tables, sorry.
-                                       case LUA_TNIL: // fallthrough
+                                       case LUA_TNIL:
+                                               /* fallthrough */
                                        default:
                                                // invalid value
                                                lua_pop (L, 2);