diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-06-05 20:52:41 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-06-05 20:52:41 +0400 |
commit | 8a6fa6ab3b3807d525967f08e8178f168237eeda (patch) | |
tree | b81ab87319409c75bb2327829ebe1cffdde42009 | |
parent | ee97d0365907a159901c3cb47f9e4a2f5bdd61d6 (diff) | |
download | rspamd-8a6fa6ab3b3807d525967f08e8178f168237eeda.tar.gz rspamd-8a6fa6ab3b3807d525967f08e8178f168237eeda.zip |
Strict prototypes.
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | config.h.in | 2 | ||||
-rw-r--r-- | src/binlog.c | 2 | ||||
-rw-r--r-- | src/client/rspamc.c | 6 | ||||
-rw-r--r-- | src/controller.c | 4 | ||||
-rw-r--r-- | src/fuzzy_storage.c | 2 | ||||
-rw-r--r-- | src/kvstorage.c | 2 | ||||
-rw-r--r-- | src/kvstorage.h | 2 | ||||
-rw-r--r-- | src/kvstorage_server.c | 2 | ||||
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/mem_pool.c | 2 | ||||
-rw-r--r-- | src/mem_pool.h | 2 | ||||
-rw-r--r-- | src/radix.c | 2 | ||||
-rw-r--r-- | src/radix.h | 2 | ||||
-rw-r--r-- | src/smtp.c | 2 | ||||
-rw-r--r-- | src/smtp_proxy.c | 2 | ||||
-rw-r--r-- | src/util.c | 4 | ||||
-rw-r--r-- | src/util.h | 4 |
18 files changed, 29 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 07b8f228f..3279b761f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -655,12 +655,13 @@ ENDIF(LIBUTIL_LIBRARY) # Process with warn flags SET(CMAKE_C_WARN_FLAGS "") CHECK_C_COMPILER_FLAG(-Wall SUPPORT_WALL) -CHECK_C_COMPILER_FLAG(-Wall SUPPORT_W) +CHECK_C_COMPILER_FLAG(-W SUPPORT_W) CHECK_C_COMPILER_FLAG(-Wpointer-arith SUPPORT_WPOINTER) CHECK_C_COMPILER_FLAG(-Wno-unused-parameter SUPPORT_WPARAM) CHECK_C_COMPILER_FLAG(-Wno-unused-function SUPPORT_WFUNCTION) CHECK_C_COMPILER_FLAG(-Wunused-variable SUPPORT_WUNUSED_VAR) CHECK_C_COMPILER_FLAG(-Wno-pointer-sign SUPPORT_WPOINTER_SIGN) +CHECK_C_COMPILER_FLAG(-Wstrict-prototypes SUPPORT_WSTRICT_PROTOTYPES) CHECK_C_COMPILER_FLAG(-pedantic SUPPORT_PEDANTIC_FLAG) CHECK_C_COMPILER_FLAG("-std=c99" SUPPORT_STD_FLAG) IF(SUPPORT_W) @@ -684,6 +685,9 @@ ENDIF(SUPPORT_WUNUSED_VAR) IF(SUPPORT_WPOINTER_SIGN) SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-pointer-sign") ENDIF(SUPPORT_WPOINTER_SIGN) +IF(SUPPORT_WSTRICT_PROTOTYPES) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wstrict-prototypes") +ENDIF(SUPPORT_WSTRICT_PROTOTYPES) IF(SUPPORT_PEDANTIC_FLAG) SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -pedantic") ENDIF(SUPPORT_PEDANTIC_FLAG) @@ -694,9 +698,9 @@ ENDIF(SUPPORT_STD_FLAG) # Optimization flags IF(NOT CMAKE_C_OPT_FLAGS) IF(ENABLE_OPTIMIZATION MATCHES "ON") - SET(CMAKE_C_OPT_FLAGS "-O3") + SET(CMAKE_C_OPT_FLAGS "-O3 -fstrict-aliasing") ELSE(ENABLE_OPTIMIZATION MATCHES "ON") - SET(CMAKE_C_OPT_FLAGS "-O0") + SET(CMAKE_C_OPT_FLAGS "-O0 -fstrict-aliasing") ENDIF(ENABLE_OPTIMIZATION MATCHES "ON") ENDIF(NOT CMAKE_C_OPT_FLAGS) diff --git a/config.h.in b/config.h.in index f33a1b766..eefb541bc 100644 --- a/config.h.in +++ b/config.h.in @@ -448,7 +448,7 @@ typedef struct module_s { typedef struct worker_s { const gchar *name; - gpointer (*worker_init_func)(); + gpointer (*worker_init_func)(void); void (*worker_start_func)(struct rspamd_worker *worker); gboolean has_socket; gboolean unique; diff --git a/src/binlog.c b/src/binlog.c index 47070b3af..233fe4b53 100644 --- a/src/binlog.c +++ b/src/binlog.c @@ -498,7 +498,7 @@ end: } static gboolean -maybe_init_static () +maybe_init_static (void) { if (!binlog_opened) { binlog_opened = g_hash_table_new (g_direct_hash, g_direct_equal); diff --git a/src/client/rspamc.c b/src/client/rspamc.c index c96b5246a..91674f779 100644 --- a/src/client/rspamc.c +++ b/src/client/rspamc.c @@ -330,7 +330,7 @@ add_options (GHashTable *opts) * Scan STDIN */ static void -scan_rspamd_stdin () +scan_rspamd_stdin (void) { gchar *in_buf; @@ -577,7 +577,7 @@ fuzzy_rspamd_file (const gchar *file, gboolean delete) } static void -rspamd_do_stat () +rspamd_do_stat (void) { GError *err = NULL; GString *res; @@ -607,7 +607,7 @@ rspamd_do_stat () } static void -rspamd_do_uptime () +rspamd_do_uptime (void) { GError *err = NULL; GString *res; diff --git a/src/controller.c b/src/controller.c index 1773fc447..15b22f53e 100644 --- a/src/controller.c +++ b/src/controller.c @@ -44,7 +44,7 @@ #define CONTROLLER_IO_TIMEOUT 120 /* Init functions */ -gpointer init_controller (); +gpointer init_controller (void); void start_controller (struct rspamd_worker *worker); worker_t controller_worker = { @@ -1241,7 +1241,7 @@ accept_socket (gint fd, short what, void *arg) } gpointer -init_controller () +init_controller (void) { struct rspamd_controller_ctx *ctx; GQuark type; diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index d8344b96c..93ad41216 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -63,7 +63,7 @@ #define CURRENT_FUZZY_VERSION 1 /* Init functions */ -gpointer init_fuzzy (); +gpointer init_fuzzy (void); void start_fuzzy (struct rspamd_worker *worker); worker_t fuzzy_worker = { diff --git a/src/kvstorage.c b/src/kvstorage.c index 37d2022d9..9cb921d7e 100644 --- a/src/kvstorage.c +++ b/src/kvstorage.c @@ -690,7 +690,7 @@ rspamd_lru_destroy (struct rspamd_kv_expire *e) * Create new LRU cache */ struct rspamd_kv_expire* -rspamd_lru_expire_new () +rspamd_lru_expire_new (void) { struct rspamd_kv_lru_expire *new; diff --git a/src/kvstorage.h b/src/kvstorage.h index d1e2c1635..6d57def12 100644 --- a/src/kvstorage.h +++ b/src/kvstorage.h @@ -206,7 +206,7 @@ gboolean kv_elt_compare_func (gconstpointer e1, gconstpointer e2); /** * LRU expire */ -struct rspamd_kv_expire* rspamd_lru_expire_new (); +struct rspamd_kv_expire* rspamd_lru_expire_new (void); /** * Ordinary hash diff --git a/src/kvstorage_server.c b/src/kvstorage_server.c index e608c63fc..92090d4f6 100644 --- a/src/kvstorage_server.c +++ b/src/kvstorage_server.c @@ -64,7 +64,7 @@ static sig_atomic_t soft_wanna_die = 0; } while (0) /* Init functions */ -gpointer init_keystorage (); +gpointer init_keystorage (void); void start_keystorage (struct rspamd_worker *worker); worker_t keystorage_worker = { diff --git a/src/main.c b/src/main.c index c761bc1d4..d61e48bac 100644 --- a/src/main.c +++ b/src/main.c @@ -156,7 +156,7 @@ chldsigcode (gint code) { /* Prints info about incoming signals by parsing siginfo structures */ static void -print_signals_info () +print_signals_info (void) { siginfo_t *inf; diff --git a/src/mem_pool.c b/src/mem_pool.c index c69cb0388..2c111681f 100644 --- a/src/mem_pool.c +++ b/src/mem_pool.c @@ -660,7 +660,7 @@ memory_pool_stat (memory_pool_stat_t * st) /* By default allocate 8Kb chunks of memory */ #define FIXED_POOL_SIZE 8192 gsize -memory_pool_get_size () +memory_pool_get_size (void) { #ifdef HAVE_GETPAGESIZE return MAX (getpagesize (), FIXED_POOL_SIZE); diff --git a/src/mem_pool.h b/src/mem_pool.h index 970376a9a..79d9d48fe 100644 --- a/src/mem_pool.h +++ b/src/mem_pool.h @@ -276,7 +276,7 @@ void memory_pool_stat (memory_pool_stat_t *st); * Get optimal pool size based on page size for this system * @return size of memory page in system */ -gsize memory_pool_get_size (); +gsize memory_pool_get_size (void); /** * Set memory pool variable diff --git a/src/radix.c b/src/radix.c index 8bcd910bf..bb4a7c228 100644 --- a/src/radix.c +++ b/src/radix.c @@ -30,7 +30,7 @@ static void *radix_alloc (radix_tree_t * tree); radix_tree_t * -radix_tree_create () +radix_tree_create (void) { radix_tree_t *tree; diff --git a/src/radix.h b/src/radix.h index 1a1cd26fd..7e45f5d12 100644 --- a/src/radix.h +++ b/src/radix.h @@ -28,7 +28,7 @@ typedef gboolean (*radix_tree_traverse_func)(guint32 key, guint32 mask, uintptr_ /** * Create new radix tree */ -radix_tree_t *radix_tree_create (); +radix_tree_t *radix_tree_create (void); /** * Insert value to radix tree diff --git a/src/smtp.c b/src/smtp.c index 0c10762bd..6e9d67747 100644 --- a/src/smtp.c +++ b/src/smtp.c @@ -50,7 +50,7 @@ static gboolean smtp_write_socket (void *arg); static sig_atomic_t wanna_die = 0; /* Init functions */ -gpointer init_smtp (); +gpointer init_smtp (void); void start_smtp (struct rspamd_worker *worker); worker_t smtp_worker = { diff --git a/src/smtp_proxy.c b/src/smtp_proxy.c index 78bfaa68d..4cf7fae9f 100644 --- a/src/smtp_proxy.c +++ b/src/smtp_proxy.c @@ -52,7 +52,7 @@ static sig_atomic_t wanna_die = 0; /* Init functions */ -gpointer init_smtp_proxy (); +gpointer init_smtp_proxy (void); void start_smtp_proxy (struct rspamd_worker *worker); worker_t smtp_proxy_worker = { diff --git a/src/util.c b/src/util.c index d569e9be7..ab81a28a5 100644 --- a/src/util.c +++ b/src/util.c @@ -1351,7 +1351,7 @@ rspamd_fallocate (gint fd, off_t offset, off_t len) * @return mutex or NULL */ inline rspamd_mutex_t* -rspamd_mutex_new () +rspamd_mutex_new (void) { rspamd_mutex_t *new; @@ -1398,7 +1398,7 @@ rspamd_mutex_unlock (rspamd_mutex_t *mtx) * @return */ rspamd_rwlock_t* -rspamd_rwlock_new () +rspamd_rwlock_new (void) { rspamd_rwlock_t *new; diff --git a/src/util.h b/src/util.h index 0d9834a76..1db0166d9 100644 --- a/src/util.h +++ b/src/util.h @@ -251,7 +251,7 @@ typedef struct rspamd_rwlock_s { * Create new mutex * @return mutex or NULL */ -rspamd_mutex_t* rspamd_mutex_new (); +rspamd_mutex_t* rspamd_mutex_new (void); /** * Lock mutex @@ -269,7 +269,7 @@ void rspamd_mutex_unlock (rspamd_mutex_t *mtx); * Create new rwloc * @return */ -rspamd_rwlock_t* rspamd_rwlock_new (); +rspamd_rwlock_t* rspamd_rwlock_new (void); /** * Lock rwlock for writing |