From beab5f63b828309259fd92dae8261ee2ffa3c697 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 10 May 2021 22:31:14 +0200 Subject: [PATCH] TT#111150 Fix function prototypes Change-Id: I001d5079c9babf9b617cbe79a2714674ee5df6e1 Warned-by: gcc -Wstrict-prototypes --- Makefile | 2 +- config.h | 2 +- daemonizer.h | 2 +- mediator.c | 12 ++++++------ medmysql.c | 2 +- medmysql.h | 6 +++--- medredis.h | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 47b347b..7df074c 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ MYSQL_CFLAGS := -I/usr/include/mysql MYSQL_LDFLAGS := -lmysqlclient endif -CFLAGS ?= -g -Wall -Wextra -O2 +CFLAGS ?= -g -Wall -Wextra -Wstrict-prototypes -O2 CFLAGS += -D_GNU_SOURCE CFLAGS += $(GLIB_CFLAGS) CFLAGS += $(MYSQL_CFLAGS) diff --git a/config.h b/config.h index c0b1661..c900078 100644 --- a/config.h +++ b/config.h @@ -51,6 +51,6 @@ extern int config_intermediate_interval; extern med_loglevel_t config_loglevel; int config_parse(int argc, char **argv); -void config_cleanup(); +void config_cleanup(void); #endif /* _CONFIG_H */ diff --git a/daemonizer.h b/daemonizer.h index b637900..9633929 100644 --- a/daemonizer.h +++ b/daemonizer.h @@ -3,7 +3,7 @@ #include "mediator.h" -int daemonize(); +int daemonize(void); int write_pid(const char *pidfile); #endif /* _DAEMONIZER_H */ diff --git a/mediator.c b/mediator.c index 4133669..65c083b 100644 --- a/mediator.c +++ b/mediator.c @@ -33,7 +33,7 @@ GHashTable *med_call_stat_info_table = NULL; GHashTable *med_cdr_tag_table = NULL; /**********************************************************************/ -static int mediator_load_maps() +static int mediator_load_maps(void) { med_peer_ip_table = g_hash_table_new_full(g_str_hash, g_str_equal, free, free); med_peer_host_table = g_hash_table_new_full(g_str_hash, g_str_equal, free, free); @@ -60,7 +60,7 @@ static void mediator_print_mapentry(gpointer key, gpointer value, gpointer d __a } /**********************************************************************/ -static void mediator_destroy_maps() +static void mediator_destroy_maps(void) { if(med_peer_ip_table) g_hash_table_destroy(med_peer_ip_table); @@ -84,7 +84,7 @@ static void mediator_destroy_maps() } /**********************************************************************/ -static void mediator_print_maps() +static void mediator_print_maps(void) { L_DEBUG("Peer IP map:"); g_hash_table_foreach(med_peer_ip_table, mediator_print_mapentry, NULL); @@ -99,7 +99,7 @@ static void mediator_print_maps() } /**********************************************************************/ -static void mediator_unlock() +static void mediator_unlock(void) { L_DEBUG("Unlocking mediator."); @@ -110,7 +110,7 @@ static void mediator_unlock() } /**********************************************************************/ -static void mediator_exit() +static void mediator_exit(void) { mediator_unlock(); config_cleanup(); @@ -125,7 +125,7 @@ static void mediator_signal(int signal) } /**********************************************************************/ -static int mediator_lock() +static int mediator_lock(void) { struct stat sb; diff --git a/medmysql.c b/medmysql.c index 9164c75..befd027 100644 --- a/medmysql.c +++ b/medmysql.c @@ -88,7 +88,7 @@ static int medmysql_flush_int_cdr(struct medmysql_batches *); static int medmysql_flush_all_med(struct medmysql_batches *); static int medmysql_flush_med_str(struct medmysql_str *); static int medmysql_flush_medlist(struct medmysql_str *); -static int medmysql_flush_call_stat_info(); +static int medmysql_flush_call_stat_info(void); static void medmysql_handler_close(medmysql_handler **h); static int medmysql_handler_transaction(medmysql_handler *h); diff --git a/medmysql.h b/medmysql.h index 63757ac..d78ff10 100644 --- a/medmysql.h +++ b/medmysql.h @@ -50,8 +50,8 @@ struct medmysql_call_stat_info_t { uint64_t amount; }; -int medmysql_init(); -void medmysql_cleanup(); +int medmysql_init(void); +void medmysql_cleanup(void); med_callid_t *medmysql_fetch_callids(uint64_t *count); int medmysql_fetch_records(med_callid_t *callid, med_entry_t **entries, uint64_t *count, int warn_empty); int medmysql_trash_entries(const char *callid, struct medmysql_batches *); @@ -61,7 +61,7 @@ int medmysql_insert_cdrs(cdr_entry_t *records, uint64_t count, struct medmysql_b int medmysql_delete_intermediate(cdr_entry_t *records, uint64_t count, struct medmysql_batches *); int medmysql_load_maps(GHashTable *ip_table, GHashTable *host_table, GHashTable *id_table); int medmysql_load_uuids(GHashTable *uuid_table); -int medmysql_load_db_ids(); +int medmysql_load_db_ids(void); int medmysql_load_cdr_tag_ids(GHashTable *cdr_tag_table); int medmysql_batch_start(struct medmysql_batches *); int medmysql_batch_end(struct medmysql_batches *); diff --git a/medredis.h b/medredis.h index 9eedfc2..3d39e44 100644 --- a/medredis.h +++ b/medredis.h @@ -6,8 +6,8 @@ #include "mediator.h" #include "cdr.h" -int medredis_init(); -void medredis_cleanup(); +int medredis_init(void); +void medredis_cleanup(void); med_callid_t *medredis_fetch_callids(uint64_t *count); int medredis_fetch_records(med_callid_t *callid, med_entry_t **entries, uint64_t *count); int medredis_trash_entries(med_entry_t *records, uint64_t count);