mirror of https://github.com/AxioDL/tinyxml2.git
Use proper constraints for int variable
This commit is contained in:
parent
38b49ae042
commit
ed7a7dc985
|
@ -232,14 +232,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void Push( T t ) {
|
void Push( T t ) {
|
||||||
TIXMLASSERT( _size < (size_t)(-1) );
|
TIXMLASSERT( _size < INT_MAX );
|
||||||
EnsureCapacity( _size+1 );
|
EnsureCapacity( _size+1 );
|
||||||
_mem[_size++] = t;
|
_mem[_size++] = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
T* PushArr( int count ) {
|
T* PushArr( int count ) {
|
||||||
TIXMLASSERT( count >= 0 );
|
TIXMLASSERT( count >= 0 );
|
||||||
TIXMLASSERT( _size <= (size_t)(-1) - count );
|
TIXMLASSERT( _size <= INT_MAX - count );
|
||||||
EnsureCapacity( _size+count );
|
EnsureCapacity( _size+count );
|
||||||
T* ret = &_mem[_size];
|
T* ret = &_mem[_size];
|
||||||
_size += count;
|
_size += count;
|
||||||
|
|
Loading…
Reference in New Issue