Skip to content

Commit 0445585

Browse files
committed
Updated TinyXML
1 parent 2ba3e6d commit 0445585

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎externals/tinyxml/tinyxml2.cpp‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ distribution.
4141
const char *format [,
4242
argument] ...
4343
);*/
44-
inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )
44+
static inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )
4545
{
4646
va_list va;
4747
va_start( va, format );
@@ -50,7 +50,7 @@ distribution.
5050
return result;
5151
}
5252

53-
inline int TIXML_VSNPRINTF( char* buffer, size_t size, const char* format, va_list va )
53+
static inline int TIXML_VSNPRINTF( char* buffer, size_t size, const char* format, va_list va )
5454
{
5555
int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va );
5656
return result;
@@ -68,7 +68,7 @@ distribution.
6868
#define TIXML_VSCPRINTF _vscprintf // VS2003's C runtime has this, but VC6 C runtime or WinCE SDK doesn't have.
6969
#else
7070
// Microsoft Visual Studio 2003 and earlier or WinCE.
71-
inline int TIXML_VSCPRINTF( const char* format, va_list va )
71+
static inline int TIXML_VSCPRINTF( const char* format, va_list va )
7272
{
7373
int len = 512;
7474
for (;;) {
@@ -91,7 +91,7 @@ distribution.
9191
//#warning( "Using sn* functions." )
9292
#define TIXML_SNPRINTF snprintf
9393
#define TIXML_VSNPRINTF vsnprintf
94-
inline int TIXML_VSCPRINTF( const char* format, va_list va )
94+
static inline int TIXML_VSCPRINTF( const char* format, va_list va )
9595
{
9696
int len = vsnprintf( 0, 0, format, va );
9797
TIXMLASSERT( len >= 0 );
@@ -179,6 +179,7 @@ void StrPair::SetStr( const char* str, int flags )
179179
{
180180
Reset();
181181
size_t len = strlen( str );
182+
TIXMLASSERT( _start == 0 );
182183
_start = new char[ len+1 ];
183184
memcpy( _start, str, len+1 );
184185
_end = _start + len;
@@ -1944,6 +1945,7 @@ XMLError XMLDocument::LoadFile( FILE* fp )
19441945
}
19451946

19461947
const size_t size = filelength;
1948+
TIXMLASSERT( _charBuffer == 0 );
19471949
_charBuffer = new char[size+1];
19481950
size_t read = fread( _charBuffer, 1, size, fp );
19491951
if ( read != size ) {
@@ -1993,6 +1995,7 @@ XMLError XMLDocument::Parse( const char* p, size_t len )
19931995
if ( len == (size_t)(-1) ) {
19941996
len = strlen( p );
19951997
}
1998+
TIXMLASSERT( _charBuffer == 0 );
19961999
_charBuffer = new char[ len+1 ];
19972000
memcpy( _charBuffer, p, len );
19982001
_charBuffer[len] = 0;

0 commit comments

Comments
 (0)