summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-01-12 16:37:43 +0100
committerChristian Göttsche <cgzones@googlemail.com>2021-01-12 16:37:43 +0100
commit66dd77aa6bdeb17b04a5a30896f929242e99d63a (patch)
tree489fa8694147da7e3d3f8a44229d37e679797d40
parent2b62126aea6770ac7986a1b5d417379ad316ace6 (diff)
Hashtable: use appropriate return type for nextPrime
The return value is guaranteed to be smaller than SIZE_MAX, so return size_t (matters on 32 bit architectures).
-rw-r--r--Hashtable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Hashtable.c b/Hashtable.c
index 9b0882a4..fdc87bec 100644
--- a/Hashtable.c
+++ b/Hashtable.c
@@ -95,7 +95,7 @@ static const uint64_t OEISprimes[] = {
34359738337, 68719476731, 137438953447
};
-static uint64_t nextPrime(size_t n) {
+static size_t nextPrime(size_t n) {
/* on 32-bit make sure we do not return primes not fitting in size_t */
for (size_t i = 0; i < ARRAYSIZE(OEISprimes) && OEISprimes[i] < SIZE_MAX; i++) {
if (n <= OEISprimes[i])