diff --git a/btypes.h b/btypes.h index 4846434..564b6b1 100644 --- a/btypes.h +++ b/btypes.h @@ -8,7 +8,7 @@ #define OFF_LEN_MASK 0xc000000000000000 #define LS_SIZE 0x100000000000000 #define OFF_SIZE 8 -#define CACHE_WRAPER_BIT 0x8000000000000000 +#define CACHE_WRAPPER_BIT 0x8000000000000000 typedef uint64_t TIndexOffU; typedef int64_t TIndexOff; @@ -18,7 +18,7 @@ typedef int64_t TIndexOff; #define OFF_LEN_MASK 0xc0000000 #define LS_SIZE 0x10000000 #define OFF_SIZE 4 -#define CACHE_WRAPER_BIT 0x80000000 +#define CACHE_WRAPPER_BIT 0x80000000 typedef uint32_t TIndexOffU; typedef int TIndexOff; diff --git a/ebwt_search_backtrack.h b/ebwt_search_backtrack.h index 4445f07..32e323e 100644 --- a/ebwt_search_backtrack.h +++ b/ebwt_search_backtrack.h @@ -1783,7 +1783,7 @@ class GreedyDFSRangeSource { char _trimc; uint32_t _seed; #ifndef NDEBUG - std::set allTops_; + std::set allTops_; #endif }; @@ -2340,7 +2340,7 @@ class EbwtRangeSource : public RangeSource { curRange_.ebwt = ebwt_; this->foundRange = true; #ifndef NDEBUG - int64_t top2 = (int64_t)br->top_; + TIndexOff top2 = (TIndexOff)br->top_; top2++; // ensure it's not 0 if(ebwt_->fw()) top2 = -top2; assert(allTops_.find(top2) == allTops_.end()); @@ -2627,7 +2627,7 @@ class EbwtRangeSource : public RangeSource { // Object encapsulating metrics AlignerMetrics* metrics_; #ifndef NDEBUG - std::set allTops_; + std::set allTops_; #endif }; @@ -3058,7 +3058,7 @@ class EbwtSeededRangeSourceDriver : public RangeSourceDriver { // top offset assert_gt(range().bot, range().top); assert(range().ebwt != NULL); - TIndexOffU top = (TIndexOffU)range().top; + TIndexOff top = (TIndexOff)range().top; top++; // ensure it's not 0 if(!range().ebwt->fw()) top = -top; assert(allTops_.find(top) == allTops_.end()); diff --git a/range_cache.h b/range_cache.h index cc7ceac..33e9e4c 100644 --- a/range_cache.h +++ b/range_cache.h @@ -63,7 +63,7 @@ class RangeCacheMemPool { TIndexOffU alloc(TIndexOffU numElts) { assert_gt(numElts, 0); assert_leq(occ_, lim_); - if(occ_ + numElts > lim_ || numElts >= CACHE_WRAPER_BIT) { + if(occ_ + numElts > lim_ || numElts >= CACHE_WRAPPER_BIT) { return RANGE_CACHE_BAD_ALLOC; } assert_gt(lim_, 0); @@ -96,7 +96,7 @@ class RangeCacheMemPool { assert_lt(off, lim_); assert(allocs_.find(off) != allocs_.end()); TIndexOffU *ret = buf_ + off; - assert_neq(CACHE_WRAPER_BIT, ret[0]); + assert_neq(CACHE_WRAPPER_BIT, ret[0]); assert_neq(OFF_MASK, ret[0]); return ret; } @@ -153,12 +153,12 @@ class RangeCacheEntry { top_ = top; ebwt_ = ebwt; TIndexOffU *ents = pool.get(ent); - assert_neq(CACHE_WRAPER_BIT, ents[0]); + assert_neq(CACHE_WRAPPER_BIT, ents[0]); // Is hi bit set? - if((ents[0] & CACHE_WRAPER_BIT) != 0) { + if((ents[0] & CACHE_WRAPPER_BIT) != 0) { // If so, the target is a wrapper and the non-hi bits // contain the # jumps - jumps_ = (ents[0] & ~CACHE_WRAPER_BIT); + jumps_ = (ents[0] & ~CACHE_WRAPPER_BIT); assert_gt(jumps_, 0); assert_leq(jumps_, ebwt_->_eh._len); // Get the target entry @@ -197,7 +197,7 @@ class RangeCacheEntry { jumps_ = jumps; TIndexOffU *ents = pool.get(ent); // Must not be a wrapper - assert_eq(0, ents[0] & CACHE_WRAPER_BIT); + assert_eq(0, ents[0] & CACHE_WRAPPER_BIT); // Get the length from the target entry len_ = ents[0]; assert_gt(len_, 0); @@ -397,8 +397,8 @@ class RangeCache { TIndexOffU jumps = 0; assert_leq(top, ebwt_->_eh._len); TIndexOffU *ents = pool_.get(idx); - if((ents[0] & CACHE_WRAPER_BIT) != 0) { - jumps = ents[0] & ~CACHE_WRAPER_BIT; + if((ents[0] & CACHE_WRAPPER_BIT) != 0) { + jumps = ents[0] & ~CACHE_WRAPPER_BIT; assert_leq(jumps, ebwt_->_eh._len); idx = ents[1]; ents = pool_.get(idx); @@ -453,11 +453,11 @@ class RangeCache { // entry already, so use that TIndexOffU idx = itr->second; TIndexOffU *ents = pool_.get(idx); - if((ents[0] & CACHE_WRAPER_BIT) != 0) { + if((ents[0] & CACHE_WRAPPER_BIT) != 0) { // The cache entry we found was a wrapper; make // a new wrapper that points to that wrapper's // target, with the appropriate number of jumps - jumps += (ents[0] & ~CACHE_WRAPER_BIT); + jumps += (ents[0] & ~CACHE_WRAPPER_BIT); idx = ents[1]; } // Allocate a new wrapper @@ -467,7 +467,7 @@ class RangeCache { // now populate it and install it in map_ TIndexOffU *newent = pool_.get(newentIdx); // get ptr to it assert_eq(0, newent[0]); - newent[0] = CACHE_WRAPER_BIT | jumps; // set jumps + newent[0] = CACHE_WRAPPER_BIT | jumps; // set jumps newent[1] = idx; // set target assert(map_.find(top) == map_.end()); map_[top] = newentIdx; @@ -498,7 +498,7 @@ class RangeCache { assert_eq(0, newent[0]); // Store cache-range length in first word newent[0] = spread; - assert_lt(newent[0], CACHE_WRAPER_BIT); + assert_lt(newent[0], CACHE_WRAPPER_BIT); assert_eq(spread, newent[0]); TIndexOffU entTop = top; TIndexOffU jumps = 0; @@ -519,7 +519,7 @@ class RangeCache { if(wrapentIdx != RANGE_CACHE_BAD_ALLOC) { TIndexOffU *wrapent = pool_.get(wrapentIdx); assert_eq(0, wrapent[0]); - wrapent[0] = CACHE_WRAPER_BIT | jumps; + wrapent[0] = CACHE_WRAPPER_BIT | jumps; wrapent[1] = newentIdx; assert(map_.find(top) == map_.end()); map_[top] = wrapentIdx; diff --git a/range_source.h b/range_source.h index 79702d1..687ed45 100644 --- a/range_source.h +++ b/range_source.h @@ -1729,7 +1729,7 @@ class RangeSourceDriver { // top offset assert_gt(range().bot, range().top); assert(range().ebwt != NULL); - int64_t top = (int64_t)range().top; + TIndexOff top = (TIndexOff)range().top; top++; // ensure it's not 0 if(!range().ebwt->fw()) top = -top; assert(allTops_.find(top) == allTops_.end()); @@ -1787,7 +1787,7 @@ class RangeSourceDriver { protected: #ifndef NDEBUG - std::set allTops_; + std::set allTops_; #endif }; @@ -1910,7 +1910,7 @@ class SingleRangeSourceDriver : public RangeSourceDriver { // top offset assert_gt(range().bot, range().top); assert(range().ebwt != NULL); - int64_t top = (int64_t)range().top; + TIndexOff top = (TIndexOff)range().top; top++; // ensure it's not 0 if(!range().ebwt->fw()) top = -top; assert(allTops_.find(top) == allTops_.end()); @@ -1965,7 +1965,7 @@ class SingleRangeSourceDriver : public RangeSourceDriver { TRangeSource* rs_; // delete this in destructor bool ebwtFw_; PathManager pm_; - ASSERT_ONLY(std::set allTops_); + ASSERT_ONLY(std::set allTops_); }; /** @@ -2378,7 +2378,7 @@ class CostAwareRangeSourceDriver : public RangeSourceDriver { // top offset assert_gt(r->bot, r->top); assert(r->ebwt != NULL); - int64_t top = (int64_t)r->top; + TIndexOff top = (TIndexOff)r->top; top++; // ensure it's not 0 if(!r->ebwt->fw()) top = -top; if(r->fw) { @@ -2549,7 +2549,7 @@ class CostAwareRangeSourceDriver : public RangeSourceDriver { bool verbose_; bool quiet_; bool mixesReads_; - ASSERT_ONLY(std::set allTopsRc_); + ASSERT_ONLY(std::set allTopsRc_); }; #endif /* RANGE_SOURCE_H_ */