diff options
Diffstat (limited to 'tests/unit/unit1309.c')
-rw-r--r-- | tests/unit/unit1309.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/unit/unit1309.c b/tests/unit/unit1309.c index c53cbcbce..9a07c9332 100644 --- a/tests/unit/unit1309.c +++ b/tests/unit/unit1309.c @@ -22,6 +22,7 @@ #include "curlcheck.h" #include "splay.h" +#include "warnless.h" static CURLcode unit_setup(void) @@ -86,7 +87,8 @@ UNITTEST_START key.tv_usec = (541*i)%1023; payload = (size_t) key.tv_usec; - nodes[i].payload = (void *)payload; /* for simplicity */ + /* for simplicity */ + nodes[i].payload = CURLX_INTEGER_TO_POINTER_CAST(payload); root = Curl_splayinsert(key, root, &nodes[i]); } @@ -98,7 +100,7 @@ UNITTEST_START printf("Tree look:\n"); splayprint(root, 0, 1); printf("remove pointer %d, payload %ld\n", rem, - (long)(nodes[rem].payload)); + CURLX_POINTER_TO_INTEGER_CAST(nodes[rem].payload)); rc = Curl_splayremovebyaddr(root, &nodes[rem], &root); if(rc) { /* failed! */ @@ -119,7 +121,8 @@ UNITTEST_START /* add some nodes with the same key */ for(j = 0; j <= i % 3; j++) { size_t payload = key.tv_usec*10 + j; - nodes[i * 3 + j].payload = (void *)payload; /* for simplicity */ + /* for simplicity */ + nodes[i * 3 + j].payload = CURLX_INTEGER_TO_POINTER_CAST(payload); root = Curl_splayinsert(key, root, &nodes[i * 3 + j]); } } @@ -130,8 +133,9 @@ UNITTEST_START tv_now.tv_usec = i; root = Curl_splaygetbest(tv_now, root, &removed); while(removed != NULL) { - printf("removed payload %ld[%ld]\n", (long)(removed->payload) / 10, - (long)(removed->payload) % 10); + printf("removed payload %ld[%ld]\n", + CURLX_POINTER_TO_INTEGER_CAST(removed->payload) / 10, + CURLX_POINTER_TO_INTEGER_CAST(removed->payload) % 10); root = Curl_splaygetbest(tv_now, root, &removed); } } |