qa: Remove [[clang::fallthrough]] annotations again
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 22 Aug 2018 23:46:43 +0000 (01:46 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 23 Aug 2018 00:26:27 +0000 (02:26 +0200)
These cause warnings in most compilers, so remove them again until
we can use C++17 and the official attribute.

Add comments, so we know the fallthroughs are intentional anyway.

src/core/coresessioneventprocessor.cpp
src/core/eventstringifier.cpp
src/core/sqlitestorage.cpp
src/qtui/bufferwidget.cpp
src/qtui/chatscene.cpp
src/uisupport/networkmodelcontroller.cpp
src/uisupport/tabcompleter.cpp

index 8fa7015..2a3dfc2 100644 (file)
@@ -1054,13 +1054,13 @@ void CoreSessionEventProcessor::processIrcEvent322(IrcEvent *e)
     switch (e->params().count()) {
     case 3:
         topic = e->params()[2];
-        [[clang::fallthrough]];
+        // fallthrough
     case 2:
         userCount = e->params()[1].toUInt();
-        [[clang::fallthrough]];
+        // fallthrough
     case 1:
         channelName = e->params()[0];
-        [[clang::fallthrough]];
+        // fallthrough
     default:
         break;
     }
index c7da8d7..f43e547 100644 (file)
@@ -610,13 +610,13 @@ void EventStringifier::processIrcEvent322(IrcEvent *e)
     switch (e->params().count()) {
     case 3:
         topic = e->params()[2];
-        [[clang::fallthrough]];
+        // fallthrough
     case 2:
         userCount = e->params()[1].toUInt();
-        [[clang::fallthrough]];
+        /* fallthrough */
     case 1:
         channelName = e->params()[0];
-        [[clang::fallthrough]];
+        // blubb
     default:
         break;
     }
index 2eae156..e0f8fd8 100644 (file)
@@ -2193,7 +2193,7 @@ bool SqliteStorage::safeExec(QSqlQuery &query, int retryCount)
 
     switch (query.lastError().number()) {
     case 5: // SQLITE_BUSY         5   /* The database file is locked */
-        [[clang::fallthrough]];
+        // fallthrough
     case 6: // SQLITE_LOCKED       6   /* A table in the database is locked */
         if (retryCount < _maxRetryCount)
             return safeExec(query, retryCount + 1);
index 825bc23..2d8e3a0 100644 (file)
@@ -232,7 +232,7 @@ bool BufferWidget::eventFilter(QObject *watched, QEvent *event)
     case Qt::Key_Down:
         if (!(keyEvent->modifiers() & Qt::ShiftModifier))
             return false;
-        [[clang::fallthrough]];
+        // fallthrough
     case Qt::Key_PageUp:
     case Qt::Key_PageDown:
         // static cast to access public qobject::event
index 6027569..5c81bf7 100644 (file)
@@ -1297,7 +1297,6 @@ void ChatScene::webPreviewNextStep()
         if (webPreview.previewItem && webPreview.previewItem->scene())
             removeItem(webPreview.previewItem);
         // Fall through to deletion!
-        [[clang::fallthrough]];
     case WebPreview::HidePreview:
         if (webPreview.previewItem) {
             delete webPreview.previewItem;
@@ -1325,7 +1324,6 @@ void ChatScene::clearWebPreview(ChatItem *parentItem)
                 removeItem(webPreview.previewItem);
         }
         // fall through into to set hidden state
-        [[clang::fallthrough]];
     case WebPreview::DelayPreview:
         // we're just loading, so haven't shown the preview yet.
         webPreview.previewState = WebPreview::HidePreview;
index e75d4f8..94dd8d9 100644 (file)
@@ -363,7 +363,7 @@ void NetworkModelController::handleHideAction(ActionType type, QAction *action)
         return;
     case HideApplyToAll:
         BufferSettings().setMessageFilter(filter);
-        [[clang::fallthrough]];
+        // fallthrough
     case HideUseDefaults:
         if (_messageFilter)
             BufferSettings(_messageFilter->idString()).removeFilter();
index d1b018b..a068961 100644 (file)
@@ -109,7 +109,7 @@ void TabCompleter::buildCompletionList()
         case BufferInfo::QueryBuffer:
             if (regex.indexIn(_currentBufferName) > -1)
                 _completionMap[_currentBufferName.toLower()] = _currentBufferName;
-            [[clang::fallthrough]];
+            // fallthrough
         case BufferInfo::StatusBuffer:
             if (!_currentNetwork->myNick().isEmpty() && regex.indexIn(_currentNetwork->myNick()) > -1)
                 _completionMap[_currentNetwork->myNick().toLower()] = _currentNetwork->myNick();