mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: make version_printed variable static and local to function
The version_printed variable is used to print version information only once. It was a global variable, but never used outside of its function. Therefore, move it into the function and make it static. Since this is a plain old datatype (POD), it makes no no difference whatsoever whether the static variable is in block scope or not. Indeed, it is initialized in the data segment). Well, we are in C mode and therefore everything has to be POD by definition. I tested this on gcc and clang. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
9f8d593a15
commit
8a0eecfd5e
1 changed files with 1 additions and 1 deletions
|
@ -128,9 +128,9 @@ const char *monthname(int mon)
|
|||
*/
|
||||
bool imported = false;
|
||||
|
||||
bool version_printed = false;
|
||||
void print_version()
|
||||
{
|
||||
static bool version_printed = false;
|
||||
if (version_printed)
|
||||
return;
|
||||
printf("Subsurface v%s,\n", subsurface_git_version());
|
||||
|
|
Loading…
Add table
Reference in a new issue