]> arthur.barton.de Git - bup.git/commit
_hashsplit.c: right shifting 32 bits doesn't work. bup-0.10
authorAvery Pennarun <apenwarr@gmail.com>
Fri, 12 Feb 2010 19:53:19 +0000 (14:53 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Fri, 12 Feb 2010 19:53:19 +0000 (14:53 -0500)
commit666c08a8d1e99cd319b559e0c0f8c9804c01ced0
tree0edfcd4461707e42c23d77e2bf518810605c0d8c
parenta3ab444dfab24403d0a8a201730359c60ffe63f8
_hashsplit.c: right shifting 32 bits doesn't work.

in C, if you do
uint32_t i = 0xffffffff;
i >>= 32;

then the answer is 0xffffffff, not 0 as you might expect.  Let's shift it by
less than 32 at a time, which will give the right results.  This fixes a
rare infinite loop when counting the bits in the hashsplit.
_hashsplit.c