From 38987813e2e4a8a1c05e418cc44cacb439ce0354 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Thu, 7 Oct 2021 17:34:45 -0400 Subject: silence unused variable warnings --- log.c | 1 + main.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/log.c b/log.c index 36472db..cc7f9a4 100644 --- a/log.c +++ b/log.c @@ -151,6 +151,7 @@ static const char *tox_log_level_name(TOX_LOG_LEVEL level) void on_tox_log(Tox *tox, TOX_LOG_LEVEL level, const char *path, uint32_t line, const char *func, const char *message, void *user_data) { + tox = tox; uint32_t index = user_data ? *(uint32_t *)user_data : 0; const char *file = strrchr(path, '/'); diff --git a/main.c b/main.c index 3d11f8c..feee4a1 100644 --- a/main.c +++ b/main.c @@ -616,6 +616,8 @@ int handle_frame(protocol_frame *frame) */ void parse_lossless_packet(Tox *tox, uint32_t friendnumber, const uint8_t *data, size_t len, void *tmp) { + tox = tox; + tmp = tmp; protocol_frame *frame = NULL; if(len < PROTOCOL_BUFFER_OFFSET) @@ -865,6 +867,7 @@ void tunnel_target_whitelist_clear() void accept_friend_request(Tox *tox, const uint8_t *public_key, const uint8_t *message, size_t length, void *userdata) { + userdata = userdata; unsigned char tox_printable_id[TOX_ADDRESS_SIZE * 2 + 1]; uint32_t friendnumber; TOX_ERR_FRIEND_ADD friend_add_error; @@ -921,6 +924,9 @@ void accept_friend_request(Tox *tox, const uint8_t *public_key, const uint8_t *m /* Callback for tox_callback_self_connection_status() */ void handle_connection_status_change(Tox *tox, TOX_CONNECTION new_connection_status, void *user_data) { + tox = tox; + user_data = user_data; + connection_status = new_connection_status; if (connection_status) { @@ -947,6 +953,8 @@ void log_friend_ip_address(Tox *tox, uint32_t friendnumber) void handle_friend_connection_status(Tox *tox, uint32_t friend_number, TOX_CONNECTION connection_status, void *user_data) { + tox = tox; + user_data = user_data; const char *status = NULL; status = readable_connection_status(connection_status); log_printf(L_INFO, "Friend #%d connection status changed: %s", friend_number, status); @@ -987,6 +995,7 @@ struct tox_timer init_tox_timer(Tox *tox) void run_tox_timer(Tox *tox, struct tox_timer t) { + tox = tox; struct timeval tv_end; gettimeofday(&tv_end, NULL); unsigned long long ms_elapsed = tv_end.tv_sec + tv_end.tv_usec/1000 - t.tv_start.tv_sec - t.tv_start.tv_usec/1000; -- cgit v1.2.3