From 66dd77aa6bdeb17b04a5a30896f929242e99d63a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 12 Jan 2021 16:37:43 +0100 Subject: 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). --- Hashtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]) -- cgit v1.2.3