From 1f83d677f34f03ac877e9c9deca57932d40cccbb Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Thu, 3 Jan 2019 23:24:44 +0000 Subject: [PATCH] Changed `BLACK_FALLTHROUGH` to `Q_FALLTHROUGH()`. --- src/blackcore/aircraftmatcher.cpp | 3 +- .../components/dbmappingcomponent.cpp | 3 +- .../models/aircraftmodellistmodel.cpp | 3 +- src/blackgui/models/distributorlistmodel.cpp | 5 ++- src/blackmisc/aviation/aircraftsituation.cpp | 4 +-- src/blackmisc/fallthrough.h | 33 ------------------- src/blackmisc/logpattern.cpp | 8 ++--- 7 files changed, 9 insertions(+), 50 deletions(-) delete mode 100644 src/blackmisc/fallthrough.h diff --git a/src/blackcore/aircraftmatcher.cpp b/src/blackcore/aircraftmatcher.cpp index 1ff762dfb..2668c22ff 100644 --- a/src/blackcore/aircraftmatcher.cpp +++ b/src/blackcore/aircraftmatcher.cpp @@ -10,7 +10,6 @@ #include "blackcore/aircraftmatcher.h" #include "blackcore/application.h" #include "blackcore/webdataservices.h" -#include "blackmisc/fallthrough.h" #include "blackmisc/simulation/simulatedaircraft.h" #include "blackmisc/simulation/matchingutils.h" #include "blackmisc/aviation/aircrafticaocode.h" @@ -227,7 +226,7 @@ namespace BlackCore matchedModel = candidates.minOrderOrDefault(); break; } - BLACK_FALLTHROUGH; + Q_FALLTHROUGH(); case CAircraftMatcherSetup::PickFirst: // fallthru intentionally default: usedStrategy = CAircraftMatcherSetup::PickFirst; // re-assigned if fall-through diff --git a/src/blackgui/components/dbmappingcomponent.cpp b/src/blackgui/components/dbmappingcomponent.cpp index 1ca0dc578..570c164c1 100644 --- a/src/blackgui/components/dbmappingcomponent.cpp +++ b/src/blackgui/components/dbmappingcomponent.cpp @@ -30,7 +30,6 @@ #include "blackgui/shortcut.h" #include "blackmisc/aviation/aircrafticaocode.h" #include "blackmisc/aviation/livery.h" -#include "blackmisc/fallthrough.h" #include "blackmisc/icons.h" #include "blackmisc/logmessage.h" #include "blackmisc/network/authenticateduser.h" @@ -614,8 +613,8 @@ namespace BlackGui { // fall thru intended this->formatVPilotView(); - BLACK_FALLTHROUGH; } + Q_FALLTHROUGH(); default: { ui->frp_Editors->setVisible(true); diff --git a/src/blackgui/models/aircraftmodellistmodel.cpp b/src/blackgui/models/aircraftmodellistmodel.cpp index 51ef8db97..c140c6d8b 100644 --- a/src/blackgui/models/aircraftmodellistmodel.cpp +++ b/src/blackgui/models/aircraftmodellistmodel.cpp @@ -10,7 +10,6 @@ #include "blackgui/models/aircraftmodellistmodel.h" #include "blackgui/models/columnformatters.h" #include "blackgui/models/columns.h" -#include "blackmisc/fallthrough.h" #include "blackmisc/aviation/aircrafticaocode.h" #include "blackmisc/aviation/airlineicaocode.h" #include "blackmisc/aviation/livery.h" @@ -77,7 +76,7 @@ namespace BlackGui case OwnModelSet: // intentional fall thru m_columns.addColumn(CColumn::orderColumn()); - BLACK_FALLTHROUGH; + Q_FALLTHROUGH(); case OwnAircraftModelMappingTool: case StashModel: diff --git a/src/blackgui/models/distributorlistmodel.cpp b/src/blackgui/models/distributorlistmodel.cpp index 94c17d905..3f39df31e 100644 --- a/src/blackgui/models/distributorlistmodel.cpp +++ b/src/blackgui/models/distributorlistmodel.cpp @@ -7,7 +7,6 @@ * contained in the LICENSE file. */ -#include "blackmisc/fallthrough.h" #include "blackgui/models/columns.h" #include "blackgui/models/distributorlistmodel.h" #include "blackmisc/db/datastore.h" @@ -47,7 +46,7 @@ namespace BlackGui { case NormalWithOrder: m_columns.addColumn(CColumn::orderColumn()); - BLACK_FALLTHROUGH; + Q_FALLTHROUGH(); case NotSet: case Normal: { @@ -66,7 +65,7 @@ namespace BlackGui case MinimalWithOrder: m_columns.addColumn(CColumn::orderColumn()); - BLACK_FALLTHROUGH; + Q_FALLTHROUGH(); case Minimal: { m_columns.addColumn(CColumn::standardString("key", CDistributor::IndexDbStringKey)); diff --git a/src/blackmisc/aviation/aircraftsituation.cpp b/src/blackmisc/aviation/aircraftsituation.cpp index 247fd46ac..d5bf03c6f 100644 --- a/src/blackmisc/aviation/aircraftsituation.cpp +++ b/src/blackmisc/aviation/aircraftsituation.cpp @@ -7,7 +7,6 @@ * contained in the LICENSE file. */ -#include "blackmisc/fallthrough.h" #include "blackmisc/simulation/aircraftmodel.h" #include "blackmisc/aviation/aircraftsituation.h" #include "blackmisc/aviation/aircraftsituationchange.h" @@ -416,9 +415,8 @@ namespace BlackMisc { const int c = Compare::compare(this->getGroundElevationInfo(), compareValue.getGroundElevationInfo()); if (c != 0) { return c; } - // fall through, compare flag - BLACK_FALLTHROUGH; } + Q_FALLTHROUGH(); case IndexGroundElevationInfoTransferred: return Compare::compare(m_isElvInfoTransferred, compareValue.m_isElvInfoTransferred); case IndexCanLikelySkipNearGroundInterpolation: return Compare::compare(this->canLikelySkipNearGroundInterpolation(), compareValue.canLikelySkipNearGroundInterpolation()); default: break; diff --git a/src/blackmisc/fallthrough.h b/src/blackmisc/fallthrough.h deleted file mode 100644 index d5ff744a6..000000000 --- a/src/blackmisc/fallthrough.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2018 - * swift project Community / Contributors - * - * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -//! \file - -#ifndef BLACKMISC_FALLTHROUGH_H -#define BLACKMISC_FALLTHROUGH_H - -#include - -//! \cond - -// MSVC2017: [[fallthrough]] supported but only enabled with /std:c++17 -// GCC7+: [[gnu::fallthrough]] for C++11/14, [[fallthrough]] for C++17 -// XCode: Does not seem to work in current configuration - -#if defined(Q_CC_GNU) && Q_CC_GNU > 700 - #if __has_cpp_attribute(fallthrough) - #define BLACK_FALLTHROUGH [[gnu::fallthrough]] - #endif -#else - #define BLACK_FALLTHROUGH -#endif - -//! \endcond - -#endif diff --git a/src/blackmisc/logpattern.cpp b/src/blackmisc/logpattern.cpp index f447b81cf..9aa397ab1 100644 --- a/src/blackmisc/logpattern.cpp +++ b/src/blackmisc/logpattern.cpp @@ -7,7 +7,6 @@ * contained in the LICENSE file. */ -#include "blackmisc/fallthrough.h" #include "blackmisc/logcategory.h" #include "blackmisc/logcategorylist.h" #include "blackmisc/logpattern.h" @@ -153,14 +152,13 @@ namespace BlackMisc result.m_severities.clear(); switch (minimumSeverity) { - // there are deliberately no break statements in this switch block default: case CStatusMessage::SeverityDebug: result.m_severities.insert(CStatusMessage::SeverityDebug); - BLACK_FALLTHROUGH; + Q_FALLTHROUGH(); case CStatusMessage::SeverityInfo: result.m_severities.insert(CStatusMessage::SeverityInfo); - BLACK_FALLTHROUGH; + Q_FALLTHROUGH(); case CStatusMessage::SeverityWarning: result.m_severities.insert(CStatusMessage::SeverityWarning); - BLACK_FALLTHROUGH; + Q_FALLTHROUGH(); case CStatusMessage::SeverityError: result.m_severities.insert(CStatusMessage::SeverityError); } return result;