Changeset 1976 for trunk/lib


Ignore:
Timestamp:
Mar 27, 2012, 11:56:06 AM (7 years ago)
Author:
cameron
Message:

Fix for reverse scan on 64-bit

File:
1 edited

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                        }
Note: See TracChangeset for help on using the changeset viewer.