diff --git a/amxmodx/CVector.h b/amxmodx/CVector.h index ae05c66a..05538f53 100755 --- a/amxmodx/CVector.h +++ b/amxmodx/CVector.h @@ -32,6 +32,8 @@ #ifndef __CVECTOR_H__ #define __CVECTOR_H__ +#include + // Vector template class CVector { @@ -284,7 +286,7 @@ public: iterator iterAt(size_t pos) { if (pos > m_CurrentUsedSize) - ASSERT(0); + assert(0); return iterator(m_Data + pos); } @@ -331,7 +333,7 @@ public: { if (pos > m_CurrentUsedSize) { - ASSERT(0); + assert(0); } return m_Data[pos]; } @@ -340,7 +342,7 @@ public: { if (pos > m_CurrentUsedSize) { - ASSERT(0); + assert(0); } return m_Data[pos]; } @@ -359,7 +361,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[0]; } @@ -368,7 +370,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[0]; } @@ -377,7 +379,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[m_CurrentUsedSize - 1]; } @@ -386,7 +388,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[m_CurrentUsedSize - 1]; } diff --git a/dlls/engine/CVector.h b/dlls/engine/CVector.h index ae05c66a..05538f53 100755 --- a/dlls/engine/CVector.h +++ b/dlls/engine/CVector.h @@ -32,6 +32,8 @@ #ifndef __CVECTOR_H__ #define __CVECTOR_H__ +#include + // Vector template class CVector { @@ -284,7 +286,7 @@ public: iterator iterAt(size_t pos) { if (pos > m_CurrentUsedSize) - ASSERT(0); + assert(0); return iterator(m_Data + pos); } @@ -331,7 +333,7 @@ public: { if (pos > m_CurrentUsedSize) { - ASSERT(0); + assert(0); } return m_Data[pos]; } @@ -340,7 +342,7 @@ public: { if (pos > m_CurrentUsedSize) { - ASSERT(0); + assert(0); } return m_Data[pos]; } @@ -359,7 +361,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[0]; } @@ -368,7 +370,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[0]; } @@ -377,7 +379,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[m_CurrentUsedSize - 1]; } @@ -386,7 +388,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[m_CurrentUsedSize - 1]; } diff --git a/dlls/fakemeta/CVector.h b/dlls/fakemeta/CVector.h index e2a61cd6..05538f53 100755 --- a/dlls/fakemeta/CVector.h +++ b/dlls/fakemeta/CVector.h @@ -32,6 +32,8 @@ #ifndef __CVECTOR_H__ #define __CVECTOR_H__ +#include + // Vector template class CVector { @@ -76,7 +78,7 @@ template class CVector delete [] m_Data; } if (m_Size < size) - m_CurrentUsedSize = size; + m_CurrentSize = size; m_Data = newData; m_Size = size; return true; @@ -284,7 +286,7 @@ public: iterator iterAt(size_t pos) { if (pos > m_CurrentUsedSize) - ASSERT(0); + assert(0); return iterator(m_Data + pos); } @@ -331,7 +333,7 @@ public: { if (pos > m_CurrentUsedSize) { - ASSERT(0); + assert(0); } return m_Data[pos]; } @@ -340,7 +342,7 @@ public: { if (pos > m_CurrentUsedSize) { - ASSERT(0); + assert(0); } return m_Data[pos]; } @@ -359,7 +361,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[0]; } @@ -368,7 +370,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[0]; } @@ -377,7 +379,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[m_CurrentUsedSize - 1]; } @@ -386,7 +388,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[m_CurrentUsedSize - 1]; } diff --git a/dlls/pgsql/CVector.h b/dlls/pgsql/CVector.h index 79fd9d8c..05538f53 100755 --- a/dlls/pgsql/CVector.h +++ b/dlls/pgsql/CVector.h @@ -32,6 +32,8 @@ #ifndef __CVECTOR_H__ #define __CVECTOR_H__ +#include + // Vector template class CVector { @@ -76,7 +78,7 @@ template class CVector delete [] m_Data; } if (m_Size < size) - m_CurrentUsedSize = size; + m_CurrentSize = size; m_Data = newData; m_Size = size; return true; @@ -90,6 +92,7 @@ protected: T *m_Data; size_t m_Size; size_t m_CurrentUsedSize; + size_t m_CurrentSize; public: class iterator { @@ -283,7 +286,7 @@ public: iterator iterAt(size_t pos) { if (pos > m_CurrentUsedSize) - ASSERT(0); + assert(0); return iterator(m_Data + pos); } @@ -330,7 +333,7 @@ public: { if (pos > m_CurrentUsedSize) { -// ASSERT(0); + assert(0); } return m_Data[pos]; } @@ -339,7 +342,7 @@ public: { if (pos > m_CurrentUsedSize) { -// ASSERT(0); + assert(0); } return m_Data[pos]; } @@ -358,7 +361,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[0]; } @@ -367,7 +370,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[0]; } @@ -376,7 +379,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[m_CurrentUsedSize - 1]; } @@ -385,7 +388,7 @@ public: { if (m_CurrentUsedSize < 1) { - ASSERT(0); + assert(0); } return m_Data[m_CurrentUsedSize - 1]; } @@ -397,7 +400,7 @@ public: if (where != m_Data) --where; // validate iter - if (where < m_Data || where >= (m_Data + m_CurrentSize)) + if (where < m_Data || where >= (m_Data + m_CurrentUsedSize)) return false; ++m_CurrentUsedSize; @@ -415,7 +418,7 @@ public: void erase(iterator where) { // validate iter - if (where < m_Data || where >= (m_Data + m_CurrentSize)) + if (where < m_Data || where >= (m_Data + m_CurrentUsedSize)) return false; if (m_CurrentUsedSize > 1) @@ -437,4 +440,5 @@ public: } }; -#endif // __CVECTOR_H__ \ No newline at end of file +#endif // __CVECTOR_H__ +