mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
overflow avoidance
This commit is contained in:
parent
ddac695252
commit
6596865d92
1 changed files with 3 additions and 3 deletions
|
|
@ -407,7 +407,7 @@ template<class T> inline void Vector<T>::insert(U32 index)
|
||||||
|
|
||||||
dMemmove(&mArray[index + 1],
|
dMemmove(&mArray[index + 1],
|
||||||
&mArray[index],
|
&mArray[index],
|
||||||
(mElementCount - index - 1) * sizeof(value_type));
|
dsize_t(mElementCount - index - 1) * sizeof(value_type));
|
||||||
|
|
||||||
constructInPlace(&mArray[index]);
|
constructInPlace(&mArray[index]);
|
||||||
}
|
}
|
||||||
|
|
@ -428,7 +428,7 @@ template<class T> inline void Vector<T>::erase(U32 index)
|
||||||
{
|
{
|
||||||
dMemmove(&mArray[index],
|
dMemmove(&mArray[index],
|
||||||
&mArray[index + 1],
|
&mArray[index + 1],
|
||||||
(mElementCount - index - 1) * sizeof(value_type));
|
dsize_t(mElementCount - index - 1) * sizeof(value_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
mElementCount--;
|
mElementCount--;
|
||||||
|
|
@ -461,7 +461,7 @@ template<class T> inline void Vector<T>::erase(U32 index, U32 count)
|
||||||
|
|
||||||
dMemmove( &mArray[index],
|
dMemmove( &mArray[index],
|
||||||
&mArray[index + count],
|
&mArray[index + count],
|
||||||
(mElementCount - index - count) * sizeof(value_type));
|
dsize_t(mElementCount - index - count) * sizeof(value_type));
|
||||||
|
|
||||||
mElementCount -= count;
|
mElementCount -= count;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue