Parcourir la source

Merge pull request #762 from orbitcowboy/master

Improved const correctness. There are no functional changes intended.
Lee Thomason il y a 6 ans
Parent
commit
f4520c9905
2 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 1 1
      tinyxml2.cpp
  2. 3 3
      tinyxml2.h

+ 1 - 1
tinyxml2.cpp

@@ -2101,7 +2101,7 @@ XMLDocument::~XMLDocument()
 }
 }
 
 
 
 
-void XMLDocument::MarkInUse(XMLNode* node)
+void XMLDocument::MarkInUse(const XMLNode* const node)
 {
 {
 	TIXMLASSERT(node);
 	TIXMLASSERT(node);
 	TIXMLASSERT(node->_parent == 0);
 	TIXMLASSERT(node->_parent == 0);

+ 3 - 3
tinyxml2.h

@@ -562,7 +562,7 @@ public:
         TIXMLASSERT( p );
         TIXMLASSERT( p );
         return p;
         return p;
     }
     }
-    static char* SkipWhiteSpace( char* p, int* curLineNumPtr )				{
+    static char* SkipWhiteSpace( char* const p, int* curLineNumPtr ) {
         return const_cast<char*>( SkipWhiteSpace( const_cast<const char*>(p), curLineNumPtr ) );
         return const_cast<char*>( SkipWhiteSpace( const_cast<const char*>(p), curLineNumPtr ) );
     }
     }
 
 
@@ -600,7 +600,7 @@ public:
         return strncmp( p, q, nChar ) == 0;
         return strncmp( p, q, nChar ) == 0;
     }
     }
 
 
-    inline static bool IsUTF8Continuation( char p ) {
+    inline static bool IsUTF8Continuation( const char p ) {
         return ( p & 0x80 ) != 0;
         return ( p & 0x80 ) != 0;
     }
     }
 
 
@@ -1894,7 +1894,7 @@ public:
     char* Identify( char* p, XMLNode** node );
     char* Identify( char* p, XMLNode** node );
 
 
 	// internal
 	// internal
-	void MarkInUse(XMLNode*);
+	void MarkInUse(const XMLNode* const);
 
 
     virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const	{
     virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const	{
         return 0;
         return 0;