Changeset 2015 for trunk


Ignore:
Timestamp:
Apr 10, 2012, 2:18:04 AM (7 years ago)
Author:
ksherdy
Message:

Fixed reverse scanner logic impose strict inequality test on blk count.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/bitblock_scan.hpp

    r2011 r2015  
    2929        const bitblock_t * strm;
    3030        int32_t pos;
    31         uint32_t blk;
     31        int32_t blk;
    3232        scanblock_t scan_blk;
    3333        /* The test here needs to be != 0, not > 0, in case scanblock_t is signed.*/
     
    7171
    7272        /* Set or reset the iterator to position new_pos. */
    73         IDISA_ALWAYS_INLINE void move_to(uint32_t new_pos) {
     73        IDISA_ALWAYS_INLINE void move_to(uint32_t new_pos) {           
    7474                const scanblock_t one_bit = 1;
    7575                this->blk = new_pos / (sizeof(scanblock_t)*8);
     
    108108        IDISA_ALWAYS_INLINE int32_t scan_to_next() {
    109109                const scanblock_t one_bit = 1;  /* ensure enough bits for shift: one_bit << this->pos */
    110                 while (this->blk >= 0){
     110                while (this->blk > -1){
    111111                        if(has_bit(this->scan_blk)){
    112112                                this->pos = (sizeof(scanblock_t)*8 - scan_backward_zeroes(this->scan_blk) -1) + ( (this->blk) * sizeof(scanblock_t)*8 );
Note: See TracChangeset for help on using the changeset viewer.