Prechádzať zdrojové kódy

fix const. hopefully.

Lee Thomason 9 rokov pred
rodič
commit
f458d265c1
2 zmenil súbory, kde vykonal 8 pridanie a 8 odobranie
  1. 6 6
      tinyxml2.cpp
  2. 2 2
      tinyxml2.h

+ 6 - 6
tinyxml2.cpp

@@ -368,22 +368,22 @@ const char* StrPair::GetStr()
 
 // --------- XMLUtil ----------- //
 
-char* XMLUtil::writeBoolTrue  = "true";
-char* XMLUtil::writeBoolFalse = "false";
+const char* XMLUtil::writeBoolTrue  = "true";
+const char* XMLUtil::writeBoolFalse = "false";
 
 void XMLUtil::SetBool(const char* writeTrue, const char* writeFalse)
 {
 	static const char* defTrue = "true";
 	static const char* defFalse = "false";
 	if (writeTrue)
-		writeBoolTrue = (char*) writeTrue;
+		writeBoolTrue = writeTrue;
 	else
-		writeBoolTrue = (char*) defTrue;
+		writeBoolTrue = defTrue;
 
 	if (writeFalse)
-		writeBoolFalse = (char*) writeFalse;
+		writeBoolFalse = writeFalse;
 	else
-		writeBoolFalse = (char*) defFalse;
+		writeBoolFalse = defFalse;
 }
 
 

+ 2 - 2
tinyxml2.h

@@ -616,8 +616,8 @@ public:
 	static void SetBool(const char* writeTrue, const char* writeFalse);
 
 private:
-	static char* writeBoolTrue;
-	static char* writeBoolFalse;
+	static const char* writeBoolTrue;
+	static const char* writeBoolFalse;
 };