From 9d33ba1104b390256f72f8203212720b95447b38 Mon Sep 17 00:00:00 2001 From: NRK Date: Sun, 5 Jan 2025 21:55:06 +0000 Subject: [PATCH] icons-hash: table needs to be strictly bigger than icons --- src/icons-hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/icons-hash.c b/src/icons-hash.c index 699af33b..5ad4a0f4 100644 --- a/src/icons-hash.c +++ b/src/icons-hash.c @@ -10,7 +10,7 @@ #define GOLDEN_RATIO_32 UINT32_C(2654442313) /* golden ratio for 32bits: (2^32) / 1.61803 */ #define GOLDEN_RATIO_64 UINT64_C(0x9E3793492EEDC3F7) -#define ICONS_TABLE_SIZE 8 /* size in bits. 8 = 256 */ +#define ICONS_TABLE_SIZE 8 /* size in bits. 8 = 2^8 = 256 */ #ifndef TOUPPER #define TOUPPER(ch) (((ch) >= 'a' && (ch) <= 'z') ? ((ch) - 'a' + 'A') : (ch)) @@ -118,7 +118,7 @@ pcg(uint64_t *state) int main(void) { - ENSURE(ARRLEN(icons_ext) <= ARRLEN(table)); + ENSURE(ARRLEN(icons_ext) < ARRLEN(table)); ENSURE(ICONS_TABLE_SIZE < 16); ENSURE(1u << ICONS_TABLE_SIZE == ARRLEN(table)); ENSURE((GOLDEN_RATIO_32 & 1) == 1); /* must be odd */