mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 03:09:13 +00:00
Fix a bunch of syntax errors in pnUtils.
This commit is contained in:
@ -765,16 +765,16 @@ TArray<T,C> & TArray<T,C>::operator= (const TArray<T,C> & source) {
|
|||||||
if (&source == this)
|
if (&source == this)
|
||||||
return *this;
|
return *this;
|
||||||
m_chunkSize = source.m_chunkSize;
|
m_chunkSize = source.m_chunkSize;
|
||||||
AdjustSize(max(m_alloc, source.m_count), 0);
|
AdjustSize(max(this->m_alloc, source.m_count), 0);
|
||||||
C::CopyConstruct(m_data, source.m_data, source.m_count);
|
C::CopyConstruct(this->m_data, source.m_data, source.m_count);
|
||||||
m_count = source.m_count;
|
this->m_count = source.m_count;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
unsigned TArray<T,C>::Add (const T & source) {
|
unsigned TArray<T,C>::Add (const T & source) {
|
||||||
unsigned index = m_count;
|
unsigned index = this->m_count;
|
||||||
Push(source);
|
Push(source);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
@ -782,20 +782,20 @@ unsigned TArray<T,C>::Add (const T & source) {
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
unsigned TArray<T,C>::Add (const T * source, unsigned count) {
|
unsigned TArray<T,C>::Add (const T * source, unsigned count) {
|
||||||
unsigned index = m_count;
|
unsigned index = this->m_count;
|
||||||
AdjustSizeChunked(m_count + count, m_count);
|
AdjustSizeChunked(this->m_count + count, this->m_count);
|
||||||
C::CopyConstruct(&m_data[m_count], source, count);
|
C::CopyConstruct(&this->m_data[this->m_count], source, count);
|
||||||
m_count += count;
|
this->m_count += count;
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
unsigned TArray<T,C>::AddArray (const TArray<T,C> & source) {
|
unsigned TArray<T,C>::AddArray (const TArray<T,C> & source) {
|
||||||
unsigned index = m_count;
|
unsigned index = this->m_count;
|
||||||
AdjustSizeChunked(m_count + source.m_count, m_count);
|
AdjustSizeChunked(this->m_count + source.m_count, this->m_count);
|
||||||
C::CopyConstruct(&m_data[m_count], source.m_data, source.m_count);
|
C::CopyConstruct(&this->m_data[this->m_count], source.m_data, source.m_count);
|
||||||
m_count += source.m_count;
|
this->m_count += source.m_count;
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -804,15 +804,15 @@ template<class T, class C>
|
|||||||
void TArray<T,C>::AdjustSizeChunked (unsigned newAlloc, unsigned newCount) {
|
void TArray<T,C>::AdjustSizeChunked (unsigned newAlloc, unsigned newCount) {
|
||||||
|
|
||||||
// Disallow shrinking the allocation
|
// Disallow shrinking the allocation
|
||||||
if (newAlloc <= m_alloc)
|
if (newAlloc <= this->m_alloc)
|
||||||
newAlloc = m_alloc;
|
newAlloc = this->m_alloc;
|
||||||
|
|
||||||
// Process growing the allocation
|
// Process growing the allocation
|
||||||
else
|
else
|
||||||
newAlloc = CalcAllocGrowth(newAlloc, m_alloc, &m_chunkSize);
|
newAlloc = CalcAllocGrowth(newAlloc, this->m_alloc, &this->m_chunkSize);
|
||||||
|
|
||||||
// Perform the allocation
|
// Perform the allocation
|
||||||
AdjustSize(newAlloc, newCount);
|
this->AdjustSize(newAlloc, newCount);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -823,38 +823,38 @@ void TArray<T,C>::Copy (unsigned destIndex, unsigned sourceIndex, unsigned count
|
|||||||
// Copy the data to the destination
|
// Copy the data to the destination
|
||||||
ASSERT(destIndex + count <= m_count);
|
ASSERT(destIndex + count <= m_count);
|
||||||
ASSERT(sourceIndex + count <= m_count);
|
ASSERT(sourceIndex + count <= m_count);
|
||||||
C::Assign(m_data + destIndex, m_data + sourceIndex, count);
|
C::Assign(this->m_data + destIndex, this->m_data + sourceIndex, count);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
void TArray<T,C>::DeleteOrdered (unsigned index) {
|
void TArray<T,C>::DeleteOrdered (unsigned index) {
|
||||||
ASSERT(index < m_count);
|
ASSERT(index < this->m_count);
|
||||||
if (index + 1 < m_count)
|
if (index + 1 < this->m_count)
|
||||||
C::Assign(&m_data[index], &m_data[index + 1], m_count - index - 1);
|
C::Assign(&this->m_data[index], &this->m_data[index + 1], this->m_count - index - 1);
|
||||||
C::Destruct(&m_data[--m_count]);
|
C::Destruct(&this->m_data[--this->m_count]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
void TArray<T,C>::DeleteUnordered (unsigned index) {
|
void TArray<T,C>::DeleteUnordered (unsigned index) {
|
||||||
ASSERT(index < m_count);
|
ASSERT(index < this->m_count);
|
||||||
if (index + 1 < m_count)
|
if (index + 1 < this->m_count)
|
||||||
C::Assign(&m_data[index], &m_data[m_count - 1], 1);
|
C::Assign(&this->m_data[index], &this->m_data[this->m_count - 1], 1);
|
||||||
C::Destruct(&m_data[--m_count]);
|
C::Destruct(&this->m_data[--this->m_count]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
void TArray<T,C>::GrowToCount (unsigned count, bool zero) {
|
void TArray<T,C>::GrowToCount (unsigned count, bool zero) {
|
||||||
if (count <= m_count)
|
if (count <= this->m_count)
|
||||||
return;
|
return;
|
||||||
AdjustSizeChunked(count, m_count);
|
AdjustSizeChunked(count, this->m_count);
|
||||||
if (zero)
|
if (zero)
|
||||||
memset(m_data + m_count, 0, (count - m_count) * sizeof(T));
|
memset(this->m_data + this->m_count, 0, (count - this->m_count) * sizeof(T));
|
||||||
C::Construct(m_data + m_count, count - m_count);
|
C::Construct(this->m_data + this->m_count, count - this->m_count);
|
||||||
m_count = count;
|
this->m_count = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
@ -866,9 +866,9 @@ void TArray<T,C>::GrowToFit (unsigned index, bool zero) {
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
void TArray<T,C>::ShrinkBy (unsigned count) {
|
void TArray<T,C>::ShrinkBy (unsigned count) {
|
||||||
ASSERT(count <= m_count);
|
ASSERT(count <= this->m_count);
|
||||||
C::Destruct(m_data + m_count - count, count);
|
C::Destruct(this->m_data + this->m_count - count, count);
|
||||||
m_count -= count;
|
this->m_count -= count;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
@ -876,20 +876,20 @@ template<class T, class C>
|
|||||||
void TArray<T,C>::Move (unsigned destIndex, unsigned sourceIndex, unsigned count) {
|
void TArray<T,C>::Move (unsigned destIndex, unsigned sourceIndex, unsigned count) {
|
||||||
|
|
||||||
// Copy the data to the destination
|
// Copy the data to the destination
|
||||||
ASSERT(destIndex + count <= m_count);
|
ASSERT(destIndex + count <= this->m_count);
|
||||||
ASSERT(sourceIndex + count <= m_count);
|
ASSERT(sourceIndex + count <= this->m_count);
|
||||||
C::Assign(m_data + destIndex, m_data + sourceIndex, count);
|
C::Assign(this->m_data + destIndex, this->m_data + sourceIndex, count);
|
||||||
|
|
||||||
// Remove it from the source
|
// Remove it from the source
|
||||||
if (destIndex >= sourceIndex) {
|
if (destIndex >= sourceIndex) {
|
||||||
C::Destruct(m_data + sourceIndex, min(count, destIndex - sourceIndex));
|
C::Destruct(this->m_data + sourceIndex, min(count, destIndex - sourceIndex));
|
||||||
C::Construct(m_data + sourceIndex, min(count, destIndex - sourceIndex));
|
C::Construct(this->m_data + sourceIndex, min(count, destIndex - sourceIndex));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unsigned overlap = (destIndex + count > sourceIndex) ? (destIndex + count - sourceIndex) : 0;
|
unsigned overlap = (destIndex + count > sourceIndex) ? (destIndex + count - sourceIndex) : 0;
|
||||||
ASSERT(overlap <= count);
|
ASSERT(overlap <= count);
|
||||||
C::Destruct(m_data + sourceIndex + overlap, count - overlap);
|
C::Destruct(this->m_data + sourceIndex + overlap, count - overlap);
|
||||||
C::Construct(m_data + sourceIndex + overlap, count - overlap);
|
C::Construct(this->m_data + sourceIndex + overlap, count - overlap);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -897,72 +897,72 @@ void TArray<T,C>::Move (unsigned destIndex, unsigned sourceIndex, unsigned count
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
T * TArray<T,C>::New () {
|
T * TArray<T,C>::New () {
|
||||||
AdjustSizeChunked(m_count + 1, m_count + 1);
|
AdjustSizeChunked(this->m_count + 1, this->m_count + 1);
|
||||||
return &m_data[m_count - 1];
|
return &this->m_data[this->m_count - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
T * TArray<T,C>::New (unsigned count) {
|
T * TArray<T,C>::New (unsigned count) {
|
||||||
AdjustSizeChunked(m_count + count, m_count + count);
|
AdjustSizeChunked(this->m_count + count, this->m_count + count);
|
||||||
return &m_data[m_count - count];
|
return &this->m_data[this->m_count - count];
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
void TArray<T,C>::Push (const T & source) {
|
void TArray<T,C>::Push (const T & source) {
|
||||||
AdjustSizeChunked(m_count + 1, m_count);
|
AdjustSizeChunked(this->m_count + 1, this->m_count);
|
||||||
C::CopyConstruct(&m_data[m_count], source);
|
C::CopyConstruct(&this->m_data[this->m_count], source);
|
||||||
++m_count;
|
++this->m_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
T TArray<T,C>::Pop () {
|
T TArray<T,C>::Pop () {
|
||||||
ASSERT(m_count);
|
ASSERT(this->m_count);
|
||||||
T result = m_data[--m_count];
|
T result = this->m_data[--this->m_count];
|
||||||
C::Destruct(m_data + m_count);
|
C::Destruct(this->m_data + this->m_count);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
void TArray<T,C>::Reserve (unsigned additionalCount) {
|
void TArray<T,C>::Reserve (unsigned additionalCount) {
|
||||||
AdjustSizeChunked(max(m_alloc, m_count + additionalCount), m_count);
|
AdjustSizeChunked(max(this->m_alloc, this->m_count + additionalCount), this->m_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
void TArray<T,C>::Set (const T * source, unsigned count) {
|
void TArray<T,C>::Set (const T * source, unsigned count) {
|
||||||
AdjustSizeChunked(count, 0);
|
AdjustSizeChunked(count, 0);
|
||||||
C::CopyConstruct(m_data, source, count);
|
C::CopyConstruct(this->m_data, source, count);
|
||||||
m_count = count;
|
this->m_count = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
void TArray<T,C>::SetChunkSize (unsigned chunkSize) {
|
void TArray<T,C>::SetChunkSize (unsigned chunkSize) {
|
||||||
m_chunkSize = chunkSize;
|
this->m_chunkSize = chunkSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
void TArray<T,C>::SetCount (unsigned count) {
|
void TArray<T,C>::SetCount (unsigned count) {
|
||||||
AdjustSizeChunked(max(m_alloc, count), count);
|
AdjustSizeChunked(max(this->m_alloc, count), count);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
void TArray<T,C>::SetCountFewer (unsigned count) {
|
void TArray<T,C>::SetCountFewer (unsigned count) {
|
||||||
ASSERT(count <= m_count);
|
ASSERT(count <= this->m_count);
|
||||||
C::Destruct(m_data + count, m_count - count);
|
C::Destruct(this->m_data + count, this->m_count - count);
|
||||||
m_count = count;
|
this->m_count = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C>
|
template<class T, class C>
|
||||||
void TArray<T,C>::Trim () {
|
void TArray<T,C>::Trim () {
|
||||||
AdjustSize(m_count, m_count);
|
this->AdjustSize(this->m_count, this->m_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -995,15 +995,15 @@ bool TSortArray<T,C,K,OFFSET>::Delete (K sortKey) {
|
|||||||
|
|
||||||
// Find the correct position for this key
|
// Find the correct position for this key
|
||||||
unsigned index;
|
unsigned index;
|
||||||
BSEARCH(T, Ptr(), Count(), (sortKey > SortKey(elem)), &index);
|
BSEARCH(T, this->Ptr(), this->Count(), (sortKey > SortKey(elem)), &index);
|
||||||
|
|
||||||
// Verify that an entry exists for this key
|
// Verify that an entry exists for this key
|
||||||
unsigned count = Count();
|
unsigned count = this->Count();
|
||||||
if ((index >= count) || (SortKey((*this)[index]) != sortKey))
|
if ((index >= count) || (SortKey((*this)[index]) != sortKey))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Delete the entry
|
// Delete the entry
|
||||||
DeleteOrdered(index);
|
this->DeleteOrdered(index);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1013,8 +1013,8 @@ template<class T, class C, class K, unsigned OFFSET>
|
|||||||
T * TSortArray<T,C,K,OFFSET>::Find (K sortKey, unsigned * index) {
|
T * TSortArray<T,C,K,OFFSET>::Find (K sortKey, unsigned * index) {
|
||||||
|
|
||||||
// Find the correct position for this key
|
// Find the correct position for this key
|
||||||
BSEARCH(T, Ptr(), Count(), (sortKey > SortKey(elem)), index);
|
BSEARCH(T, this->Ptr(), this->Count(), (sortKey > SortKey(elem)), index);
|
||||||
if (*index >= Count())
|
if (*index >= this->Count())
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
// Check whether the key is at that position
|
// Check whether the key is at that position
|
||||||
@ -1028,8 +1028,8 @@ template<class T, class C, class K, unsigned OFFSET>
|
|||||||
const T * TSortArray<T,C,K,OFFSET>::Find (K sortKey, unsigned * index) const {
|
const T * TSortArray<T,C,K,OFFSET>::Find (K sortKey, unsigned * index) const {
|
||||||
|
|
||||||
// Find the correct position for this key
|
// Find the correct position for this key
|
||||||
BSEARCH(T, Ptr(), Count(), (sortKey > SortKey(elem)), index);
|
BSEARCH(T, this->Ptr(), this->Count(), (sortKey > SortKey(elem)), index);
|
||||||
if (*index >= Count())
|
if (*index >= this->Count())
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
// Check whether the key is at that position
|
// Check whether the key is at that position
|
||||||
@ -1043,10 +1043,10 @@ template<class T, class C, class K, unsigned OFFSET>
|
|||||||
T * TSortArray<T,C,K,OFFSET>::Insert (K sortKey, unsigned index) {
|
T * TSortArray<T,C,K,OFFSET>::Insert (K sortKey, unsigned index) {
|
||||||
|
|
||||||
// Insert a new entry at this position
|
// Insert a new entry at this position
|
||||||
unsigned count = Count();
|
unsigned count = this->Count();
|
||||||
SetCount(count + 1);
|
this->SetCount(count + 1);
|
||||||
if (index < count)
|
if (index < count)
|
||||||
Move(index + 1, index, count - index);
|
this->Move(index + 1, index, count - index);
|
||||||
|
|
||||||
// Fill in the new entry
|
// Fill in the new entry
|
||||||
T & elem = (*this)[index];
|
T & elem = (*this)[index];
|
||||||
@ -1058,8 +1058,8 @@ T * TSortArray<T,C,K,OFFSET>::Insert (K sortKey, unsigned index) {
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class C, class K, unsigned OFFSET>
|
template<class T, class C, class K, unsigned OFFSET>
|
||||||
void TSortArray<T,C,K,OFFSET>::Sort () {
|
void TSortArray<T,C,K,OFFSET>::Sort () {
|
||||||
T * ptr = Ptr();
|
T * ptr = this->Ptr();
|
||||||
unsigned count = Count();
|
unsigned count = this->Count();
|
||||||
QSORT(
|
QSORT(
|
||||||
T,
|
T,
|
||||||
ptr,
|
ptr,
|
||||||
|
@ -451,7 +451,7 @@ T * THashTable<T,K>::FindNext (const K & key, T * object) {
|
|||||||
template<class T, class K>
|
template<class T, class K>
|
||||||
const T * THashTable<T,K>::Find (const K & key) const {
|
const T * THashTable<T,K>::Find (const K & key) const {
|
||||||
unsigned hash = key.GetHash();
|
unsigned hash = key.GetHash();
|
||||||
const LIST(T) & slotList = GetSlotList(hash);
|
const LIST(T) & slotList = this->GetSlotList(hash);
|
||||||
for (const T * curr = slotList.Head(); curr; curr = slotList.Next(curr))
|
for (const T * curr = slotList.Head(); curr; curr = slotList.Next(curr))
|
||||||
if ((GetHash(curr) == hash) && (*curr == key))
|
if ((GetHash(curr) == hash) && (*curr == key))
|
||||||
return curr;
|
return curr;
|
||||||
@ -462,7 +462,7 @@ const T * THashTable<T,K>::Find (const K & key) const {
|
|||||||
template<class T, class K>
|
template<class T, class K>
|
||||||
const T * THashTable<T,K>::FindNext (const K & key, const T * object) const {
|
const T * THashTable<T,K>::FindNext (const K & key, const T * object) const {
|
||||||
unsigned hash = key.GetHash();
|
unsigned hash = key.GetHash();
|
||||||
const LIST(T) & slotList = GetSlotList(hash);
|
const LIST(T) & slotList = this->GetSlotList(hash);
|
||||||
for (const T * curr = slotList.Next(object); curr; curr = slotList.Next(curr))
|
for (const T * curr = slotList.Next(object); curr; curr = slotList.Next(curr))
|
||||||
if ((GetHash(curr) == hash) && (*curr == key))
|
if ((GetHash(curr) == hash) && (*curr == key))
|
||||||
return curr;
|
return curr;
|
||||||
@ -501,8 +501,8 @@ public:
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class K, int linkOffset, unsigned maxSize>
|
template<class T, class K, int linkOffset, unsigned maxSize>
|
||||||
THashTableDecl<T,K,linkOffset,maxSize>::THashTableDecl () {
|
THashTableDecl<T,K,linkOffset,maxSize>::THashTableDecl () {
|
||||||
SetLinkOffset(linkOffset, maxSize);
|
this->SetLinkOffset(linkOffset, maxSize);
|
||||||
SetSlotMaxCount(maxSize);
|
this->SetSlotMaxCount(maxSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -523,8 +523,8 @@ public:
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, class K>
|
template<class T, class K>
|
||||||
void THashTableDyn<T,K>::Initialize (int linkOffset, unsigned maxSize) {
|
void THashTableDyn<T,K>::Initialize (int linkOffset, unsigned maxSize) {
|
||||||
SetLinkOffset(linkOffset, maxSize);
|
this->SetLinkOffset(linkOffset, maxSize);
|
||||||
SetSlotMaxCount(maxSize);
|
this->SetSlotMaxCount(maxSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -581,10 +581,10 @@ template<class C>
|
|||||||
class THashKeyStrCmp : public THashKeyStrBase<C> {
|
class THashKeyStrCmp : public THashKeyStrBase<C> {
|
||||||
public:
|
public:
|
||||||
bool operator== (const THashKeyStrCmp & rhs) const {
|
bool operator== (const THashKeyStrCmp & rhs) const {
|
||||||
return StrCmp(m_str, rhs.m_str) == 0;
|
return StrCmp(this->m_str, rhs.m_str) == 0;
|
||||||
}
|
}
|
||||||
unsigned GetHash () const {
|
unsigned GetHash () const {
|
||||||
return StrHash(m_str);
|
return StrHash(this->m_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -597,10 +597,10 @@ template<class C>
|
|||||||
class THashKeyStrCmpI : public THashKeyStrBase<C> {
|
class THashKeyStrCmpI : public THashKeyStrBase<C> {
|
||||||
public:
|
public:
|
||||||
bool operator== (const THashKeyStrCmpI & rhs) const {
|
bool operator== (const THashKeyStrCmpI & rhs) const {
|
||||||
return StrCmpI(m_str, rhs.m_str) == 0;
|
return StrCmpI(this->m_str, rhs.m_str) == 0;
|
||||||
}
|
}
|
||||||
unsigned GetHash () const {
|
unsigned GetHash () const {
|
||||||
return StrHashI(m_str);
|
return StrHashI(this->m_str);
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -621,7 +621,7 @@ public:
|
|||||||
THashKeyStrPtr () { }
|
THashKeyStrPtr () { }
|
||||||
THashKeyStrPtr (const C str[]) : T(str) { }
|
THashKeyStrPtr (const C str[]) : T(str) { }
|
||||||
void SetString (const C str[]) {
|
void SetString (const C str[]) {
|
||||||
m_str = str;
|
this->m_str = str;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -648,12 +648,12 @@ public:
|
|||||||
SetString(nil);
|
SetString(nil);
|
||||||
}
|
}
|
||||||
void SetString (const C str[]) { // deprecated
|
void SetString (const C str[]) { // deprecated
|
||||||
if (m_str)
|
if (this->m_str)
|
||||||
FREE(const_cast<C *>(m_str));
|
FREE(const_cast<C *>(this->m_str));
|
||||||
if (str)
|
if (str)
|
||||||
m_str = StrDup(str);
|
this->m_str = StrDup(str);
|
||||||
else
|
else
|
||||||
m_str = nil;
|
this->m_str = nil;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -554,7 +554,7 @@ inline T * TList<T>::NewFlags (unsigned flags, ELinkType linkType, T * existingN
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T>
|
template<class T>
|
||||||
inline T * TList<T>::NewZero (ELinkType linkType, T * existingNode, const char file[], int line) {
|
inline T * TList<T>::NewZero (ELinkType linkType, T * existingNode, const char file[], int line) {
|
||||||
return NewFlags(MEM_ZERO, linkType, existingNode, file, line);
|
return NewFlags(0, linkType, existingNode, file, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
@ -605,7 +605,7 @@ public:
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T, int linkOffset>
|
template<class T, int linkOffset>
|
||||||
TListDecl<T,linkOffset>::TListDecl () {
|
TListDecl<T,linkOffset>::TListDecl () {
|
||||||
SetLinkOffset(linkOffset);
|
this->SetLinkOffset(linkOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -626,5 +626,5 @@ public:
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T>
|
template<class T>
|
||||||
void TListDyn<T>::Initialize (int linkOffset) {
|
void TListDyn<T>::Initialize (int linkOffset) {
|
||||||
SetLinkOffset(linkOffset);
|
this->SetLinkOffset(linkOffset);
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ private:
|
|||||||
int m_linkOffset;
|
int m_linkOffset;
|
||||||
ARRAY(C *) m_array;
|
ARRAY(C *) m_array;
|
||||||
|
|
||||||
friend TBasePriority<C,P>;
|
friend class TBasePriority<C,P>;
|
||||||
};
|
};
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
@ -332,7 +332,7 @@ inline void TPriorityQueue<C,P>::UnlinkAll () {
|
|||||||
template<class C, class P, int linkOffset>
|
template<class C, class P, int linkOffset>
|
||||||
class TPriorityQueueDecl : public TPriorityQueue<C,P> {
|
class TPriorityQueueDecl : public TPriorityQueue<C,P> {
|
||||||
public:
|
public:
|
||||||
TPriorityQueueDecl () { SetLinkOffset(linkOffset); }
|
TPriorityQueueDecl () { this->SetLinkOffset(linkOffset); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -345,7 +345,7 @@ public:
|
|||||||
template<class C, class P>
|
template<class C, class P>
|
||||||
class TPriorityQueueDyn : public TPriorityQueue<C,P> {
|
class TPriorityQueueDyn : public TPriorityQueue<C,P> {
|
||||||
public:
|
public:
|
||||||
void Initialize (int linkOffset) { SetLinkOffset(linkOffset); }
|
void Initialize (int linkOffset) { this->SetLinkOffset(linkOffset); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -381,7 +381,7 @@ private:
|
|||||||
TPriorityQueue<C,P> * m_queue;
|
TPriorityQueue<C,P> * m_queue;
|
||||||
unsigned m_index;
|
unsigned m_index;
|
||||||
|
|
||||||
friend TPriorityQueue<C,P>;
|
friend class TPriorityQueue<C,P>;
|
||||||
};
|
};
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
@ -421,7 +421,7 @@ public:
|
|||||||
if (value == m_value)
|
if (value == m_value)
|
||||||
return;
|
return;
|
||||||
m_value = value;
|
m_value = value;
|
||||||
Relink();
|
this->Relink();
|
||||||
}
|
}
|
||||||
T Get () const {
|
T Get () const {
|
||||||
return m_value;
|
return m_value;
|
||||||
@ -454,7 +454,7 @@ public:
|
|||||||
if (m_time == time)
|
if (m_time == time)
|
||||||
return;
|
return;
|
||||||
m_time = time;
|
m_time = time;
|
||||||
Relink();
|
this->Relink();
|
||||||
}
|
}
|
||||||
unsigned Get () const {
|
unsigned Get () const {
|
||||||
return m_time;
|
return m_time;
|
||||||
|
@ -97,13 +97,13 @@ class TSkipList {
|
|||||||
private:
|
private:
|
||||||
enum { kMaxLevels = 32 };
|
enum { kMaxLevels = 32 };
|
||||||
|
|
||||||
template<class T, class K>
|
template<class T2, class K2>
|
||||||
struct TNode {
|
struct TNode {
|
||||||
const K * key;
|
const K2 * key;
|
||||||
T * object;
|
T2 * object;
|
||||||
unsigned level;
|
unsigned level;
|
||||||
TNode<T, K> * prev;
|
TNode<T2, K2> * prev;
|
||||||
TNode<T, K> * next[1]; // variable size array
|
TNode<T2, K2> * next[1]; // variable size array
|
||||||
};
|
};
|
||||||
typedef TNode<T,K> Node;
|
typedef TNode<T,K> Node;
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ public:
|
|||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
template<class T, class K, unsigned keyOffset, class Cmp>
|
template<class T, class K, unsigned keyOffset, class Cmp>
|
||||||
typename TSkipList<T,K,keyOffset,Cmp>::TNode<T,K> * TSkipList<T,K,keyOffset,Cmp>::AllocNode (unsigned level) {
|
typename TSkipList<T,K,keyOffset,Cmp>::Node* TSkipList<T,K,keyOffset,Cmp>::AllocNode (unsigned level) {
|
||||||
|
|
||||||
unsigned size = offsetof(Node, next) + (level + 1) * sizeof(Node);
|
unsigned size = offsetof(Node, next) + (level + 1) * sizeof(Node);
|
||||||
Node * node = (Node *)ALLOC(size);
|
Node * node = (Node *)ALLOC(size);
|
||||||
|
@ -102,13 +102,13 @@ public:
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T>
|
template<class T>
|
||||||
void * TSpareList<T>::Alloc () {
|
void * TSpareList<T>::Alloc () {
|
||||||
return CBaseSpareList::Alloc(OBJECT_SIZE, typeid(T).raw_name());
|
return CBaseSpareList::Alloc(OBJECT_SIZE, typeid(T).name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T>
|
template<class T>
|
||||||
void TSpareList<T>::CleanUp () {
|
void TSpareList<T>::CleanUp () {
|
||||||
CBaseSpareList::CleanUp(typeid(T).raw_name());
|
CBaseSpareList::CleanUp(typeid(T).name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
@ -127,5 +127,5 @@ void TSpareList<T>::Free (T * node) {
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
template<class T>
|
template<class T>
|
||||||
T * TSpareList<T>::New () {
|
T * TSpareList<T>::New () {
|
||||||
return new(CBaseSpareList::Alloc(OBJECT_SIZE, typeid(T).raw_name())) T;
|
return new(CBaseSpareList::Alloc(OBJECT_SIZE, typeid(T).name())) T;
|
||||||
}
|
}
|
||||||
|
@ -36,10 +36,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
|
|
||||||
template<typename chartype>
|
template<typename chartype>
|
||||||
struct SubstParsedData {
|
struct SubstParsedData {
|
||||||
template<typename chartype>
|
template<typename char_type>
|
||||||
struct SubstBlock {
|
struct SubstBlock {
|
||||||
bool isVar;
|
bool isVar;
|
||||||
chartype * data;
|
char_type * data;
|
||||||
unsigned strLen;
|
unsigned strLen;
|
||||||
|
|
||||||
SubstBlock()
|
SubstBlock()
|
||||||
|
Reference in New Issue
Block a user