mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-08-05 20:58:29 +02:00
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:
@@ -77,7 +77,7 @@ int fetch_governors(char governors[MAX_GOVERNORS][MAX_GOVERNOR_LENGTH])
|
||||
}
|
||||
|
||||
/* Only add this governor if it is unique */
|
||||
for (int i = 0; i < num_governors; i++) {
|
||||
for (int j = 0; j < num_governors; j++) {
|
||||
if (strncmp(fullpath, governors[i], MAX_GOVERNOR_LENGTH) == 0) {
|
||||
continue;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ int fetch_governors(char governors[MAX_GOVERNORS][MAX_GOVERNOR_LENGTH])
|
||||
/**
|
||||
* Return the current governor state
|
||||
*/
|
||||
const char *get_gov_state()
|
||||
const char *get_gov_state(void)
|
||||
{
|
||||
/* Cached primary governor state */
|
||||
static char governor[64] = { 0 };
|
||||
|
Reference in New Issue
Block a user