From 7e4048242e8fde3232f4e19c16b5080c5e0fe7d1 Mon Sep 17 00:00:00 2001 From: Victor Grishchenko Date: Fri, 21 May 2010 14:44:37 +0200 Subject: [PATCH] any ranges OK --- bins.cpp | 5 +++-- bins.h | 2 +- tests/binstest2.cpp | 8 ++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bins.cpp b/bins.cpp index 5f41017..6376bad 100644 --- a/bins.cpp +++ b/bins.cpp @@ -493,10 +493,11 @@ void binmap_t::map16 (uint16_t* target, bin64_t range) { void binmap_t::to_coarse_bitmap (uint16_t* bits, bin64_t range, uint8_t height) { - assert(range.layer()-height>=4); + //assert(range.layer()-height>=4); int height16 = range.layer()-height-4; int wordwidth = height16 > 0 ? (1 << height16) : 1; - int offset = range.offset() << height16; + int offset = height16 > 0 ? (range.offset() << height16) : + (range.offset() >> -height16); for(int i=0; i