Add Q_FALLTHROUGH for Qt < 5.8

... and make use of it.
With gcc 7, the new option -Wimplicit-fallthrough is introduced and
added to the -Wextra set, triggering dozens of warnings in our sources.
Therefore, we annotate all obviously intended fall-throughs. The ones
that are still left are unclear and need to be checked by the respective
maintainer.

Change-Id: I44ead33cd42a4b41c28ee5fcb5a31db272710bbc
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Kandeler
2017-07-14 13:44:33 +02:00
parent c9301e80bb
commit be2b3c91ae
16 changed files with 95 additions and 13 deletions

View File

@@ -53,6 +53,7 @@
// Needed for the load&save actions in the context menu
#include <debugger/analyzer/analyzermanager.h>
#include <coreplugin/findplaceholder.h>
#include <utils/qtcfallthrough.h>
#include <utils/styledbar.h>
#include <utils/algorithm.h>
@@ -103,7 +104,7 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManag
qint64 end = modelManager->traceTime()->endTime();
d->m_zoomControl->setTrace(start, end);
d->m_zoomControl->setRange(start, start + (end - start) / 10);
// Fall through
Q_FALLTHROUGH();
}
case QmlProfilerModelManager::Empty:
d->m_modelProxy->setModels(d->m_suspendedModels);
@@ -116,7 +117,7 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManag
d->m_zoomControl->clear();
if (!d->m_suspendedModels.isEmpty())
break; // Models are suspended already. AcquiringData was aborted.
// Fall through
Q_FALLTHROUGH();
case QmlProfilerModelManager::AcquiringData:
// Temporarily remove the models, while we're changing them
d->m_suspendedModels = d->m_modelProxy->models();