Split access and pointer adjustment

This commit is contained in:
Dmitry-Me 2016-09-06 18:08:55 +03:00
parent 584af57086
commit fed511276f
2 changed files with 8 additions and 4 deletions

View File

@ -281,7 +281,8 @@ const char* StrPair::GetStr()
else { else {
++p; ++p;
} }
*q++ = LF; *q = LF;
++q;
} }
else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) { else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) {
if ( *(p+1) == CR ) { if ( *(p+1) == CR ) {
@ -290,7 +291,8 @@ const char* StrPair::GetStr()
else { else {
++p; ++p;
} }
*q++ = LF; *q = LF;
++q;
} }
else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) { else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) {
// Entities handled by tinyXML2: // Entities handled by tinyXML2:

View File

@ -211,7 +211,8 @@ public:
void Push( T t ) { void Push( T t ) {
TIXMLASSERT( _size < INT_MAX ); TIXMLASSERT( _size < INT_MAX );
EnsureCapacity( _size+1 ); EnsureCapacity( _size+1 );
_mem[_size++] = t; _mem[_size] = t;
++_size;
} }
T* PushArr( int count ) { T* PushArr( int count ) {
@ -225,7 +226,8 @@ public:
T Pop() { T Pop() {
TIXMLASSERT( _size > 0 ); TIXMLASSERT( _size > 0 );
return _mem[--_size]; --_size;
return _mem[_size];
} }
void PopArr( int count ) { void PopArr( int count ) {