diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 0619bdf..f2f5c75 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -2302,11 +2302,11 @@ bool XMLPrinter::VisitEnter( const XMLDocument& doc ) bool XMLPrinter::VisitEnter( const XMLElement& element, const XMLAttribute* attribute ) { - const XMLElement* parentElem = NULL; - if ( element.Parent() ) { - parentElem = element.Parent()->ToElement(); + const XMLElement* parentElem = 0; + if ( element.Parent() ) { + parentElem = element.Parent()->ToElement(); } - bool compactMode = parentElem ? CompactMode(*parentElem) : _compactMode; + const bool compactMode = parentElem ? CompactMode( *parentElem ) : _compactMode; OpenElement( element.Name(), compactMode ); while ( attribute ) { PushAttribute( attribute->Name(), attribute->Value() );