Changeset 1976

Show
Ignore:
Timestamp:
03/27/12 11:56:06 (15 months ago)
Author:
cameron
Message:

Fix for reverse scan on 64-bit

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/bitblock_scan.hpp

    r1950 r1976  
    9191 
    9292        IDISA_ALWAYS_INLINE int32_t scan_to_next() { 
     93                const scanblock_t one_bit = 1;  /* ensure enough bits for shift: one_bit << this->pos */ 
    9394                while (this->blk > 0){ 
    9495                        if(has_bit(this->scan_blk)){ 
    9596                                this->pos = (sizeof(scanblock_t)*8 - scan_backward_zeroes(this->scan_blk) -1) + ( (this->blk-1) * sizeof(scanblock_t)*8 ); 
    96                                 this->scan_blk = this->scan_blk ^ (1 << this->pos); // clear leftmost bit 
     97                                this->scan_blk = this->scan_blk ^ (one_bit << this->pos); // clear leftmost bit 
    9798                                return (this->pos); 
    9899                        }