diff options
author | David Robillard <d@drobilla.net> | 2020-08-13 17:25:46 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-13 17:25:46 +0200 |
commit | 15efd87598d434d8ee7dc45af3da70ba5ad6c312 (patch) | |
tree | ef99fc34534e4ccdac23a41c7bf55df46945f676 /test/sorted_array_test.c | |
parent | 84addbedee65322625a101f1cf5a97860a26b1ef (diff) | |
download | zix-15efd87598d434d8ee7dc45af3da70ba5ad6c312.tar.gz zix-15efd87598d434d8ee7dc45af3da70ba5ad6c312.tar.bz2 zix-15efd87598d434d8ee7dc45af3da70ba5ad6c312.zip |
Fix Wno-shorten-64-to-32 warnings
Diffstat (limited to 'test/sorted_array_test.c')
-rw-r--r-- | test/sorted_array_test.c | 9 |
1 files changed, 5 insertions, 4 deletions
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); } } |