fix compiler warning (XCode 4.6.1 x86_64) tinyxml2.cpp:2146:77: Implicit conversion loses integer precision: 'const size_t' (aka 'const unsigned long') to 'const int'

This commit is contained in:
Ross Bencina 2015-07-22 16:58:05 +10:00
parent eb89ef6f0d
commit e7fa0e159e
1 changed files with 1 additions and 1 deletions

View File

@ -2143,7 +2143,7 @@ void XMLPrinter::PrintString( const char* p, bool restricted )
while ( p < q ) {
const size_t delta = q - p;
// %.*s accepts type int as "precision"
const int toPrint = ( INT_MAX < delta ) ? INT_MAX : delta;
const int toPrint = ( INT_MAX < delta ) ? INT_MAX : (int)delta;
Print( "%.*s", toPrint, p );
p += toPrint;
}