From e503563f479f72b0c32c8378abb0dac1f8619f71 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 5 Apr 2017 18:02:40 +0300 Subject: [PATCH] Fully use enum --- tinyxml2.cpp | 4 ++-- tinyxml2.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index a645c57..0d6e2bc 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1449,7 +1449,7 @@ void XMLAttribute::SetAttribute( float v ) // --------- XMLElement ---------- // XMLElement::XMLElement( XMLDocument* doc ) : XMLNode( doc ), - _closingType( 0 ), + _closingType( OPEN ), _rootAttribute( 0 ) { } @@ -1868,7 +1868,7 @@ char* XMLElement::ParseDeep( char* p, StrPair* strPair, int* curLineNumPtr ) } p = ParseAttributes( p, curLineNumPtr ); - if ( !p || !*p || _closingType ) { + if ( !p || !*p || _closingType != OPEN ) { return p; } diff --git a/tinyxml2.h b/tinyxml2.h index bfd2204..17e576a 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -1559,12 +1559,12 @@ public: float FloatText(float defaultValue = 0) const; // internal: - enum { + enum ElementClosingType { OPEN, // CLOSED, // CLOSING // }; - int ClosingType() const { + ElementClosingType ClosingType() const { return _closingType; } virtual XMLNode* ShallowClone( XMLDocument* document ) const; @@ -1589,7 +1589,7 @@ private: XMLAttribute* CreateAttribute(); enum { BUF_SIZE = 200 }; - int _closingType; + ElementClosingType _closingType; // The attribute list is ordered; there is no 'lastAttribute' // because the list needs to be scanned for dupes before adding // a new attribute.