axis-c-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r927242 - in /axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c: BeanParamWriter.java ParmHeaderFileWriter.java
Date Thu, 25 Mar 2010 00:36:20 GMT
Author: nadiramra
Date: Thu Mar 25 00:36:19 2010
New Revision: 927242

URL: http://svn.apache.org/viewvc?rev=927242&view=rev
Log:
Handle C types with no attributes or elements.

Modified:
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java?rev=927242&r1=927241&r2=927242&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java Thu Mar
25 00:36:19 2010
@@ -803,9 +803,13 @@ public class BeanParamWriter extends Par
         c_writer.write("\t}\n");
         c_writer.write("\telse\n"); 
         c_writer.write("\t{\n");        
-        
-        c_writer.write("\t\t" + c_classname + "* pTemp = (" + c_classname + " *)malloc(sizeof("
+ c_classname + "));\n");
-        c_writer.write("\t\tmemset(pTemp, 0, sizeof(" + c_classname + "));\n");
+        if (attribs.length == 0)
+            c_writer.write("\t\t" + c_classname + "* pTemp = (" + c_classname + " *)NULL;\n");
+        else
+        {
+            c_writer.write("\t\t" + c_classname + "* pTemp = (" + c_classname + " *)malloc(sizeof("
+ c_classname + "));\n");
+            c_writer.write("\t\tmemset(pTemp, 0, sizeof(" + c_classname + "));\n");
+        }
         c_writer.write("\n");
         
         boolean writeNewline = false;

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java?rev=927242&r1=927241&r2=927242&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java Thu
Mar 25 00:36:19 2010
@@ -72,9 +72,18 @@ public class ParmHeaderFileWriter extend
                 c_writer.write("/* *********************************************************************
*/\n");
                 c_writer.write("\n");                
                 
-                c_writer.write("typedef struct " + c_classname + "Tag {\n");
-                writeAttributes();
-                c_writer.write("} " + c_classname + ";\n\n");
+                // If no attributes or elements just do forward reference.
+                if (attribs.length == 0)
+                {
+                    c_writer.write("/* Forward reference - type with no elements or arributes
*/\n");
+                    c_writer.write("typedef struct " + c_classname + "Tag " + c_classname
+ ";\n\n");
+                }
+                else
+                {
+                    c_writer.write("typedef struct " + c_classname + "Tag {\n");
+                    writeAttributes();
+                    c_writer.write("} " + c_classname + ";\n\n");
+                }
                 
                 writeFunctionPrototypes();
                 c_writer.write("\n#ifdef __cplusplus\n }\n#endif\n");



Mime
View raw message