mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-11-15 05:14:29 +01: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:
@@ -34,11 +34,11 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(__attribute__((unused)) int argc, __attribute__((unused)) char **argv)
|
||||
int main(void)
|
||||
{
|
||||
/* Request we start game mode */
|
||||
if (gamemode_request_start() != 0) {
|
||||
printf("Failed to request gamemode start: %s...\n", gamemode_error_string());
|
||||
fprintf(stderr, "Failed to request gamemode start: %s...\n", gamemode_error_string());
|
||||
}
|
||||
|
||||
/* Simulate running a game */
|
||||
@@ -46,6 +46,6 @@ int main(__attribute__((unused)) int argc, __attribute__((unused)) char **argv)
|
||||
|
||||
/* Request we end game mode (optional) */
|
||||
if (gamemode_request_end() != 0) {
|
||||
printf("Failed to request gamemode end: %s...\n", gamemode_error_string());
|
||||
fprintf(stderr, "Failed to request gamemode end: %s...\n", gamemode_error_string());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user