Skip to content

Commit 1d1b7c9

Browse files
committedOct 23, 2023
Remove custom FALLTHROUGH define
We don't need this anymore since we require c++17 anyway, and it raises build warnings due to macro redefinition with newer GRASS
1 parent 9b095c5 commit 1d1b7c9

30 files changed

+55
-66
lines changed
 

‎python/core/auto_generated/qgis.sip.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2653,7 +2653,6 @@ typedef unsigned long long qgssize;
26532653

26542654

26552655

2656-
26572656
QString geoWkt();
26582657
%Docstring
26592658
Wkt string that represents a geographic coord sys

‎src/app/layers/qgsapplayerhandling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ const QList<QgsVectorLayerRef> QgsAppLayerHandling::findBrokenLayerDependencies(
15301530
{
15311531
if ( !weakRelation.mappingTable().resolveWeakly( QgsProject::instance(), matchType ) )
15321532
dependencies << weakRelation.mappingTable();
1533-
FALLTHROUGH;
1533+
[[fallthrough]];
15341534
}
15351535

15361536
case Qgis::RelationshipCardinality::OneToOne:

‎src/app/mesh/qgsmaptooleditmeshframe.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ QgsMapTool::Flags QgsMapToolEditMeshFrame::flags() const
688688
case Digitizing:
689689
if ( !mCadDockWidget->cadEnabled() || !mSelectedVertices.isEmpty() || mCurrentFaceIndex != -1 )
690690
return QgsMapTool::Flags() | QgsMapTool::ShowContextMenu;
691-
FALLTHROUGH
691+
[[fallthrough]];
692692
case AddingNewFace:
693693
case Selecting:
694694
case MovingSelection:

‎src/core/expression/qgsexpressionnodeimpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ QVariant QgsExpressionNodeBinaryOperator::evalNode( QgsExpression *parent, const
232232
return QVariant( sL + sR );
233233
}
234234
//intentional fall-through
235-
FALLTHROUGH
235+
[[fallthrough]];
236236
case boMinus:
237237
case boMul:
238238
case boDiv:

‎src/core/labeling/qgsvectorlayerlabeling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ std::unique_ptr<QgsMarkerSymbolLayer> backgroundToMarkerLayer( const QgsTextBack
216216
layer.reset( static_cast< QgsMarkerSymbolLayer * >( settings.markerSymbol()->symbolLayer( 0 )->clone() ) );
217217
break;
218218
}
219-
FALLTHROUGH // not set, just go with the default
219+
[[fallthrough]]; // not set, just go with the default
220220
}
221221
case QgsTextBackgroundSettings::ShapeCircle:
222222
case QgsTextBackgroundSettings::ShapeEllipse:

‎src/core/layout/qgslayoutitemmap.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ bool QgsLayoutItemMap::nextExportPart()
13011301
mCurrentExportPart = Background;
13021302
return true;
13031303
}
1304-
FALLTHROUGH
1304+
[[fallthrough]];
13051305

13061306
case Background:
13071307
mCurrentExportPart = Layer;
@@ -1330,7 +1330,7 @@ bool QgsLayoutItemMap::nextExportPart()
13301330
mCurrentExportPart = Grid;
13311331
return true;
13321332
}
1333-
FALLTHROUGH
1333+
[[fallthrough]];
13341334

13351335
case Grid:
13361336
for ( int i = 0; i < mOverviewStack->size(); ++i )
@@ -1342,7 +1342,7 @@ bool QgsLayoutItemMap::nextExportPart()
13421342
return true;
13431343
}
13441344
}
1345-
FALLTHROUGH
1345+
[[fallthrough]];
13461346

13471347
case OverviewMapExtent:
13481348
if ( frameEnabled() )
@@ -1351,15 +1351,15 @@ bool QgsLayoutItemMap::nextExportPart()
13511351
return true;
13521352
}
13531353

1354-
FALLTHROUGH
1354+
[[fallthrough]];
13551355

13561356
case Frame:
13571357
if ( isSelected() && !mLayout->renderContext().isPreviewRender() )
13581358
{
13591359
mCurrentExportPart = SelectionBoxes;
13601360
return true;
13611361
}
1362-
FALLTHROUGH
1362+
[[fallthrough]];
13631363

13641364
case SelectionBoxes:
13651365
mCurrentExportPart = End;

‎src/core/layout/qgslayoutitemmapgrid.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ void QgsLayoutItemMapGrid::draw( QPainter *p )
641641
break;
642642
}
643643

644-
FALLTHROUGH
644+
[[fallthrough]];
645645
case CM:
646646
case MM:
647647
drawGridNoTransform( context, dotsPerMM );
@@ -2217,7 +2217,7 @@ void QgsLayoutItemMapGrid::calculateMaxExtension( double &top, double &right, do
22172217
break;
22182218
}
22192219
}
2220-
FALLTHROUGH
2220+
[[fallthrough]];
22212221
case CM:
22222222
case MM:
22232223
drawGridNoTransform( context, 0, true );

‎src/core/layout/qgslayoutitemmapitem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ void QgsLayoutItemMapItemStack::drawItems( QPainter *painter, bool ignoreStackin
279279
if ( !ignoreStacking )
280280
break;
281281

282-
FALLTHROUGH
282+
[[fallthrough]];
283283
case QgsLayoutItemMapItem::StackAboveMapLabels:
284284
item->draw( painter );
285285
break;

‎src/core/pointcloud/qgspointcloudattributebyramprenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ QList<QgsLayerTreeModelLegendNode *> QgsPointCloudAttributeByRampRenderer::creat
193193
mColorRampShader.maximumValue() );
194194
break;
195195
}
196-
Q_FALLTHROUGH();
196+
[[fallthrough]];
197197
case QgsColorRampShader::Discrete:
198198
case QgsColorRampShader::Exact:
199199
{

‎src/core/pointcloud/qgspointcloudlayerexporter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void QgsPointCloudLayerExporter::doExport()
252252
case ExportFormat::Csv:
253253
layerCreationOptions << QStringLiteral( "GEOMETRY=AS_XYZ" )
254254
<< QStringLiteral( "SEPARATOR=COMMA" ); // just in case ogr changes the default lco
255-
FALLTHROUGH
255+
[[fallthrough]];
256256
case ExportFormat::Gpkg:
257257
case ExportFormat::Dxf:
258258
case ExportFormat::Shp:

‎src/core/providers/ogr/qgsogrprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,7 @@ bool QgsOgrProvider::addAttributeOGRLevel( const QgsField &field, bool &ignoreEr
19141914
// other lists are supported at this moment, fall through to default for other types
19151915

19161916
//intentional fall-through
1917-
FALLTHROUGH
1917+
[[fallthrough]];
19181918

19191919
default:
19201920
pushError( tr( "type %1 for field %2 not found" ).arg( field.typeName(), field.name() ) );

‎src/core/qgis.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4933,16 +4933,6 @@ typedef unsigned long long qgssize;
49334933
#endif
49344934
#endif
49354935

4936-
#if __cplusplus >= 201500
4937-
#define FALLTHROUGH [[fallthrough]];
4938-
#elif defined(__clang__)
4939-
#define FALLTHROUGH [[clang::fallthrough]];
4940-
#elif defined(__GNUC__) && __GNUC__ >= 7
4941-
#define FALLTHROUGH [[gnu::fallthrough]];
4942-
#else
4943-
#define FALLTHROUGH
4944-
#endif
4945-
49464936
// see https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html#using-the-nodiscard-attribute
49474937
#if __cplusplus >= 201703L
49484938
#define NODISCARD [[nodiscard]]

‎src/core/qgsmaplayerlegend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ QList<QgsLayerTreeModelLegendNode *> QgsDefaultMeshLayerLegend::createLayerTreeM
577577
}
578578
break;
579579
}
580-
Q_FALLTHROUGH();
580+
[[fallthrough]];
581581
case QgsColorRampShader::Discrete:
582582
case QgsColorRampShader::Exact:
583583
{

‎src/core/qgsogcutils.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,
13051305
case Qgis::WkbType::MultiPoint25D:
13061306
hasZValue = true;
13071307
//intentional fall-through
1308-
FALLTHROUGH
1308+
[[fallthrough]];
13091309
case Qgis::WkbType::MultiPoint:
13101310
{
13111311
QDomElement multiPointElem = doc.createElement( QStringLiteral( "gml:MultiPoint" ) );
@@ -1350,7 +1350,7 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,
13501350
case Qgis::WkbType::LineString25D:
13511351
hasZValue = true;
13521352
//intentional fall-through
1353-
FALLTHROUGH
1353+
[[fallthrough]];
13541354
case Qgis::WkbType::LineString:
13551355
{
13561356
QDomElement lineStringElem = doc.createElement( QStringLiteral( "gml:LineString" ) );
@@ -1393,7 +1393,7 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,
13931393
case Qgis::WkbType::MultiLineString25D:
13941394
hasZValue = true;
13951395
//intentional fall-through
1396-
FALLTHROUGH
1396+
[[fallthrough]];
13971397
case Qgis::WkbType::MultiLineString:
13981398
{
13991399
QDomElement multiLineStringElem = doc.createElement( QStringLiteral( "gml:MultiLineString" ) );
@@ -1451,7 +1451,7 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,
14511451
case Qgis::WkbType::Polygon25D:
14521452
hasZValue = true;
14531453
//intentional fall-through
1454-
FALLTHROUGH
1454+
[[fallthrough]];
14551455
case Qgis::WkbType::Polygon:
14561456
{
14571457
QDomElement polygonElem = doc.createElement( QStringLiteral( "gml:Polygon" ) );
@@ -1513,7 +1513,7 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,
15131513
case Qgis::WkbType::MultiPolygon25D:
15141514
hasZValue = true;
15151515
//intentional fall-through
1516-
FALLTHROUGH
1516+
[[fallthrough]];
15171517
case Qgis::WkbType::MultiPolygon:
15181518
{
15191519
QDomElement multiPolygonElem = doc.createElement( QStringLiteral( "gml:MultiPolygon" ) );

‎src/core/qgsrendercontext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ double QgsRenderContext::convertToPainterUnits( double size, Qgis::RenderUnit un
388388
size = convertMetersToMapUnits( size );
389389
unit = Qgis::RenderUnit::MapUnits;
390390
// Fall through to RenderMapUnits with size in meters converted to size in MapUnits
391-
FALLTHROUGH
391+
[[fallthrough]];
392392
}
393393
case Qgis::RenderUnit::MapUnits:
394394
{
@@ -484,7 +484,7 @@ double QgsRenderContext::convertToMapUnits( double size, Qgis::RenderUnit unit,
484484
{
485485
size = convertMetersToMapUnits( size );
486486
// Fall through to RenderMapUnits with values of meters converted to MapUnits
487-
FALLTHROUGH
487+
[[fallthrough]];
488488
}
489489
case Qgis::RenderUnit::MapUnits:
490490
{

‎src/core/qgsscalecalculator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void QgsScaleCalculator::calculateMetrics( const QgsRectangle &mapExtent, double
111111

112112
case Qgis::DistanceUnit::Unknown:
113113
// assume degrees to maintain old API
114-
FALLTHROUGH
114+
[[fallthrough]];
115115

116116
case Qgis::DistanceUnit::Degrees:
117117
// degrees require conversion to meters first

‎src/core/qgsvectorfilewriter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
733733
}
734734

735735
//intentional fall-through
736-
FALLTHROUGH
736+
[[fallthrough]];
737737

738738
case QVariant::List:
739739
// handle GPKG conversion to JSON
@@ -806,7 +806,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
806806
break;
807807
}
808808
//intentional fall-through
809-
FALLTHROUGH
809+
[[fallthrough]];
810810

811811
default:
812812
//assert(0 && "invalid variant type!");
@@ -2996,7 +2996,7 @@ gdal::ogr_feature_unique_ptr QgsVectorFileWriter::createFeature( const QgsFeatur
29962996
break;
29972997
}
29982998
//intentional fall-through
2999-
FALLTHROUGH
2999+
[[fallthrough]];
30003000

30013001
case QVariant::Map:
30023002
{
@@ -3017,7 +3017,7 @@ gdal::ogr_feature_unique_ptr QgsVectorFileWriter::createFeature( const QgsFeatur
30173017
}
30183018

30193019
//intentional fall-through
3020-
FALLTHROUGH
3020+
[[fallthrough]];
30213021

30223022

30233023
default:

‎src/core/raster/qgssinglebandpseudocolorrenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ QList<QgsLayerTreeModelLegendNode *> QgsSingleBandPseudoColorRenderer::createLeg
461461
}
462462
break;
463463
}
464-
Q_FALLTHROUGH();
464+
[[fallthrough]];
465465
case QgsColorRampShader::Discrete:
466466
case QgsColorRampShader::Exact:
467467
{

‎src/core/symbology/qgssymbol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@ void QgsSymbol::renderFeature( const QgsFeature &feature, QgsRenderContext &cont
15451545
const QgsMultiPoint *mp = qgsgeometry_cast< const QgsMultiPoint * >( processedGeometry );
15461546
markers.reserve( mp->numGeometries() );
15471547
}
1548-
FALLTHROUGH
1548+
[[fallthrough]];
15491549
case Qgis::WkbType::MultiCurve:
15501550
case Qgis::WkbType::MultiLineString:
15511551
case Qgis::WkbType::GeometryCollection:

‎src/core/textrenderer/qgstextrenderer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ void QgsTextRenderer::drawPart( const QRectF &rect, double rotation, Qgis::TextH
478478
if ( !format.buffer().enabled() )
479479
break;
480480
}
481-
FALLTHROUGH
481+
[[fallthrough]];
482482
case Qgis::TextComponent::Text:
483483
case Qgis::TextComponent::Shadow:
484484
{
@@ -528,7 +528,7 @@ void QgsTextRenderer::drawPart( QPointF origin, double rotation, Qgis::TextHoriz
528528
if ( !format.buffer().enabled() )
529529
break;
530530
}
531-
FALLTHROUGH
531+
[[fallthrough]];
532532
case Qgis::TextComponent::Text:
533533
case Qgis::TextComponent::Shadow:
534534
{

‎src/core/vector/qgsvectorlayer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4556,7 +4556,7 @@ QSet<QVariant> QgsVectorLayer::uniqueValues( int index, int limit ) const
45564556
uniqueValues = mDataProvider->uniqueValues( index, limit );
45574557
return uniqueValues;
45584558
}
4559-
FALLTHROUGH
4559+
[[fallthrough]];
45604560
//we need to go through each feature
45614561
case QgsFields::OriginJoin:
45624562
case QgsFields::OriginExpression:
@@ -4655,7 +4655,7 @@ QStringList QgsVectorLayer::uniqueStringsMatching( int index, const QString &sub
46554655
{
46564656
return mDataProvider->uniqueStringsMatching( index, substring, limit, feedback );
46574657
}
4658-
FALLTHROUGH
4658+
[[fallthrough]];
46594659
//we need to go through each feature
46604660
case QgsFields::OriginJoin:
46614661
case QgsFields::OriginExpression:
@@ -4789,7 +4789,7 @@ void QgsVectorLayer::minimumOrMaximumValue( int index, QVariant *minimum, QVaria
47894789
return;
47904790
}
47914791
}
4792-
FALLTHROUGH
4792+
[[fallthrough]];
47934793
// no choice but to go through all features
47944794
case QgsFields::OriginExpression:
47954795
case QgsFields::OriginJoin:

‎src/core/vector/qgsvectorlayerprofilegenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ QVector<QgsAbstractProfileResults::Feature> QgsVectorLayerProfileResults::asFeat
6868
if ( type != Qgis::ProfileExportType::DistanceVsElevationTable )
6969
return asIndividualFeatures( type, feedback );
7070
// distance vs elevation table results are always handled like a continuous surface
71-
FALLTHROUGH
71+
[[fallthrough]];
7272

7373
case Qgis::VectorProfileType::ContinuousSurface:
7474
return QgsAbstractProfileSurfaceResults::asFeatures( type, feedback );

‎src/gui/annotations/qgsmaptoolmodifyannotation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ void QgsMapToolModifyAnnotation::keyPressEvent( QKeyEvent *event )
537537
event->ignore(); // disable default shortcut handling (delete vector feature)
538538
break;
539539
}
540-
FALLTHROUGH
540+
[[fallthrough]];
541541
}
542542

543543
case Action::MoveItem:

‎src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2917,7 +2917,7 @@ QWidget *QgsProcessingEnumWidgetWrapper::createWidget()
29172917
return mCheckboxPanel;
29182918
}
29192919
}
2920-
FALLTHROUGH
2920+
[[fallthrough]];
29212921
case QgsProcessingGui::Modeler:
29222922
case QgsProcessingGui::Batch:
29232923
{

‎src/gui/qgspropertyoverridebutton.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ void QgsPropertyOverrideButton::init( int propertyKey, const QgsProperty &proper
120120
{
121121
case QgsPropertyDefinition::DataTypeBoolean:
122122
ts << tr( "boolean" );
123-
FALLTHROUGH
123+
[[fallthrough]];
124124

125125
case QgsPropertyDefinition::DataTypeNumeric:
126126
ts << tr( "int" );
127127
ts << tr( "double" );
128-
FALLTHROUGH
128+
[[fallthrough]];
129129

130130
case QgsPropertyDefinition::DataTypeString:
131131
ts << tr( "string" );

‎src/plugins/grass/qgsgrassnewmapset.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ int QgsGrassNewMapset::nextId() const
299299
id = MapSet;
300300
break;
301301
}
302-
FALLTHROUGH
302+
[[fallthrough]];
303303
case Database:
304304
case Crs:
305305
case Region:

0 commit comments

Comments
 (0)
Please sign in to comment.