@@ -142,6 +142,7 @@ static GEOSGeometry *collectFacesWithEvenAncestors( Face **faces, int nfaces )
142
142
return ret;
143
143
}
144
144
145
+ Q_NOWARN_UNREACHABLE_PUSH
145
146
static GEOSGeometry *LWGEOM_GEOS_buildArea ( const GEOSGeometry *geom_in, QString &errorMessage )
146
147
{
147
148
GEOSContextHandle_t handle = QgsGeos::getGEOSHandler ();
@@ -159,10 +160,8 @@ static GEOSGeometry *LWGEOM_GEOS_buildArea( const GEOSGeometry *geom_in, QString
159
160
}
160
161
catch ( GEOSException &e )
161
162
{
162
- Q_NOWARN_UNREACHABLE_PUSH
163
163
errorMessage = QString ( " GEOSPolygonize(): %1" ).arg ( e.what () );
164
164
return nullptr ;
165
- Q_NOWARN_UNREACHABLE_POP
166
165
}
167
166
168
167
// We should now have a collection
@@ -263,8 +262,7 @@ static GEOSGeometry *LWGEOM_GEOS_buildArea( const GEOSGeometry *geom_in, QString
263
262
264
263
return shp;
265
264
}
266
-
267
-
265
+ Q_NOWARN_UNREACHABLE_POP
268
266
269
267
// Return Nth vertex in GEOSGeometry as a POINT.
270
268
// May return NULL if the geometry has NO vertexex.
@@ -468,6 +466,7 @@ static GEOSGeometry *LWGEOM_GEOS_nodeLines( const GEOSGeometry *lines )
468
466
}
469
467
470
468
// Will return NULL on error (expect error handler being called by then)
469
+ Q_NOWARN_UNREACHABLE_PUSH
471
470
static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon ( const GEOSGeometry *gin, QString &errorMessage )
472
471
{
473
472
GEOSContextHandle_t handle = QgsGeos::getGEOSHandler ();
@@ -507,11 +506,9 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
507
506
}
508
507
catch ( GEOSException &e )
509
508
{
510
- Q_NOWARN_UNREACHABLE_PUSH
511
509
GEOSGeom_destroy_r ( handle, geos_bound );
512
510
errorMessage = QString ( " GEOSGeom_extractUniquePoints(): %1" ).arg ( e.what () );
513
511
return nullptr ;
514
- Q_NOWARN_UNREACHABLE_POP
515
512
}
516
513
517
514
try
@@ -520,12 +517,10 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
520
517
}
521
518
catch ( GEOSException &e )
522
519
{
523
- Q_NOWARN_UNREACHABLE_PUSH
524
520
GEOSGeom_destroy_r ( handle, geos_bound );
525
521
GEOSGeom_destroy_r ( handle, pi );
526
522
errorMessage = QString ( " GEOSGeom_extractUniquePoints(): %1" ).arg ( e.what () );
527
523
return nullptr ;
528
- Q_NOWARN_UNREACHABLE_POP
529
524
}
530
525
531
526
try
@@ -534,13 +529,11 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
534
529
}
535
530
catch ( GEOSException &e )
536
531
{
537
- Q_NOWARN_UNREACHABLE_PUSH
538
532
GEOSGeom_destroy_r ( handle, geos_bound );
539
533
GEOSGeom_destroy_r ( handle, pi );
540
534
GEOSGeom_destroy_r ( handle, po );
541
535
errorMessage = QString ( " GEOSDifference(): %1" ).arg ( e.what () );
542
536
return nullptr ;
543
- Q_NOWARN_UNREACHABLE_POP
544
537
}
545
538
546
539
GEOSGeom_destroy_r ( handle, pi );
@@ -555,11 +548,9 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
555
548
}
556
549
catch ( GEOSException &e )
557
550
{
558
- Q_NOWARN_UNREACHABLE_PUSH
559
551
errorMessage = QString ( " GEOSGeom_createEmptyPolygon(): %1" ).arg ( e.what () );
560
552
GEOSGeom_destroy_r ( handle, geos_cut_edges );
561
553
return nullptr ;
562
- Q_NOWARN_UNREACHABLE_POP
563
554
}
564
555
565
556
// See if an area can be build with the remaining edges
@@ -604,31 +595,27 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
604
595
}
605
596
catch ( GEOSException &e )
606
597
{
607
- Q_NOWARN_UNREACHABLE_PUSH
608
598
// We did check for empty area already so
609
599
// this must be some other error
610
600
errorMessage = QString ( " GEOSBoundary() threw an error: %1" ).arg ( e.what () );
611
601
GEOSGeom_destroy_r ( handle, new_area );
612
602
GEOSGeom_destroy_r ( handle, geos_area );
613
603
return nullptr ;
614
- Q_NOWARN_UNREACHABLE_POP
615
604
}
616
605
617
- // Now symdif new and old area
606
+ // Now symdiff new and old area
618
607
try
619
608
{
620
609
symdif = GEOSSymDifference_r ( handle, geos_area, new_area );
621
610
}
622
611
catch ( GEOSException &e )
623
612
{
624
- Q_NOWARN_UNREACHABLE_PUSH
625
613
GEOSGeom_destroy_r ( handle, geos_cut_edges );
626
614
GEOSGeom_destroy_r ( handle, new_area );
627
615
GEOSGeom_destroy_r ( handle, new_area_bound );
628
616
GEOSGeom_destroy_r ( handle, geos_area );
629
617
errorMessage = QString ( " GEOSSymDifference() threw an error: %1" ).arg ( e.what () );
630
618
return nullptr ;
631
- Q_NOWARN_UNREACHABLE_POP
632
619
}
633
620
634
621
GEOSGeom_destroy_r ( handle, geos_area );
@@ -650,13 +637,11 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
650
637
}
651
638
catch ( GEOSException &e )
652
639
{
653
- Q_NOWARN_UNREACHABLE_PUSH
654
640
GEOSGeom_destroy_r ( handle, geos_cut_edges );
655
641
GEOSGeom_destroy_r ( handle, new_area_bound );
656
642
GEOSGeom_destroy_r ( handle, geos_area );
657
643
errorMessage = QString ( " GEOSDifference() threw an error: %1" ).arg ( e.what () );
658
644
return nullptr ;
659
- Q_NOWARN_UNREACHABLE_POP
660
645
}
661
646
GEOSGeom_destroy_r ( handle, geos_cut_edges );
662
647
GEOSGeom_destroy_r ( handle, new_area_bound );
@@ -704,17 +689,16 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
704
689
}
705
690
catch ( GEOSException &e )
706
691
{
707
- Q_NOWARN_UNREACHABLE_PUSH
708
692
errorMessage = QString ( " GEOSGeom_createCollection() threw an error: %1" ).arg ( e.what () );
709
693
// TODO: cleanup!
710
694
return nullptr ;
711
- Q_NOWARN_UNREACHABLE_POP
712
695
}
713
696
}
714
697
715
698
return gout;
716
699
717
700
}
701
+ Q_NOWARN_UNREACHABLE_PUSH
718
702
719
703
static GEOSGeometry *LWGEOM_GEOS_makeValidLine ( const GEOSGeometry *gin, QString &errorMessage )
720
704
{
@@ -864,6 +848,7 @@ static GEOSGeometry *LWGEOM_GEOS_makeValid( const GEOSGeometry *gin, QString &er
864
848
GEOSContextHandle_t handle = QgsGeos::getGEOSHandler ();
865
849
866
850
// return what we got so far if already valid
851
+ Q_NOWARN_UNREACHABLE_PUSH
867
852
try
868
853
{
869
854
if ( GEOSisValid_r ( handle, gin ) )
@@ -874,12 +859,11 @@ static GEOSGeometry *LWGEOM_GEOS_makeValid( const GEOSGeometry *gin, QString &er
874
859
}
875
860
catch ( GEOSException &e )
876
861
{
877
- Q_NOWARN_UNREACHABLE_PUSH
878
862
// I don't think should ever happen
879
863
errorMessage = QString ( " GEOSisValid(): %1" ).arg ( e.what () );
880
864
return nullptr ;
881
- Q_NOWARN_UNREACHABLE_POP
882
865
}
866
+ Q_NOWARN_UNREACHABLE_POP
883
867
884
868
// make what we got valid
885
869
0 commit comments