]> git.sur5r.net Git - i3/i3status/commitdiff
Use (void) instead of () for functions without args (Thanks fernandotcl)
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 7 May 2012 06:27:28 +0000 (08:27 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 7 May 2012 06:28:04 +0000 (08:28 +0200)
See also:
http://article.gmane.org/gmane.linux.kernel/1268792

The C compiler will handle (void) as "no arguments" and () as "variadic
function" (equivalent to (...)) which might lead to subtle errors.

i3status.c
src/auto_detect_format.c
src/output.c
src/print_ipv6_addr.c

index 3c5e3ce06e2246316c5bd71dc0751669ed8937e6..15c58da668eab3e2cead1d81ee5a4cc97fec60af 100644 (file)
@@ -121,7 +121,7 @@ static char *resolve_tilde(const char *path) {
         return result;
 }
 
         return result;
 }
 
-static char *get_config_path() {
+static char *get_config_path(void) {
         char *xdg_config_home, *xdg_config_dirs, *config_path;
 
         /* 1: check the traditional path under the home directory */
         char *xdg_config_home, *xdg_config_dirs, *config_path;
 
         /* 1: check the traditional path under the home directory */
index 7c4d65d6adee54697a8a752a57fb7554fb104a50..46e5f95937052a22d449e781efc760c99f60289a 100644 (file)
@@ -29,7 +29,7 @@
  * We then check whether the pipe target’s name is known and chose the format.
  *
  */
  * We then check whether the pipe target’s name is known and chose the format.
  *
  */
-char *auto_detect_format() {
+char *auto_detect_format(void) {
     pid_t myppid = getppid();
     pid_t mypid = getpid();
 
     pid_t myppid = getppid();
     pid_t mypid = getpid();
 
index c0c1480bcbed785bf6f0ee03ac9327379df7b9a4..c4a2d275cde9864b00561d94e2eaffbb5eab76e6 100644 (file)
@@ -32,13 +32,13 @@ char *color(const char *colorstr) {
  * Some color formats (xmobar) require to terminate colors again
  *
  */
  * Some color formats (xmobar) require to terminate colors again
  *
  */
-char *endcolor() {
+char *endcolor(void) {
         if (output_format == O_XMOBAR)
                 return "</fc>";
         else return "";
 }
 
         if (output_format == O_XMOBAR)
                 return "</fc>";
         else return "";
 }
 
-void print_seperator() {
+void print_seperator(void) {
         if (output_format == O_DZEN2)
                 printf("^fg(%s)^p(5;-2)^ro(2)^p()^fg()^p(5)", cfg_getstr(cfg_general, "color_separator"));
         else if (output_format == O_XMOBAR)
         if (output_format == O_DZEN2)
                 printf("^fg(%s)^p(5;-2)^ro(2)^p()^fg()^p(5)", cfg_getstr(cfg_general, "color_separator"));
         else if (output_format == O_XMOBAR)
index 21974f317b742fa778132b074ac1e6e6195cb9d7..f987b596b1471dc2cbaea3de25707619582cfc19 100644 (file)
@@ -64,7 +64,7 @@ static char *get_sockname(struct addrinfo *addr) {
  * Returns the IPv6 address with which you have connectivity at the moment.
  * The char * is statically allocated and mustn't be freed
  */
  * Returns the IPv6 address with which you have connectivity at the moment.
  * The char * is statically allocated and mustn't be freed
  */
-static char *get_ipv6_addr() {
+static char *get_ipv6_addr(void) {
         struct addrinfo hints;
         struct addrinfo *result, *resp;
         static struct addrinfo *cached = NULL;
         struct addrinfo hints;
         struct addrinfo *result, *resp;
         static struct addrinfo *cached = NULL;