summaryrefslogtreecommitdiff
path: root/auto_tests/dht_test.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-08-26 20:34:26 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-09-03 20:03:47 +0000
commit6872c14e1a02445d945623ee6e85230c5d7ecbce (patch)
tree30d90b93445976e56b96946b6e87b764eddd48a8 /auto_tests/dht_test.c
parentd296490a742b226fc17a71cf96ab73fc16719b20 (diff)
Avoid use of global mutable state in mono_time on win32.
This uses a trick to get read-write access to `this` from a `const` member function, similar to C++ `mutable`, but uglier.
Diffstat (limited to 'auto_tests/dht_test.c')
-rw-r--r--auto_tests/dht_test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/auto_tests/dht_test.c b/auto_tests/dht_test.c
index 232b7d95..f9c09dd5 100644
--- a/auto_tests/dht_test.c
+++ b/auto_tests/dht_test.c
@@ -600,9 +600,10 @@ static void ip_callback(void *data, int32_t number, IP_Port ip_port)
600 600
601#define NUM_DHT_FRIENDS 20 601#define NUM_DHT_FRIENDS 20
602 602
603static uint64_t get_clock_callback(void *user_data) 603static uint64_t get_clock_callback(Mono_Time *mono_time, void *user_data)
604{ 604{
605 return *(uint64_t *)user_data; 605 const uint64_t *clock = (const uint64_t *)user_data;
606 return *clock;
606} 607}
607 608
608static void test_DHT_test(void) 609static void test_DHT_test(void)