Skip to content

Commit 7e90202

Browse files
committedAug 10, 2017
more msvc warning fixes (followup 03e0298)
1 parent eba3065 commit 7e90202

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed
 

‎src/app/dwg/qgsdwgimporter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,7 @@ void QgsDwgImporter::addSpline( const DRW_Spline *data )
20672067

20682068
size_t npts = cps.size();
20692069
size_t k = data->degree + 1;
2070-
size_t p1 = mSplineSegs * npts;
2070+
int p1 = mSplineSegs * ( int ) npts;
20712071

20722072
std::vector<double> h( npts + 1, 1. );
20732073
std::vector<QgsPointXY> p( p1, QgsPointXY( 0., 0. ) );

‎src/core/geometry/qgsgeometrymakevalid.cpp

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ static GEOSGeometry *collectFacesWithEvenAncestors( Face **faces, int nfaces )
142142
return ret;
143143
}
144144

145+
Q_NOWARN_UNREACHABLE_PUSH
145146
static GEOSGeometry *LWGEOM_GEOS_buildArea( const GEOSGeometry *geom_in, QString &errorMessage )
146147
{
147148
GEOSContextHandle_t handle = QgsGeos::getGEOSHandler();
@@ -159,10 +160,8 @@ static GEOSGeometry *LWGEOM_GEOS_buildArea( const GEOSGeometry *geom_in, QString
159160
}
160161
catch ( GEOSException &e )
161162
{
162-
Q_NOWARN_UNREACHABLE_PUSH
163163
errorMessage = QString( "GEOSPolygonize(): %1" ).arg( e.what() );
164164
return nullptr;
165-
Q_NOWARN_UNREACHABLE_POP
166165
}
167166

168167
// We should now have a collection
@@ -263,8 +262,7 @@ static GEOSGeometry *LWGEOM_GEOS_buildArea( const GEOSGeometry *geom_in, QString
263262

264263
return shp;
265264
}
266-
267-
265+
Q_NOWARN_UNREACHABLE_POP
268266

269267
// Return Nth vertex in GEOSGeometry as a POINT.
270268
// May return NULL if the geometry has NO vertexex.
@@ -468,6 +466,7 @@ static GEOSGeometry *LWGEOM_GEOS_nodeLines( const GEOSGeometry *lines )
468466
}
469467

470468
// Will return NULL on error (expect error handler being called by then)
469+
Q_NOWARN_UNREACHABLE_PUSH
471470
static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QString &errorMessage )
472471
{
473472
GEOSContextHandle_t handle = QgsGeos::getGEOSHandler();
@@ -507,11 +506,9 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
507506
}
508507
catch ( GEOSException &e )
509508
{
510-
Q_NOWARN_UNREACHABLE_PUSH
511509
GEOSGeom_destroy_r( handle, geos_bound );
512510
errorMessage = QString( "GEOSGeom_extractUniquePoints(): %1" ).arg( e.what() );
513511
return nullptr;
514-
Q_NOWARN_UNREACHABLE_POP
515512
}
516513

517514
try
@@ -520,12 +517,10 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
520517
}
521518
catch ( GEOSException &e )
522519
{
523-
Q_NOWARN_UNREACHABLE_PUSH
524520
GEOSGeom_destroy_r( handle, geos_bound );
525521
GEOSGeom_destroy_r( handle, pi );
526522
errorMessage = QString( "GEOSGeom_extractUniquePoints(): %1" ).arg( e.what() );
527523
return nullptr;
528-
Q_NOWARN_UNREACHABLE_POP
529524
}
530525

531526
try
@@ -534,13 +529,11 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
534529
}
535530
catch ( GEOSException &e )
536531
{
537-
Q_NOWARN_UNREACHABLE_PUSH
538532
GEOSGeom_destroy_r( handle, geos_bound );
539533
GEOSGeom_destroy_r( handle, pi );
540534
GEOSGeom_destroy_r( handle, po );
541535
errorMessage = QString( "GEOSDifference(): %1" ).arg( e.what() );
542536
return nullptr;
543-
Q_NOWARN_UNREACHABLE_POP
544537
}
545538

546539
GEOSGeom_destroy_r( handle, pi );
@@ -555,11 +548,9 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
555548
}
556549
catch ( GEOSException &e )
557550
{
558-
Q_NOWARN_UNREACHABLE_PUSH
559551
errorMessage = QString( "GEOSGeom_createEmptyPolygon(): %1" ).arg( e.what() );
560552
GEOSGeom_destroy_r( handle, geos_cut_edges );
561553
return nullptr;
562-
Q_NOWARN_UNREACHABLE_POP
563554
}
564555

565556
// See if an area can be build with the remaining edges
@@ -604,31 +595,27 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
604595
}
605596
catch ( GEOSException &e )
606597
{
607-
Q_NOWARN_UNREACHABLE_PUSH
608598
// We did check for empty area already so
609599
// this must be some other error
610600
errorMessage = QString( "GEOSBoundary() threw an error: %1" ).arg( e.what() );
611601
GEOSGeom_destroy_r( handle, new_area );
612602
GEOSGeom_destroy_r( handle, geos_area );
613603
return nullptr;
614-
Q_NOWARN_UNREACHABLE_POP
615604
}
616605

617-
// Now symdif new and old area
606+
// Now symdiff new and old area
618607
try
619608
{
620609
symdif = GEOSSymDifference_r( handle, geos_area, new_area );
621610
}
622611
catch ( GEOSException &e )
623612
{
624-
Q_NOWARN_UNREACHABLE_PUSH
625613
GEOSGeom_destroy_r( handle, geos_cut_edges );
626614
GEOSGeom_destroy_r( handle, new_area );
627615
GEOSGeom_destroy_r( handle, new_area_bound );
628616
GEOSGeom_destroy_r( handle, geos_area );
629617
errorMessage = QString( "GEOSSymDifference() threw an error: %1" ).arg( e.what() );
630618
return nullptr;
631-
Q_NOWARN_UNREACHABLE_POP
632619
}
633620

634621
GEOSGeom_destroy_r( handle, geos_area );
@@ -650,13 +637,11 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
650637
}
651638
catch ( GEOSException &e )
652639
{
653-
Q_NOWARN_UNREACHABLE_PUSH
654640
GEOSGeom_destroy_r( handle, geos_cut_edges );
655641
GEOSGeom_destroy_r( handle, new_area_bound );
656642
GEOSGeom_destroy_r( handle, geos_area );
657643
errorMessage = QString( "GEOSDifference() threw an error: %1" ).arg( e.what() );
658644
return nullptr;
659-
Q_NOWARN_UNREACHABLE_POP
660645
}
661646
GEOSGeom_destroy_r( handle, geos_cut_edges );
662647
GEOSGeom_destroy_r( handle, new_area_bound );
@@ -704,17 +689,16 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
704689
}
705690
catch ( GEOSException &e )
706691
{
707-
Q_NOWARN_UNREACHABLE_PUSH
708692
errorMessage = QString( "GEOSGeom_createCollection() threw an error: %1" ).arg( e.what() );
709693
// TODO: cleanup!
710694
return nullptr;
711-
Q_NOWARN_UNREACHABLE_POP
712695
}
713696
}
714697

715698
return gout;
716699

717700
}
701+
Q_NOWARN_UNREACHABLE_PUSH
718702

719703
static GEOSGeometry *LWGEOM_GEOS_makeValidLine( const GEOSGeometry *gin, QString &errorMessage )
720704
{
@@ -864,6 +848,7 @@ static GEOSGeometry *LWGEOM_GEOS_makeValid( const GEOSGeometry *gin, QString &er
864848
GEOSContextHandle_t handle = QgsGeos::getGEOSHandler();
865849

866850
// return what we got so far if already valid
851+
Q_NOWARN_UNREACHABLE_PUSH
867852
try
868853
{
869854
if ( GEOSisValid_r( handle, gin ) )
@@ -874,12 +859,11 @@ static GEOSGeometry *LWGEOM_GEOS_makeValid( const GEOSGeometry *gin, QString &er
874859
}
875860
catch ( GEOSException &e )
876861
{
877-
Q_NOWARN_UNREACHABLE_PUSH
878862
// I don't think should ever happen
879863
errorMessage = QString( "GEOSisValid(): %1" ).arg( e.what() );
880864
return nullptr;
881-
Q_NOWARN_UNREACHABLE_POP
882865
}
866+
Q_NOWARN_UNREACHABLE_POP
883867

884868
// make what we got valid
885869

0 commit comments

Comments
 (0)
Please sign in to comment.