From: Victor Grishchenko Date: Fri, 21 May 2010 12:34:32 +0000 (+0200) Subject: more tests to coarse_bitmap X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=4f64759338a90fc78eac3548ab84c8a7c3e3d4ac;p=swift-upb.git more tests to coarse_bitmap --- diff --git a/bins.cpp b/bins.cpp index aa81a70..5f41017 100644 --- a/bins.cpp +++ b/bins.cpp @@ -492,13 +492,13 @@ void binmap_t::map16 (uint16_t* target, bin64_t range) { } -void binmap_t::to_coarse_bitmap (void* bits, bin64_t range, uint8_t height) { - uint16_t* bits16 = (uint16_t*) bits; +void binmap_t::to_coarse_bitmap (uint16_t* bits, bin64_t range, uint8_t height) { + assert(range.layer()-height>=4); int height16 = range.layer()-height-4; - int wordwidth = 1 << height16; + int wordwidth = height16 > 0 ? (1 << height16) : 1; int offset = range.offset() << height16; for(int i=0; i