You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2005/11/23 14:57:17 UTC

svn commit: r348441 - in /webservices/axis/trunk/c: src/soap/xsd/Double.cpp src/soap/xsd/Float.cpp tests/auto_build/testcases/client/cpp/XSD_float1Client.cpp tests/auto_build/testcases/client/cpp/XSD_floatClient.cpp

Author: prestonf
Date: Wed Nov 23 05:57:04 2005
New Revision: 348441

URL: http://svn.apache.org/viewcvs?rev=348441&view=rev
Log:
Fix for AXISCPP-838

Modified:
    webservices/axis/trunk/c/src/soap/xsd/Double.cpp
    webservices/axis/trunk/c/src/soap/xsd/Float.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_float1Client.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_floatClient.cpp

Modified: webservices/axis/trunk/c/src/soap/xsd/Double.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/soap/xsd/Double.cpp?rev=348441&r1=348440&r2=348441&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/xsd/Double.cpp (original)
+++ webservices/axis/trunk/c/src/soap/xsd/Double.cpp Wed Nov 23 05:57:04 2005
@@ -153,7 +153,7 @@
 
  
     AxisChar serializedValue[80];
-    AxisSprintf (serializedValue, 80, "%f", *value);
+    AxisSprintf (serializedValue, 80, "%.10g", *value);
 	
 	IAnySimpleType::serialize(serializedValue);
     return m_Buf;

Modified: webservices/axis/trunk/c/src/soap/xsd/Float.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/soap/xsd/Float.cpp?rev=348441&r1=348440&r2=348441&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/xsd/Float.cpp (original)
+++ webservices/axis/trunk/c/src/soap/xsd/Float.cpp Wed Nov 23 05:57:04 2005
@@ -148,7 +148,7 @@
     delete maxExclusive;
 
     AxisChar* serializedValue = new char[80];
-    AxisSprintf (serializedValue, 80, "%f", *value);
+    AxisSprintf (serializedValue, 80, "%.6g", *value);
   
     IAnySimpleType::serialize(serializedValue);
     delete [] serializedValue;        
@@ -161,7 +161,7 @@
 
 	xsd__float * value = new xsd__float;
 	*value = (xsd__float) strtod (valueAsChar, &end);
-	
+
 	return value;
 }
 

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_float1Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_float1Client.cpp?rev=348441&r1=348440&r2=348441&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_float1Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_float1Client.cpp Wed Nov 23 05:57:04 2005
@@ -37,7 +37,7 @@
 
 		// Test non-nillable element
        	        xsd__float result = ws->asNonNillableElement((xsd__float)555.555);
-		printf("non-nillable element=%.5f\n", result);
+		printf("non-nillable element=%.6g\n", result);
         	fflush(stdout);
 
 		// Tests now complete

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_floatClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_floatClient.cpp?rev=348441&r1=348440&r2=348441&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_floatClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_floatClient.cpp Wed Nov 23 05:57:04 2005
@@ -37,7 +37,7 @@
 
 		// Test non-nillable element
 	    xsd__float result = ws->asNonNillableElement((xsd__float)35.353588);
-		printf("non-nillable element=%.5f\n", result);
+		printf("non-nillable element=%.6g\n", result);
         fflush(stdout);
 
 		// Test nillable element, with a value
@@ -46,7 +46,7 @@
 		xsd__float* nillableResult = ws->asNillableElement(nillableInput);
 		if (nillableResult)
 		{
-			printf("nillable element=%.5f\n", *(nillableResult));
+			printf("nillable element=%.6g\n", *(nillableResult));
             fflush(stdout);
 			delete nillableResult;
 		}
@@ -60,7 +60,7 @@
         nillableResult = ws->asNillableElement(NULL);
 		if (nillableResult)
 		{
-			printf("nil element=%.5f\n", *(nillableResult));
+			printf("nil element=%.6g\n", *(nillableResult));
             fflush(stdout);
 			delete nillableResult;
 		}
@@ -73,7 +73,7 @@
 		RequiredAttributeElement requiredAttributeInput;
 		requiredAttributeInput.setrequiredAttribute((xsd__float)35.353588);
 		RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
-		printf("required attribute=%.5f\n", requiredAttributeResult->getrequiredAttribute());
+		printf("required attribute=%.6g\n", requiredAttributeResult->getrequiredAttribute());
         fflush(stdout);
 		delete requiredAttributeResult;
 
@@ -85,7 +85,7 @@
 		OptionalAttributeElement* optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
 		if (optionalAttributeResult->getoptionalAttribute())
 		{
-			printf("optional attribute, with data=%.5f\n", *(optionalAttributeResult->getoptionalAttribute()));
+			printf("optional attribute, with data=%.6g\n", *(optionalAttributeResult->getoptionalAttribute()));
             fflush(stdout);
 		}
 		else
@@ -99,7 +99,7 @@
 		optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
 		if (optionalAttributeResult->getoptionalAttribute())
 		{
-			printf("optional attribute, not present=%.5f\n", *(optionalAttributeResult->getoptionalAttribute()));
+			printf("optional attribute, not present=%.6g\n", *(optionalAttributeResult->getoptionalAttribute()));
             fflush(stdout);
 		}
 		else
@@ -125,7 +125,7 @@
         cout << "array of " << outputSize << " elements" << endl;
 		for (int index = 0; index < outputSize ; index++)
 		{
-			printf("  element[%i]=%.5f\n", index,  *(output[index]));
+			printf("  element[%i]=%.6g\n", index,  *(output[index]));
             fflush(stdout);
 			
 		}
@@ -140,7 +140,7 @@
 		SimpleComplexType complexTypeInput;
 		complexTypeInput.setcomplexTypeElement((xsd__float) 35.353588);
 		SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
-		printf("within complex type=%.5f\n", complexTypeResult->getcomplexTypeElement());
+		printf("within complex type=%.6g\n", complexTypeResult->getcomplexTypeElement());
         fflush(stdout);
 		delete complexTypeResult;