summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2021-10-07 17:34:45 -0400
committerAndrew Cady <d@cryptonomic.net>2021-10-07 17:34:45 -0400
commit38987813e2e4a8a1c05e418cc44cacb439ce0354 (patch)
tree162f6b92a6871af348ca6f723c38e4a6eb13c48c
parent0108aeec741a8f7cc86dd42955eacdf5312c63ef (diff)
silence unused variable warnings
-rw-r--r--log.c1
-rw-r--r--main.c9
2 files changed, 10 insertions, 0 deletions
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)
151void on_tox_log(Tox *tox, TOX_LOG_LEVEL level, const char *path, uint32_t line, const char *func, 151void on_tox_log(Tox *tox, TOX_LOG_LEVEL level, const char *path, uint32_t line, const char *func,
152 const char *message, void *user_data) 152 const char *message, void *user_data)
153{ 153{
154 tox = tox;
154 uint32_t index = user_data ? *(uint32_t *)user_data : 0; 155 uint32_t index = user_data ? *(uint32_t *)user_data : 0;
155 const char *file = strrchr(path, '/'); 156 const char *file = strrchr(path, '/');
156 157
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)
616 */ 616 */
617void parse_lossless_packet(Tox *tox, uint32_t friendnumber, const uint8_t *data, size_t len, void *tmp) 617void parse_lossless_packet(Tox *tox, uint32_t friendnumber, const uint8_t *data, size_t len, void *tmp)
618{ 618{
619 tox = tox;
620 tmp = tmp;
619 protocol_frame *frame = NULL; 621 protocol_frame *frame = NULL;
620 622
621 if(len < PROTOCOL_BUFFER_OFFSET) 623 if(len < PROTOCOL_BUFFER_OFFSET)
@@ -865,6 +867,7 @@ void tunnel_target_whitelist_clear()
865 867
866void accept_friend_request(Tox *tox, const uint8_t *public_key, const uint8_t *message, size_t length, void *userdata) 868void accept_friend_request(Tox *tox, const uint8_t *public_key, const uint8_t *message, size_t length, void *userdata)
867{ 869{
870 userdata = userdata;
868 unsigned char tox_printable_id[TOX_ADDRESS_SIZE * 2 + 1]; 871 unsigned char tox_printable_id[TOX_ADDRESS_SIZE * 2 + 1];
869 uint32_t friendnumber; 872 uint32_t friendnumber;
870 TOX_ERR_FRIEND_ADD friend_add_error; 873 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
921/* Callback for tox_callback_self_connection_status() */ 924/* Callback for tox_callback_self_connection_status() */
922void handle_connection_status_change(Tox *tox, TOX_CONNECTION new_connection_status, void *user_data) 925void handle_connection_status_change(Tox *tox, TOX_CONNECTION new_connection_status, void *user_data)
923{ 926{
927 tox = tox;
928 user_data = user_data;
929
924 connection_status = new_connection_status; 930 connection_status = new_connection_status;
925 if (connection_status) 931 if (connection_status)
926 { 932 {
@@ -947,6 +953,8 @@ void log_friend_ip_address(Tox *tox, uint32_t friendnumber)
947 953
948void handle_friend_connection_status(Tox *tox, uint32_t friend_number, TOX_CONNECTION connection_status, void *user_data) 954void handle_friend_connection_status(Tox *tox, uint32_t friend_number, TOX_CONNECTION connection_status, void *user_data)
949{ 955{
956 tox = tox;
957 user_data = user_data;
950 const char *status = NULL; 958 const char *status = NULL;
951 status = readable_connection_status(connection_status); 959 status = readable_connection_status(connection_status);
952 log_printf(L_INFO, "Friend #%d connection status changed: %s", friend_number, status); 960 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)
987 995
988void run_tox_timer(Tox *tox, struct tox_timer t) 996void run_tox_timer(Tox *tox, struct tox_timer t)
989{ 997{
998 tox = tox;
990 struct timeval tv_end; 999 struct timeval tv_end;
991 gettimeofday(&tv_end, NULL); 1000 gettimeofday(&tv_end, NULL);
992 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; 1001 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;