Merge pull request #475 from Dmitry-Me/splitAccessAndAdjustment
Split access and pointer adjustment
diff --git a/tinyxml2.cpp b/tinyxml2.cpp
index 9a8904f..9d74681 100755
--- a/tinyxml2.cpp
+++ b/tinyxml2.cpp
@@ -281,7 +281,8 @@
else {
++p;
}
- *q++ = LF;
+ *q = LF;
+ ++q;
}
else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) {
if ( *(p+1) == CR ) {
@@ -290,7 +291,8 @@
else {
++p;
}
- *q++ = LF;
+ *q = LF;
+ ++q;
}
else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) {
// Entities handled by tinyXML2:
diff --git a/tinyxml2.h b/tinyxml2.h
index 4379f01..0b5e3cc 100755
--- a/tinyxml2.h
+++ b/tinyxml2.h
@@ -211,7 +211,8 @@
void Push( T t ) {
TIXMLASSERT( _size < INT_MAX );
EnsureCapacity( _size+1 );
- _mem[_size++] = t;
+ _mem[_size] = t;
+ ++_size;
}
T* PushArr( int count ) {
@@ -225,7 +226,8 @@
T Pop() {
TIXMLASSERT( _size > 0 );
- return _mem[--_size];
+ --_size;
+ return _mem[_size];
}
void PopArr( int count ) {