[gdal-dev] Refactoring: class members clean-up

Even Rouault even.rouault at spatialys.com
Fri Oct 16 10:30:55 PDT 2015


Le vendredi 16 octobre 2015 18:11:17, Mateusz Loskot a écrit :
> Hi,
> 
> I noticed Kurt has been applying lots of non-functional code improvements,
> refactoring, and cleaning compilation warnings, etc.
> 
> I have been considering similar clean-up also to unify class member names
> which often lead to compilation warnings due to declaration hiding.
> 
> I committed a short example of such refactoring:
> https://trac.osgeo.org/gdal/changeset/31023
> 
> Would that be something acceptable across the whole source code?

I guess Kurt will point to
https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Variable_Names
with the blabla_ convention ;-)

This underscore suffix convention is used in very few places, mainly the (old) KML driver AFAIK

The m_ convention is used a bit more often in the GDAL code base.

If we adopt any convention, this should be added to https://trac.osgeo.org/gdal/wiki/rfc8_devguide

Personnaly I find the m_ convention more readable as the trailing underscore
is easy to miss, but perhaps that is the intention ?

Whatever convention would be used, I'd advise not to apply it to public or
protected members of GDAL exported classes (like the ones of gcore/gdal_priv.h),
because that could break external plugins. Or that would require more advertizing of the change.

> 
> From my experience, cleaning up such trivias sometimes reveals very
> subtle bugs, so it has potential to improve functional quality as well.
> 
> I'm willing to join Kurt's efforts.

Some coordination might be required to avoid stepping on each other toes.

> 
> Best regards,

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list