From bc2320a30965b2877b1e47790f0b432955d211f9 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Mon, 18 Nov 2013 11:31:02 +0100 Subject: Fix compilation warning introduced by aef73939a513e67989a9ad2256f14754ebdaa28e. --- src/keeper.c | 5 +++-- 1 file 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) * consistently. * * Pointers are often aligned by 8 or so - ignore the low order bits + * have to cast to unsigned long to avoid compilation warnings about loss of data when converting pointer-to-integer */ - unsigned int i = ((unsigned int)(ptr) >> 3) % GNbKeepers; - struct s_Keeper *K= &GKeepers[i]; + unsigned int i = (unsigned int)(((unsigned long)(ptr) >> 3) % GNbKeepers); + struct s_Keeper* K = &GKeepers[i]; MUTEX_LOCK( &K->lock_); //++ K->count; -- cgit v1.2.3-55-g6feb