[gdal-dev] int versus bool in C++ method args

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] int versus bool in C++ method args

Kurt Schwehr-2
Hi Even,

With https://trac.osgeo.org/gdal/changeset/41510, would it be possible to use a bool for bDelete since this is a member of a C++ class?  Any C API call could easily convert from an int to a bool and then we have cleaner internals for the C++ side of the house.  Or is there some other reason that had you using an int boolean?

OGRErr          removeCurve( int iIndex, int bDelete = TRUE );

Thanks,
-kurt

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: int versus bool in C++ method args

Even Rouault-2

On mardi 20 février 2018 07:23:48 CET Kurt Schwehr wrote:

> Hi Even,

>

> With https://trac.osgeo.org/gdal/changeset/41510, would it be possible to

> use a bool for bDelete since this is a member of a C++ class? Any C API

> call could easily convert from an int to a bool and then we have cleaner

> internals for the C++ side of the house. Or is there some other reason

> that had you using an int boolean?

>

> OGRErr removeCurve( int iIndex, int bDelete = TRUE );*

 

Hi Kurt,

 

good point. I blindly copied it from similar OGRGeometryCollection::removeGeometry()

 

Just changed the new methods to use bool

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: int versus bool in C++ method args

Kurt Schwehr-2
Awesome!  Thanks.

On Tue, Feb 20, 2018 at 10:37 AM, Even Rouault <[hidden email]> wrote:

On mardi 20 février 2018 07:23:48 CET Kurt Schwehr wrote:

> Hi Even,

>

> With https://trac.osgeo.org/gdal/changeset/41510, would it be possible to

> use a bool for bDelete since this is a member of a C++ class? Any C API

> call could easily convert from an int to a bool and then we have cleaner

> internals for the C++ side of the house. Or is there some other reason

> that had you using an int boolean?

>

> OGRErr removeCurve( int iIndex, int bDelete = TRUE );*

 

Hi Kurt,

 

good point. I blindly copied it from similar OGRGeometryCollection::removeGeometry()

 

Just changed the new methods to use bool

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com




--

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev