Permalink
Browse files

fixing misspelling and some bugs

  • Loading branch information...
1 parent e35c87f commit 43cc27501a2666da63746775630539d3ee5de110 @BenLangmead committed Jul 17, 2014
Showing with 25 additions and 25 deletions.
  1. +2 −2 btypes.h
  2. +4 −4 ebwt_search_backtrack.h
  3. +13 −13 range_cache.h
  4. +6 −6 range_source.h
View
@@ -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;
View
@@ -1783,7 +1783,7 @@ class GreedyDFSRangeSource {
char _trimc;
uint32_t _seed;
#ifndef NDEBUG
- std::set<int64_t> allTops_;
+ std::set<TIndexOff> 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<int64_t> allTops_;
+ std::set<TIndexOff> allTops_;
#endif
};
@@ -3058,7 +3058,7 @@ class EbwtSeededRangeSourceDriver : public RangeSourceDriver<EbwtRangeSource> {
// 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());
View
@@ -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;
View
@@ -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<int64_t> allTops_;
+ std::set<TIndexOff> allTops_;
#endif
};
@@ -1910,7 +1910,7 @@ class SingleRangeSourceDriver : public RangeSourceDriver<TRangeSource> {
// 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> {
TRangeSource* rs_; // delete this in destructor
bool ebwtFw_;
PathManager pm_;
- ASSERT_ONLY(std::set<int64_t> allTops_);
+ ASSERT_ONLY(std::set<TIndexOff> allTops_);
};
/**
@@ -2378,7 +2378,7 @@ class CostAwareRangeSourceDriver : public RangeSourceDriver<TRangeSource> {
// 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<TRangeSource> {
bool verbose_;
bool quiet_;
bool mixesReads_;
- ASSERT_ONLY(std::set<int64_t> allTopsRc_);
+ ASSERT_ONLY(std::set<TIndexOff> allTopsRc_);
};
#endif /* RANGE_SOURCE_H_ */

0 comments on commit 43cc275

Please sign in to comment.