You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pr...@apache.org on 2006/04/20 11:44:17 UTC

svn commit: r395544 - /webservices/axis/trunk/c/tests/auto_build/testcases/server/cpp/ComplexTypeWithNillableSimpleElement.cpp

Author: prestonf
Date: Thu Apr 20 02:44:15 2006
New Revision: 395544

URL: http://svn.apache.org/viewcvs?rev=395544&view=rev
Log:
AIX does not support itoa or strrev.  Thus these two functions have had to be replaced for a non WIN32 environment.

Modified:
    webservices/axis/trunk/c/tests/auto_build/testcases/server/cpp/ComplexTypeWithNillableSimpleElement.cpp

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/server/cpp/ComplexTypeWithNillableSimpleElement.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/server/cpp/ComplexTypeWithNillableSimpleElement.cpp?rev=395544&r1=395543&r2=395544&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/server/cpp/ComplexTypeWithNillableSimpleElement.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/server/cpp/ComplexTypeWithNillableSimpleElement.cpp Thu Apr 20 02:44:15 2006
@@ -19,7 +19,7 @@
  */
 
 #include "ComplexTypeWithNillableSimpleElement.hpp"
-
+#include <stdio.h>
 
 ComplexTypeWithNillableSimpleElement::ComplexTypeWithNillableSimpleElement()
 {
@@ -40,10 +40,28 @@
 {
 	int number=*(Value0->complexTypeElement);
 	char *ptr = new char[10];
+	int iSign = (number > 0 ? 1 : -1);
+#ifdef WIN32
 	ptr=itoa(number,ptr,10);
 	ptr=strrev(ptr);
-	number=atoi(ptr);
+#else
+	sprintf( ptr, "%d", number);
+
+	int	iNumberLength = (int) strlen( ptr);
+
+	if( iNumberLength > 1)
+	{
+		for( number = 0; number < iNumberLength / 2; number++)
+		{
+			char cSwap = ptr[number];
+			ptr[number] = ptr[iNumberLength - number - 1];
+			ptr[iNumberLength - number - 1] = cSwap;
+		}
+	}
+#endif
+	number=atoi(ptr) * iSign;
 	*Value0->complexTypeElement=number;
 	return Value0;
 }
+