diff --git a/daemon/call.c b/daemon/call.c index 8de1cf73b..19429ce44 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -496,7 +496,7 @@ destroy: free(url_suffix); } -enum thread_looper_action call_timer() { +enum thread_looper_action call_timer(void) { struct iterator_helper hlp; ZERO(hlp); @@ -518,7 +518,7 @@ enum thread_looper_action call_timer() { #undef DS -int call_init() { +int call_init(void) { rtpe_callhash = g_hash_table_new(str_hash, str_equal); if (!rtpe_callhash) return -1; diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 23e96dcc2..aeb4ddab6 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -2319,6 +2319,8 @@ static void ng_stats_monologue(bencode_item_t *dict, const struct call_monologue { bencode_item_t *sub, *medias = NULL; struct call_media *m; + AUTO_CLEANUP(GQueue mls_subscriptions, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ + AUTO_CLEANUP(GQueue mls_subscribers, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ if (!ml) return; @@ -2343,8 +2345,6 @@ static void ng_stats_monologue(bencode_item_t *dict, const struct call_monologue bencode_item_t *b_subscriptions = bencode_dictionary_add_list(sub, "subscriptions"); bencode_item_t *b_subscribers = bencode_dictionary_add_list(sub, "subscribers"); - AUTO_CLEANUP(GQueue mls_subscriptions, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ - AUTO_CLEANUP(GQueue mls_subscribers, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ for (int i = 0; i < ml->medias->len; i++) { struct call_media * media = ml->medias->pdata[i]; @@ -3619,7 +3619,7 @@ const char *call_unsubscribe_ng(bencode_item_t *input, bencode_item_t *output) { } -void call_interfaces_free() { +void call_interfaces_free(void) { if (info_re) { pcre2_code_free(info_re); info_re = NULL; @@ -3631,7 +3631,7 @@ void call_interfaces_free() { } } -int call_interfaces_init() { +int call_interfaces_init(void) { int errcode; PCRE2_SIZE erroff; diff --git a/daemon/control_ng.c b/daemon/control_ng.c index b5589f4b6..f87c66e88 100644 --- a/daemon/control_ng.c +++ b/daemon/control_ng.c @@ -601,11 +601,11 @@ void notify_ng_tcp_clients(str *data) { mutex_unlock(&tcp_connections_lock); } -void control_ng_init() { +void control_ng_init(void) { mutex_init(&rtpe_cngs_lock); rtpe_cngs_hash = g_hash_table_new(sockaddr_t_hash, sockaddr_t_eq); cookie_cache_init(&ng_cookie_cache); } -void control_ng_cleanup() { +void control_ng_cleanup(void) { cookie_cache_cleanup(&ng_cookie_cache); } diff --git a/daemon/crypto.c b/daemon/crypto.c index 060fc44dc..05e9ec345 100644 --- a/daemon/crypto.c +++ b/daemon/crypto.c @@ -1005,7 +1005,7 @@ out: return *buf; } -void crypto_init_main() { +void crypto_init_main(void) { struct crypto_suite *cs; for (unsigned int i = 0; i < num_crypto_suites; i++) { cs = &__crypto_suites[i]; diff --git a/daemon/dtls.c b/daemon/dtls.c index b25df8dc2..73ec4f338 100644 --- a/daemon/dtls.c +++ b/daemon/dtls.c @@ -377,7 +377,7 @@ err: return -1; } -int dtls_init() { +int dtls_init(void) { int i; char *p; @@ -460,7 +460,7 @@ static unsigned int sha_512_func(unsigned char *o, X509 *x) { } -struct dtls_cert *dtls_cert() { +struct dtls_cert *dtls_cert(void) { struct dtls_cert *ret; rwlock_lock_r(&__dtls_cert_lock); diff --git a/daemon/homer.c b/daemon/homer.c index e38c8178c..a4365ec22 100644 --- a/daemon/homer.c +++ b/daemon/homer.c @@ -565,6 +565,6 @@ static int send_hepv3 (GString *s, const str *id, int capt_id, const endpoint_t return 0; } -int has_homer() { +int has_homer(void) { return main_homer_sender ? 1 : 0; } diff --git a/daemon/kernel.c b/daemon/kernel.c index 7d89ecb40..bf36490f1 100644 --- a/daemon/kernel.c +++ b/daemon/kernel.c @@ -201,7 +201,7 @@ int kernel_del_stream_stats(struct rtpengine_command_del_target_stats *cmd) { return -1; } -GList *kernel_list() { +GList *kernel_list(void) { char s[64]; int fd; struct rtpengine_list_entry *buf; diff --git a/daemon/load.c b/daemon/load.c index 95b7d698e..c8c5c07c0 100644 --- a/daemon/load.c +++ b/daemon/load.c @@ -14,7 +14,7 @@ int cpu_usage; // percent times 100 (0 - 9999) static long used_last, idle_last; -enum thread_looper_action load_thread() { +enum thread_looper_action load_thread(void) { // anything to do? if (!rtpe_config.load_limit && !rtpe_config.cpu_limit) return TLA_BREAK; diff --git a/daemon/rtcp.c b/daemon/rtcp.c index 0c8338730..6d4c8f67e 100644 --- a/daemon/rtcp.c +++ b/daemon/rtcp.c @@ -1405,7 +1405,7 @@ static void transcode_sr_wrap(struct rtcp_process_ctx *ctx, struct sender_report -void rtcp_init() { +void rtcp_init(void) { rtcp_handlers.logging = _log_facility_rtcp ? &log_handlers : &dummy_handlers; rtcp_handlers.homer = has_homer() ? &homer_handlers : &dummy_handlers; } diff --git a/daemon/sdp.c b/daemon/sdp.c index 6bb0d5055..d4eb61a77 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -3393,6 +3393,6 @@ next: return 1; } -void sdp_init() { +void sdp_init(void) { rand_hex_str(rtpe_instance_id.s, rtpe_instance_id.len / 2); } diff --git a/daemon/statistics.c b/daemon/statistics.c index 503546e78..f1192b436 100644 --- a/daemon/statistics.c +++ b/daemon/statistics.c @@ -930,7 +930,7 @@ void statistics_free_metrics(GQueue **q) { *q = NULL; } -void statistics_free() { +void statistics_free(void) { mutex_destroy(&rtpe_codec_stats_lock); g_hash_table_destroy(rtpe_codec_stats); } @@ -942,7 +942,7 @@ static void codec_stats_free(void *p) { g_slice_free1(sizeof(*stats_entry), stats_entry); } -void statistics_init() { +void statistics_init(void) { gettimeofday(&rtpe_started, NULL); //rtpe_totalstats_interval.managed_sess_min = 0; // already zeroed //rtpe_totalstats_interval.managed_sess_max = 0; @@ -1022,7 +1022,7 @@ const char *statistics_ng(bencode_item_t *input, bencode_item_t *output) { /** * Separate thread for update of running min/max call counters. */ -enum thread_looper_action call_rate_stats_updater() { +enum thread_looper_action call_rate_stats_updater(void) { static struct timeval last_run; stats_rate_min_max(&rtpe_rate_graphite_min_max, &rtpe_stats_rate); diff --git a/lib/auxlib.c b/lib/auxlib.c index 61b1f964a..4d1a22399 100644 --- a/lib/auxlib.c +++ b/lib/auxlib.c @@ -48,7 +48,7 @@ void daemonize(void) { setpgrp(); } -void wpidfile() { +void wpidfile(void) { FILE *fp; if (!rtpe_common_config_ptr->pidfile) diff --git a/lib/loglib.c b/lib/loglib.c index d251ff2dd..b1faa9fdb 100644 --- a/lib/loglib.c +++ b/lib/loglib.c @@ -263,7 +263,7 @@ void log_init(const char *handle) { openlog(handle, LOG_PID | LOG_NDELAY, ilog_facility); } -void log_free() { +void log_free(void) { g_hash_table_destroy(__log_limiter); pthread_mutex_destroy(&__log_limiter_lock); } @@ -279,7 +279,7 @@ int parse_log_facility(const char *name, int *dst) { return 0; } -void print_available_log_facilities () { +void print_available_log_facilities(void) { int i; fprintf(stderr, "available facilities:"); diff --git a/recording-daemon/mix.c b/recording-daemon/mix.c index 388107e58..386ab6a4a 100644 --- a/recording-daemon/mix.c +++ b/recording-daemon/mix.c @@ -216,7 +216,7 @@ err: } -mix_t *mix_new() { +mix_t *mix_new(void) { mix_t *mix = g_slice_alloc0(sizeof(*mix)); format_init(&mix->in_format); format_init(&mix->out_format);