axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r312790 - /webservices/axis/trunk/c/src/soap/xsd/NonNegativeInteger.cpp
Date Tue, 11 Oct 2005 03:10:25 GMT
Author: nadiramra
Date: Mon Oct 10 20:10:23 2005
New Revision: 312790

URL: http://svn.apache.org/viewcvs?rev=312790&view=rev
Log:
NonNegativeInteger should not be calling Integer for deserialization.

Reason being the Integer uses a signed variable to hold the calculated
value, which will not hold an unsigned value. 

Modified:
    webservices/axis/trunk/c/src/soap/xsd/NonNegativeInteger.cpp

Modified: webservices/axis/trunk/c/src/soap/xsd/NonNegativeInteger.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/soap/xsd/NonNegativeInteger.cpp?rev=312790&r1=312789&r2=312790&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/xsd/NonNegativeInteger.cpp (original)
+++ webservices/axis/trunk/c/src/soap/xsd/NonNegativeInteger.cpp Mon Oct 10 20:10:23 2005
@@ -174,11 +174,23 @@
 
 xsd__nonNegativeInteger* NonNegativeInteger::deserializeNonNegativeInteger(const AxisChar*
valueAsChar) throw (AxisSoapException)
 {
-    xsd__integer* returnValue = Integer::deserializeInteger(valueAsChar);
+    xsd__nonNegativeInteger * value = new xsd__nonNegativeInteger;
+    *value = 0;
+    AxisChar currentNumber[] = {'\0', '\0'};
+    int stringLength = strlen(valueAsChar);
+    
+    if (stringLength > 0)
+    {
+        int count = 0;
+        
+        for ( ; count < stringLength ;  count ++)
+        {
+            *value *= 10;
+    		currentNumber[0] = valueAsChar[count];
+            *value += atoi(currentNumber);
+        }
+    }
 
-    xsd__nonNegativeInteger * value = new xsd__nonNegativeInteger; 
-    *value = static_cast<xsd__nonNegativeInteger> (*returnValue);
-    delete returnValue;
     return value;
 }
 



Mime
View raw message