Skip to content

Commit

Permalink
Cleanup error handling in OGRGeometry::Distance().
Browse files Browse the repository at this point in the history
ogrgeometry.cpp(2949) : warning C4804: '>' : unsafe use of type 'bool' in operation
https://ci.appveyor.com/project/rouault/gdal-coverage/build/1.0.6208/job/evth1tke6khomsah


git-svn-id: https://svn.osgeo.org/gdal/trunk@35122 f0d54148-0727-0410-94bb-9a71ac55c965
  • Loading branch information
schwehr committed Aug 15, 2016
1 parent a8ecdd1 commit ac491fe
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gdal/ogr/ogrgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2938,15 +2938,14 @@ double OGRGeometry::Distance( const OGRGeometry *poOtherGeom ) const

if( hThis != NULL && hOther != NULL )
{
bIsErr = CPL_TO_BOOL(
GEOSDistance_r( hGEOSCtxt, hThis, hOther, &dfDistance ));
bIsErr = 0 == GEOSDistance_r( hGEOSCtxt, hThis, hOther, &dfDistance );
}

GEOSGeom_destroy_r( hGEOSCtxt, hThis );
GEOSGeom_destroy_r( hGEOSCtxt, hOther );
freeGEOSContext( hGEOSCtxt );

if ( bIsErr > 0 )
if( !bIsErr )
{
return dfDistance;
}
Expand Down

0 comments on commit ac491fe

Please sign in to comment.