From aaf392b6c89ac900226f1090f3ed4605202e6046 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 26 Jul 2019 00:28:09 +0300 Subject: [PATCH] Eliminate 'conversion from int to void*' MS VC warning in cordtest (x64) * cord/tests/cordtest.c (test_fn, test_basics): Cast 13 to void* thru GC_word type. --- cord/tests/cordtest.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cord/tests/cordtest.c b/cord/tests/cordtest.c index 399141e..a41600c 100644 --- a/cord/tests/cordtest.c +++ b/cord/tests/cordtest.c @@ -40,7 +40,8 @@ int count; int test_fn(char c, void * client_data) { - if (client_data != (void *)13) ABORT("bad client data"); + if (client_data != (void *)(GC_word)13) + ABORT("bad client data"); if (count < 64*1024+1) { if ((count & 1) == 0) { if (c != 'b') ABORT("bad char"); @@ -81,7 +82,8 @@ void test_basics(void) if (CORD_len(x) != 128*1024+1) ABORT("bad length"); count = 0; - if (CORD_iter5(x, 64*1024-1, test_fn, CORD_NO_FN, (void *)13) == 0) { + if (CORD_iter5(x, 64*1024-1, test_fn, CORD_NO_FN, + (void *)(GC_word)13) == 0) { ABORT("CORD_iter5 failed"); } if (count != 64*1024 + 2) ABORT("CORD_iter5 failed"); @@ -89,7 +91,7 @@ void test_basics(void) count = 0; CORD_set_pos(p, x, 64*1024-1); while(CORD_pos_valid(p)) { - (void) test_fn(CORD_pos_fetch(p), (void *)13); + (void)test_fn(CORD_pos_fetch(p), (void *)(GC_word)13); CORD_next(p); } if (count != 64*1024 + 2) ABORT("Position based iteration failed"); @@ -113,7 +115,8 @@ void test_basics(void) if (CORD_len(x) != 128*1024+1) ABORT("bad length"); count = 0; - if (CORD_iter5(x, 64*1024-1, test_fn, CORD_NO_FN, (void *)13) == 0) { + if (CORD_iter5(x, 64*1024-1, test_fn, CORD_NO_FN, + (void *)(GC_word)13) == 0) { ABORT("CORD_iter5 failed"); } if (count != 64*1024 + 2) ABORT("CORD_iter5 failed"); -- 2.7.4