mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Build fixes for mingw (#245)
This commit is contained in:

committed by
GitHub

parent
4c5c709af6
commit
e928fc9425
@@ -9,6 +9,9 @@
|
||||
#define HASH_TABLE_OPT_EXPAND_ADD 1
|
||||
#define HASH_TABLE_OPT_EXPAND_MULTIPLY 2
|
||||
|
||||
template <class T>
|
||||
class MxHashTableCursor;
|
||||
|
||||
template <class T>
|
||||
class MxHashTableNode
|
||||
{
|
||||
@@ -162,13 +165,13 @@ MxHashTable<T>::~MxHashTable()
|
||||
|
||||
while (t) {
|
||||
MxHashTableNode<T> *next = t->m_next;
|
||||
m_customDestructor(t->m_obj);
|
||||
this->m_customDestructor(t->m_obj);
|
||||
delete t;
|
||||
t = next;
|
||||
}
|
||||
}
|
||||
|
||||
m_numKeys = 0;
|
||||
this->m_numKeys = 0;
|
||||
memset(m_slots, 0, sizeof(MxHashTableNode<T> *) * m_numSlots);
|
||||
|
||||
delete[] m_slots;
|
||||
@@ -196,7 +199,7 @@ inline void MxHashTable<T>::Resize()
|
||||
// FIXME: order? m_numKeys set after `rep stosd`
|
||||
m_slots = new_table;
|
||||
memset(m_slots, 0, sizeof(MxHashTableNode<T> *) * m_numSlots);
|
||||
m_numKeys = 0;
|
||||
this->m_numKeys = 0;
|
||||
|
||||
for (int i = 0; i != old_size; i++) {
|
||||
MxHashTableNode<T> *t = old_table[i];
|
||||
@@ -223,13 +226,13 @@ inline void MxHashTable<T>::_NodeInsert(MxHashTableNode<T> *p_node)
|
||||
m_slots[bucket]->m_prev = p_node;
|
||||
|
||||
m_slots[bucket] = p_node;
|
||||
m_numKeys++;
|
||||
this->m_numKeys++;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline void MxHashTable<T>::Add(T* p_newobj)
|
||||
{
|
||||
if (m_resizeOption && ((m_numKeys + 1) / m_numSlots) > m_autoResizeRatio)
|
||||
if (m_resizeOption && ((this->m_numKeys + 1) / m_numSlots) > m_autoResizeRatio)
|
||||
MxHashTable<T>::Resize();
|
||||
|
||||
MxU32 hash = Hash(p_newobj);
|
||||
@@ -238,4 +241,4 @@ inline void MxHashTable<T>::Add(T* p_newobj)
|
||||
MxHashTable<T>::_NodeInsert(node);
|
||||
}
|
||||
|
||||
#endif // MXHASHTABLE_H
|
||||
#endif // MXHASHTABLE_H
|
||||
|
Reference in New Issue
Block a user