From b76e26dc84c643e4e72788342e83c4b6379335e1 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 19 Oct 2025 17:46:26 +0200 Subject: [BOX32] Fixed some old issue with hash useage --- src/box32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/box32.c b/src/box32.c index 1bac0faa..f3204b05 100644 --- a/src/box32.c +++ b/src/box32.c @@ -18,7 +18,7 @@ KHASH_MAP_INIT_STR(strings, ptr_t); static kh_from_t* hash_from = NULL; static kh_to_t* hash_to = NULL; #define HASH_MSK 0xf000000f -#define HASH_VAL 0x00ffffff +#define HASH_VAL 0x007fffff #define HASH_SHIFT 4 static uint32_t hash_cnt = 1; static pthread_rwlock_t hash_lock = {0}; @@ -88,7 +88,7 @@ uintptr_t from_hash_d(ulong_t l) { // Convert from 64bits to hash key, creating it if needed ulong_t to_hash(uintptr_t p) { - if((p<0x100000000LL) && ((p&HASH_MSK)!=HASH_MSK)) + if((p>0x100000000LL) && ((p&HASH_MSK)!=HASH_MSK)) return (ulong_t)p; if(p==0xffffffffffffffffll) { return 0xffffffff; @@ -120,7 +120,7 @@ ulong_t to_hash(uintptr_t p) { // Convert from 64bits to hash key and delete the entry from both hash table ulong_t to_hash_d(uintptr_t p) { - if((p<0x100000000LL) && ((p&HASH_MSK)!=HASH_MSK)) + if((p>0x100000000LL) && ((p&HASH_MSK)!=HASH_MSK)) return (ulong_t)p; if(p==0xffffffffffffffffll) return 0xffffffff; -- cgit 1.4.1