mirror of https://github.com/OpenTTD/OpenTTD
(svn r18828) -Fix (r18823): Decrementing uints is different to ints.
parent
ff11095916
commit
6101ad8396
|
@ -78,8 +78,10 @@ public:
|
||||||
/** Clear (destroy) all items */
|
/** Clear (destroy) all items */
|
||||||
FORCEINLINE void Clear()
|
FORCEINLINE void Clear()
|
||||||
{
|
{
|
||||||
/* walk through all allocated items backward and destroy them */
|
/* Walk through all allocated items backward and destroy them
|
||||||
for (T *pItem = &data[Length() - 1]; pItem >= data; pItem--) {
|
* Note: this->Length() can be zero. In that case data[this->Length() - 1] is evaluated unsigned
|
||||||
|
* on some compilers with some architectures. (e.g. gcc with x86) */
|
||||||
|
for (T *pItem = this->data + this->Length() - 1; pItem >= this->data; pItem--) {
|
||||||
pItem->~T();
|
pItem->~T();
|
||||||
}
|
}
|
||||||
/* number of items become zero */
|
/* number of items become zero */
|
||||||
|
|
Loading…
Reference in New Issue