osm2pgsql-dev / osm2pgsql

OpenStreetMap data to PostgreSQL converter
https://osm2pgsql.org
GNU General Public License v2.0
1.48k stars 473 forks source link

Use anonymous namespaces instead of declaring static functions #2203

Closed joto closed 3 months ago

joto commented 3 months ago

This is recommended in C++ Core Guidelines SF.22 https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-unnamed2

Sorry for the long PR. This basically sticks a namespace { ... } // anonymous namespace around all sections that had static functions and removes the static keyword. In some cases I moved some functions around to consolidate several anon namespace sections into one. This is not consistently done though, in some case I thought it to be better to leave the anon section in the context of the code around it.