Skip to content

Commit

Permalink
int bFoo -> bool bFoo in gml2ogrgeometry.cpp, ograssemblepolygon.cpp,…
Browse files Browse the repository at this point in the history
… ogrcircularstring.cpp, ogrct.cpp.

Also:
- Add const to a few locals
- /* */ -> //
- Fit to 80 cols
- Localize loop counters
- Fix formatting


git-svn-id: https://svn.osgeo.org/gdal/trunk@35115 f0d54148-0727-0410-94bb-9a71ac55c965
  • Loading branch information
schwehr committed Aug 15, 2016
1 parent bc6a7fa commit 1a67f10
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 66 deletions.
22 changes: 12 additions & 10 deletions gdal/ogr/gml2ogrgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,11 @@ static bool ParseGMLCoordinates( const CPLXMLNode *psGeomNode, OGRGeometry *poGe
OGRPoint oPoint;
if( ParseGMLCoordinates( psPointPropertyIter, &oPoint, nSRSDimension ) )
{
int bSuccess = AddPoint( poGeometry, oPoint.getX(),
oPoint.getY(), oPoint.getZ(),
oPoint.getCoordinateDimension() );
if (bSuccess)
const bool bSuccess =
AddPoint( poGeometry, oPoint.getX(),
oPoint.getY(), oPoint.getZ(),
oPoint.getCoordinateDimension() );
if( bSuccess )
bHasFoundPosElement = true;
else
return false;
Expand Down Expand Up @@ -466,18 +467,19 @@ static bool ParseGMLCoordinates( const CPLXMLNode *psGeomNode, OGRGeometry *poGe
return false;
}

double dfX = OGRFastAtof(pszX);
double dfY = OGRFastAtof(pszY);
double dfZ = (pszZ != NULL) ? OGRFastAtof(pszZ) : 0.0;
int bSuccess = AddPoint( poGeometry, dfX, dfY, dfZ, (pszZ != NULL) ? 3 : 2 );
const double dfX = OGRFastAtof(pszX);
const double dfY = OGRFastAtof(pszY);
const double dfZ = (pszZ != NULL) ? OGRFastAtof(pszZ) : 0.0;
const bool bSuccess =
AddPoint( poGeometry, dfX, dfY, dfZ, (pszZ != NULL) ? 3 : 2 );

if (bSuccess)
if( bSuccess )
bHasFoundPosElement = true;
else
return false;
}

if (bHasFoundPosElement)
if( bHasFoundPosElement )
return true;

/* -------------------------------------------------------------------- */
Expand Down
8 changes: 4 additions & 4 deletions gdal/ogr/ograssemblepolygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static bool CheckPoints( OGRLineString *poLine1, int iPoint1,
/************************************************************************/

static void AddEdgeToRing( OGRLinearRing * poRing, OGRLineString * poLine,
int bReverse )
bool bReverse )

{
/* -------------------------------------------------------------------- */
Expand Down Expand Up @@ -235,7 +235,7 @@ OGRGeometryH OGRBuildPolygonFromEdges( OGRGeometryH hLines,
&& bWorkDone )
{
int iBestEdge = -1;
int bReverse = FALSE;
bool bReverse = false;

bWorkDone = false;
dfBestDist = dfTolerance;
Expand All @@ -259,14 +259,14 @@ OGRGeometryH OGRBuildPolygonFromEdges( OGRGeometryH hLines,
&dfBestDist) )
{
iBestEdge = iEdge;
bReverse = FALSE;
bReverse = false;
}
if( CheckPoints(poLine,poLine->getNumPoints()-1,
poRing,poRing->getNumPoints()-1,
&dfBestDist) )
{
iBestEdge = iEdge;
bReverse = TRUE;
bReverse = true;
}

// if we use exact comparison, jump now
Expand Down
6 changes: 3 additions & 3 deletions gdal/ogr/ogrcircularstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,13 @@ void OGRCircularString::Value( double dfDistance, OGRPoint * poPoint ) const
/* CurveToLine() */
/************************************************************************/

OGRLineString* OGRCircularString::CurveToLine(double dfMaxAngleStepSizeDegrees,
const char* const* papszOptions) const
OGRLineString* OGRCircularString::CurveToLine(
double dfMaxAngleStepSizeDegrees, const char* const* papszOptions ) const
{
OGRLineString* poLine = new OGRLineString();
poLine->assignSpatialReference(getSpatialReference());

int bHasZ = (getCoordinateDimension() == 3);
const bool bHasZ = getCoordinateDimension() == 3;
for( int i = 0; i < nPointCount - 2; i += 2 )
{
OGRLineString* poArc = OGRGeometryFactory::curveToLineString(
Expand Down
Loading

0 comments on commit 1a67f10

Please sign in to comment.