summaryrefslogtreecommitdiffstats
path: root/test/tree_bench.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-13 17:25:46 +0200
committerDavid Robillard <d@drobilla.net>2020-08-13 17:25:46 +0200
commit15efd87598d434d8ee7dc45af3da70ba5ad6c312 (patch)
treeef99fc34534e4ccdac23a41c7bf55df46945f676 /test/tree_bench.c
parent84addbedee65322625a101f1cf5a97860a26b1ef (diff)
downloadzix-15efd87598d434d8ee7dc45af3da70ba5ad6c312.tar.gz
zix-15efd87598d434d8ee7dc45af3da70ba5ad6c312.tar.bz2
zix-15efd87598d434d8ee7dc45af3da70ba5ad6c312.zip
Fix Wno-shorten-64-to-32 warnings
Diffstat (limited to 'test/tree_bench.c')
-rw-r--r--test/tree_bench.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/tree_bench.c b/test/tree_bench.c
index 3a7e601..9e58c8d 100644
--- a/test/tree_bench.c
+++ b/test/tree_bench.c
@@ -30,17 +30,17 @@
// #define BENCH_SORTED_ARRAY 1
// Return a pseudo-pseudo-pseudo-random-ish integer with no duplicates
-static uint32_t
-unique_rand(uint32_t i)
+static size_t
+unique_rand(size_t i)
{
i ^= 0x5CA1AB1E; // Juggle bits to avoid linear clumps
// Largest prime < 2^32 which satisfies (2^32 = 3 mod 4)
- static const uint32_t prime = 4294967291;
+ static const size_t prime = 4294967291;
if (i >= prime) {
return i; // Values >= prime are mapped to themselves
} else {
- const uint32_t residue = ((uint64_t)i * i) % prime;
+ const size_t residue = ((uint64_t)i * i) % prime;
return (i <= prime / 2) ? residue : prime - residue;
}
}