From 15efd87598d434d8ee7dc45af3da70ba5ad6c312 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 13 Aug 2020 17:25:46 +0200 Subject: Fix Wno-shorten-64-to-32 warnings --- test/sorted_array_test.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/sorted_array_test.c') diff --git a/test/sorted_array_test.c b/test/sorted_array_test.c index ca4eac7..30ff139 100644 --- a/test/sorted_array_test.c +++ b/test/sorted_array_test.c @@ -36,7 +36,8 @@ int_cmp(const void* a, const void* b, const void* ZIX_UNUSED(user_data)) { const intptr_t ia = *(const intptr_t*)a; const intptr_t ib = *(const intptr_t*)b; - return ia - ib; + + return ia < ib ? -1 : ia > ib ? 1 : 0; } static intptr_t @@ -152,11 +153,11 @@ main(int argc, char** argv) if (argc == 1) { n_elems = 4096; } else { - n_elems = atol(argv[1]); + n_elems = (unsigned)atol(argv[1]); if (argc > 2) { - seed = atol(argv[2]); + seed = (unsigned)atol(argv[2]); } else { - seed = time(NULL); + seed = (unsigned)time(NULL); } } -- cgit v1.2.1