Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use anonymous namespaces instead of declaring static functions #2203

Merged
merged 1 commit into from
Jun 16, 2024

Conversation

joto
Copy link
Collaborator

@joto joto commented Jun 16, 2024

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.

flex_table_column_t *column,
std::size_t expire_outputs_size,
bool append_mode)
} // anonymous namespace
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too early? The functions below were all static.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have fixed this and rebased to current master.

@joto joto force-pushed the static-to-anon-ns branch from 8409913 to eee1cd5 Compare June 16, 2024 14:58
@lonvia lonvia merged commit 23b6634 into osm2pgsql-dev:master Jun 16, 2024
26 checks passed
@joto joto deleted the static-to-anon-ns branch June 16, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants