From b0a0432e8d26414d77cfeb81ab2e6c10896c6883 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 13 Apr 2026 17:35:29 +0200 Subject: Silence warnings about function declaration without a prototype for functions taking void --- ot_accesslist.c | 4 ++-- ot_accesslist.h | 2 +- ot_fullscrape.c | 4 ++-- ot_fullscrape.h | 4 ++-- ot_mutex.c | 6 +++--- ot_stats.c | 6 +++--- ot_udp.c | 2 +- trackerlogic.c | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ot_accesslist.c b/ot_accesslist.c index 253fe95..f1bb885 100644 --- a/ot_accesslist.c +++ b/ot_accesslist.c @@ -342,7 +342,7 @@ static void *accesslist_deleter_worker(void *args) { #endif static pthread_t thread_id; -void accesslist_init() { +void accesslist_init(void) { pthread_mutex_init(&g_accesslist_mutex, NULL); pthread_create(&thread_id, NULL, accesslist_worker, NULL); #ifdef WANT_DYNAMIC_ACCESSLIST @@ -444,7 +444,7 @@ void loglist_add_network(const ot_net *net) { pthread_mutex_unlock(&g_lognets_list_mutex); } -void loglist_reset() { +void loglist_reset(void) { pthread_mutex_lock(&g_lognets_list_mutex); free(g_lognets_list.data); g_lognets_list.data = 0; diff --git a/ot_accesslist.h b/ot_accesslist.h index 0a7488e..d05e1f7 100644 --- a/ot_accesslist.h +++ b/ot_accesslist.h @@ -72,7 +72,7 @@ struct ot_log { extern ot_log *g_logchain_first, *g_logchain_last; void loglist_add_network(const ot_net *net); -void loglist_reset(); +void loglist_reset(void); int loglist_check_address(const ot_ip6 address); #endif diff --git a/ot_fullscrape.c b/ot_fullscrape.c index 7a8cca6..b800431 100644 --- a/ot_fullscrape.c +++ b/ot_fullscrape.c @@ -88,11 +88,11 @@ static void *fullscrape_worker(void *args) { } static pthread_t thread_id; -void fullscrape_init( ) { +void fullscrape_init(void) { pthread_create( &thread_id, NULL, fullscrape_worker, NULL ); } -void fullscrape_deinit( ) { +void fullscrape_deinit(void) { pthread_cancel( thread_id ); } diff --git a/ot_fullscrape.h b/ot_fullscrape.h index bbb2a3f..843e039 100644 --- a/ot_fullscrape.h +++ b/ot_fullscrape.h @@ -10,8 +10,8 @@ #include "ot_mutex.h" -void fullscrape_init(); -void fullscrape_deinit(); +void fullscrape_init(void); +void fullscrape_deinit(void); void fullscrape_deliver(int64 sock, ot_tasktype tasktype); #else diff --git a/ot_mutex.c b/ot_mutex.c index a1dba1f..be3ddf9 100644 --- a/ot_mutex.c +++ b/ot_mutex.c @@ -48,7 +48,7 @@ void mutex_bucket_unlock_by_hash(ot_hash const hash, int delta_torrentcount) { mutex_bucket_unlock(uint32_read_big((char *)hash) >> OT_BUCKET_COUNT_SHIFT, delta_torrentcount); } -size_t mutex_get_torrent_count() { return g_torrent_count; } +size_t mutex_get_torrent_count(void) { return g_torrent_count; } /* TaskQueue Magic */ @@ -253,7 +253,7 @@ int64 mutex_workqueue_popresult(size_t *iovec_entries, struct iovec **iovec, int return sock; } -void mutex_init() { +void mutex_init(void) { size_t i; pthread_mutex_init(&tasklist_mutex, NULL); pthread_cond_init(&tasklist_being_filled, NULL); @@ -262,7 +262,7 @@ void mutex_init() { byte_zero(all_torrents, sizeof(all_torrents)); } -void mutex_deinit() { +void mutex_deinit(void) { size_t i; for (i = 0; i < OT_BUCKET_COUNT; ++i) pthread_mutex_destroy(bucket_mutex + i); diff --git a/ot_stats.c b/ot_stats.c index a9e745c..58ac4b8 100644 --- a/ot_stats.c +++ b/ot_stats.c @@ -741,7 +741,7 @@ void stats_issue_event(ot_status_event event, PROTO_FLAG proto, uintptr_t event_ } } -void stats_cleanup() { +void stats_cleanup(void) { #ifdef WANT_SPOT_WOODPECKER pthread_mutex_lock(&g_woodpeckers_mutex); stats_shift_down_network_count(&stats_woodpeckers_tree, 0, 1); @@ -768,11 +768,11 @@ static void *stats_worker(void *args) { void stats_deliver(int64 sock, int tasktype) { mutex_workqueue_pushtask(sock, tasktype); } static pthread_t thread_id; -void stats_init() { +void stats_init(void) { ot_start_time = g_now_seconds; pthread_create(&thread_id, NULL, stats_worker, NULL); } -void stats_deinit() { +void stats_deinit(void) { pthread_cancel(thread_id); } diff --git a/ot_udp.c b/ot_udp.c index 97ccd38..990868c 100644 --- a/ot_udp.c +++ b/ot_udp.c @@ -28,7 +28,7 @@ static uint32_t g_rijndael_round_key[44] = {0}; static uint32_t g_key_of_the_hour[2] = {0}; static ot_time g_hour_of_the_key; -static void udp_generate_rijndael_round_key() { +static void udp_generate_rijndael_round_key(void) { uint32_t key[16]; #ifdef WANT_ARC4RANDOM arc4random_buf(&key[0], sizeof(key)); diff --git a/trackerlogic.c b/trackerlogic.c index 1e25ec8..7f9c893 100644 --- a/trackerlogic.c +++ b/trackerlogic.c @@ -552,7 +552,7 @@ void exerr(char *message) { exit(111); } -void trackerlogic_init() { +void trackerlogic_init(void) { g_tracker_id = random(); if (!g_stats_path) -- cgit v1.2.3