add -Wbad-function-cast to +CPPFLAGS and fix two compiler warnings
authorAndre Noll <maan@systemlinux.org>
Sat, 19 May 2007 11:19:27 +0000 (13:19 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 19 May 2007 11:19:27 +0000 (13:19 +0200)
Makefile.in
daemon.c
grab_client.c

index cd9e283dd96a7e1268bfda8ba6d1525b12c61533..9a10859f65c4c04c63a889f6b039e38149437966 100644 (file)
@@ -20,8 +20,9 @@ DEBUG_CPPFLAGS += -Wredundant-decls
 # produces false positives
 # DEBUG_CPPFLAGS += -Wunreachable-code
 # DEBUG_CPPFLAGS += -Wwrite-strings
 # produces false positives
 # DEBUG_CPPFLAGS += -Wunreachable-code
 # DEBUG_CPPFLAGS += -Wwrite-strings
-# invalid option for gcc-3.3.5
+# invalid option for gcc-3.3.3
 # DEBUG_CPPFLAGS += -Wextra
 # DEBUG_CPPFLAGS += -Wextra
+# DEBUG_CPPFLAGS += -Wold-style-definition
 
 CPPFLAGS += -Os
 CPPFLAGS += -Wall
 
 CPPFLAGS += -Os
 CPPFLAGS += -Wall
@@ -40,6 +41,7 @@ CPPFLAGS += -Werror-implicit-function-declaration
 CPPFLAGS += -Wmissing-format-attribute
 CPPFLAGS += -Wunused-macros
 CPPFLAGS += -Wshadow
 CPPFLAGS += -Wmissing-format-attribute
 CPPFLAGS += -Wunused-macros
 CPPFLAGS += -Wshadow
+CPPFLAGS += -Wbad-function-cast
 
 BINARIES = para_server para_client para_gui para_audioc para_recv \
        para_filter para_write @extra_binaries@
 
 BINARIES = para_server para_client para_gui para_audioc para_recv \
        para_filter para_write @extra_binaries@
index 46eb8f19196acfe37f280eb6650223437acdbf1b..67bc6f2f68af48ac9b99caf1c7a40d08363777dd 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -171,13 +171,15 @@ time_t server_uptime(enum uptime set_or_get)
 {
        static time_t startuptime;
        time_t now;
 {
        static time_t startuptime;
        time_t now;
+       double diff;
 
        if (set_or_get == UPTIME_SET) {
                time(&startuptime);
                return 0;
        }
        time(&now);
 
        if (set_or_get == UPTIME_SET) {
                time(&startuptime);
                return 0;
        }
        time(&now);
-       return (time_t) difftime(now, startuptime);
+       diff = difftime(now, startuptime);
+       return (time_t) diff;
 }
 
 /**
 }
 
 /**
index 50594f238aeb5d579c6cb0c627fb3c4b5fe51f4a..20b90651b1862275e749f93970479e24cd68b417 100644 (file)
@@ -277,7 +277,7 @@ err_out:
  * This has to be called once during startup before any other function from
  * grab_client.c may be used. It initializes \a inactive_grab_client_list.
  */
  * This has to be called once during startup before any other function from
  * grab_client.c may be used. It initializes \a inactive_grab_client_list.
  */
-void init_grabbing()
+void init_grabbing(void)
 {
        PARA_INFO_LOG("%s", "grab init\n");
        INIT_LIST_HEAD(&inactive_grab_client_list);
 {
        PARA_INFO_LOG("%s", "grab init\n");
        INIT_LIST_HEAD(&inactive_grab_client_list);