فهرست منبع

experimented with print f vs. g. increased version

Lee Thomason (grinliz) 13 سال پیش
والد
کامیت
fc6320e30a
5فایلهای تغییر یافته به همراه18 افزوده شده و 7 حذف شده
  1. 2 2
      CMakeLists.txt
  2. 1 1
      dox
  3. 2 2
      tinyxml2.cpp
  4. 1 1
      tinyxml2.h
  5. 12 1
      xmltest.cpp

+ 2 - 2
CMakeLists.txt

@@ -10,8 +10,8 @@ include(GNUInstallDirs)
 ################################
 # set lib version here
 
-set(GENERIC_LIB_VERSION "1.0.7")
-set(GENERIC_LIB_SOVERSION "1")
+set(GENERIC_LIB_VERSION "1.0.8")
+set(GENERIC_LIB_SOVERSION "1")
 
 
 ################################

+ 1 - 1
dox

@@ -32,7 +32,7 @@ PROJECT_NAME           = "TinyXML-2"
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER = 1.0.7
+PROJECT_NUMBER = 1.0.8
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer

+ 2 - 2
tinyxml2.cpp

@@ -416,13 +416,13 @@ void XMLUtil::ToStr( bool v, char* buffer, int bufferSize )
 
 void XMLUtil::ToStr( float v, char* buffer, int bufferSize )
 {
-	TIXML_SNPRINTF( buffer, bufferSize, "%f", v );
+	TIXML_SNPRINTF( buffer, bufferSize, "%g", v );
 }
 
 
 void XMLUtil::ToStr( double v, char* buffer, int bufferSize )
 {
-	TIXML_SNPRINTF( buffer, bufferSize, "%f", v );
+	TIXML_SNPRINTF( buffer, bufferSize, "%g", v );
 }
 
 

+ 1 - 1
tinyxml2.h

@@ -95,7 +95,7 @@ distribution.
 
 static const int TIXML2_MAJOR_VERSION = 1;
 static const int TIXML2_MINOR_VERSION = 0;
-static const int TIXML2_PATCH_VERSION = 7;
+static const int TIXML2_PATCH_VERSION = 8;
 
 namespace tinyxml2
 {

+ 12 - 1
xmltest.cpp

@@ -951,7 +951,6 @@ int main( int /*argc*/, const char ** /*argv*/ )
 		const char* xml = "<element/>WOA THIS ISN'T GOING TO PARSE";
 		XMLDocument doc;
 		doc.Parse( xml, 10 );
-		//doc.Print();
 		XMLTest( "Set length of incoming data", doc.Error(), false );
 	}
 
@@ -981,6 +980,18 @@ int main( int /*argc*/, const char ** /*argv*/ )
 		XMLTest( "Whitespace  all space", true, 0 == doc.FirstChildElement()->FirstChild() );
 	}
 
+#if 0		// the question being explored is what kind of print to use: 
+			// https://github.com/leethomason/tinyxml2/issues/63
+	{
+		const char* xml = "<element attrA='123456789.123456789' attrB='1.001e9'/>";
+		XMLDocument doc;
+		doc.Parse( xml );
+		doc.FirstChildElement()->SetAttribute( "attrA", 123456789.123456789 );
+		doc.FirstChildElement()->SetAttribute( "attrB", 1.001e9 );
+		doc.Print();
+	}
+#endif
+
 	// ----------- Performance tracking --------------
 	{
 #if defined( _MSC_VER )