Minor C cleanup (#27)

* Minor C cleanup

 - some symbols can be made static:
    1. set_gov_state
    2. everything in gamemode_client.h
 - daemonize() can also take a const char*, since the name is only
   passed to printf() or syslog()
 - prevent shadowing of variables
 - use explicit (void) as parameter-list more consistently
 - use some more const.
   Move cast to more appropriate place and document that execv() behaves
   as if args where of type const *char and we trust on that.
 - example: Just use main(void), which is also an acceptable ISO-C decl
 - example: Use stderr for errors

* Fix -Wold-style-declaration issue
This commit is contained in:
Leonard
2018-04-16 18:21:35 +02:00
committed by Marc Di Luzio
parent ce64b59381
commit d26ac60da0
8 changed files with 34 additions and 27 deletions

View File

@@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
/**
* Sets all governors to a value
*/
void set_gov_state(const char *value)
static void set_gov_state(const char *value)
{
char governors[MAX_GOVERNORS][MAX_GOVERNOR_LENGTH] = { { 0 } };
int num = fetch_governors(governors);