bitvect: fix some issues observed on 32bit architectures.

* src/misc/bitvect.cc, src/misc/bitvect.hh: Do
not assume the two bitvect with the same size have
the same number of allocated blocks.  Fix an
assertion in extra_range().
This commit is contained in:
Alexandre Duret-Lutz 2014-01-15 15:52:11 +01:00
parent 534edd4d1c
commit 522373984c
2 changed files with 35 additions and 14 deletions

View file

@ -120,7 +120,10 @@ namespace spot
block_t res = fnv<sizeof(block_t)>::init();
size_t i;
for (i = 0; i < block_count_ - 1; ++i)
size_t m = used_blocks();
if (m == 0)
return res;
for (i = 0; i < m - 1; ++i)
{
res ^= storage_[i];
res *= fnv<sizeof(block_t)>::prime();