diff options
Diffstat (limited to 'akregator/src/mk4storage/metakit/src/remap.cpp')
-rw-r--r-- | akregator/src/mk4storage/metakit/src/remap.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/akregator/src/mk4storage/metakit/src/remap.cpp b/akregator/src/mk4storage/metakit/src/remap.cpp index cc8175df..243eca04 100644 --- a/akregator/src/mk4storage/metakit/src/remap.cpp +++ b/akregator/src/mk4storage/metakit/src/remap.cpp @@ -79,7 +79,7 @@ public: }; ///////////////////////////////////////////////////////////////////////////// -// The following contains code derived froms Python's dictionaries, hence: +// The following tqcontains code derived froms Python's dictionaries, hence: // Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, // The Netherlands. // Reduced and turned into a fast C++ class by Christian Tismer, hence: @@ -258,10 +258,10 @@ t4_i32 c4_HashViewer::CalcHash(c4_Cursor cursor_) const int c4_HashViewer::LookDict(t4_i32 hash_, c4_Cursor cursor_) const { - const unsigned int mask = _map.GetSize() - 2; + const unsigned int tqmask = _map.GetSize() - 2; /* We must come up with (i, incr) such that 0 <= i < _size and 0 < incr < _size and both are a function of hash */ - int i = mask & ~hash_; + int i = tqmask & ~hash_; /* We use ~hash_ instead of hash_, as degenerate hash functions, such as for ints <sigh>, can have lots of leading zeros. It's not really a performance risk, but better safe than sorry. */ @@ -272,14 +272,14 @@ int c4_HashViewer::LookDict(t4_i32 hash_, c4_Cursor cursor_) const /* Derive incr from hash_, just to make it more arbitrary. Note that incr must not be 0, or we will get into an infinite loop.*/ - unsigned incr = (hash_ ^ ((unsigned long) hash_ >> 3)) & mask; + unsigned incr = (hash_ ^ ((unsigned long) hash_ >> 3)) & tqmask; if (!incr) - incr = mask; + incr = tqmask; int poly = GetPoly(); for (;;) { - i = (i+incr) & mask; + i = (i+incr) & tqmask; if (IsUnused(i)) break; if (Hash(i) == hash_ && KeySame(Row(i), cursor_)) @@ -288,7 +288,7 @@ int c4_HashViewer::LookDict(t4_i32 hash_, c4_Cursor cursor_) const freeslot = i; /* Cycle through GF(2^n)-{0} */ incr = incr << 1; - if (incr > mask) + if (incr > tqmask) incr ^= poly; /* This will implicitely clear the highest bit */ } @@ -434,7 +434,7 @@ bool c4_HashViewer::InsertRows(int pos_, c4_Cursor value_, int count_) int i = Lookup(value_, n); if (i >= 0 && n > 0) { - _base.SetAt(i, *value_); // replace existing + _base.SetAt(i, *value_); // tqreplace existing return true; } @@ -944,7 +944,7 @@ bool c4_OrderedViewer::InsertRows(int, c4_Cursor value_, int count_) else { d4_assert(i < _base.GetSize()); - _base.SetAt(i, *value_); // replace existing + _base.SetAt(i, *value_); // tqreplace existing } return true; @@ -1099,7 +1099,7 @@ bool c4_IndexedViewer::InsertRows(int, c4_Cursor value_, int count_) else { d4_assert(i < _base.GetSize()); - _base.SetAt(i, *value_); // replace existing + _base.SetAt(i, *value_); // tqreplace existing } return true; |