nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 9d33ba1104b390256f72f8203212720b95447b38
parent 94bac4ef986aed99cfc88963d6a429dce2c89058
Author: NRK <nrk@disroot.org>
Date:   Sun,  5 Jan 2025 21:55:06 +0000

icons-hash: table needs to be strictly bigger than icons

Diffstat:
Msrc/icons-hash.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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 */