MT#55283 make code checkers happy

Fix all instances of argument-less function signatures.

Fix all instances of auto-cleanup variables declared after they need to
be in scope.

Change-Id: I3a005df03ede971e08d4f62d7c7711a1913fda5e
pull/1747/head
Richard Fuchs 2 years ago
parent 494ac006c3
commit 469789bf19

@ -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;

@ -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;

@ -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);
}

@ -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];

@ -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);

@ -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;
}

@ -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;

@ -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;

@ -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;
}

@ -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);
}

@ -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);

@ -48,7 +48,7 @@ void daemonize(void) {
setpgrp();
}
void wpidfile() {
void wpidfile(void) {
FILE *fp;
if (!rtpe_common_config_ptr->pidfile)

@ -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:");

@ -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);

Loading…
Cancel
Save