diff options
-rw-r--r-- | src/keeper.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/keeper.c b/src/keeper.c index 72ccedb..8686bc8 100644 --- a/src/keeper.c +++ b/src/keeper.c | |||
@@ -624,9 +624,10 @@ struct s_Keeper* keeper_acquire( void const* ptr) | |||
624 | * consistently. | 624 | * consistently. |
625 | * | 625 | * |
626 | * Pointers are often aligned by 8 or so - ignore the low order bits | 626 | * Pointers are often aligned by 8 or so - ignore the low order bits |
627 | * have to cast to unsigned long to avoid compilation warnings about loss of data when converting pointer-to-integer | ||
627 | */ | 628 | */ |
628 | unsigned int i = ((unsigned int)(ptr) >> 3) % GNbKeepers; | 629 | unsigned int i = (unsigned int)(((unsigned long)(ptr) >> 3) % GNbKeepers); |
629 | struct s_Keeper *K= &GKeepers[i]; | 630 | struct s_Keeper* K = &GKeepers[i]; |
630 | 631 | ||
631 | MUTEX_LOCK( &K->lock_); | 632 | MUTEX_LOCK( &K->lock_); |
632 | //++ K->count; | 633 | //++ K->count; |