axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dimu...@apache.org
Subject svn commit: r741839 - in /webservices/axis2/trunk/java/modules: adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl
Date Sat, 07 Feb 2009 04:13:25 GMT
Author: dimuthu
Date: Sat Feb  7 04:13:24 2009
New Revision: 741839

URL: http://svn.apache.org/viewvc?rev=741839&view=rev
Log:
fixing c generated code compile warining + memory leeek in uwrapped mode for string

Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl?rev=741839&r1=741838&r2=741839&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl
Sat Feb  7 04:13:24 2009
@@ -1451,7 +1451,7 @@
                                       if(text_value != NULL)
                                       {
                                             prefix_found = AXIS2_FALSE;
-                                            for(cp = text_value; *cp; cp ++)
+                                            for(cp = (axis2_char_t*)text_value; *cp; cp ++)
                                             {
                                                 if(*cp == ':')
                                                 {
@@ -1470,7 +1470,7 @@
                                             else
                                             {
                                                 /* Then it is the default namespace */
-                                                cp = text_value;
+                                                cp = (axis2_char_t*)text_value;
                                                 qname_ns = axiom_element_get_default_namespace(current_element,
env, current_node);
                                             }
                                           
@@ -1883,7 +1883,7 @@
                                           if(text_value != NULL)
                                           {
                                               prefix_found = AXIS2_FALSE;
-                                              for(cp = text_value; *cp; cp ++)
+                                              for(cp = (axis2_char_t*)text_value; *cp; cp
++)
                                               {
                                                   if(*cp == ':')
                                                   {
@@ -1902,7 +1902,7 @@
                                               else
                                               {
                                                   /* Then it is the default namespace */
-                                                  cp = text_value;
+                                                  cp = (axis2_char_t*)text_value;
                                                   qname_ns = axiom_element_get_default_namespace(current_element,
env, current_node);
                                               }
                                               
@@ -2375,7 +2375,7 @@
                                           if(text_value != NULL)
                                           {
                                             prefix_found = AXIS2_FALSE;
-                                            for(cp = text_value; *cp; cp ++)
+                                            for(cp = (axis2_char_t*)text_value; *cp; cp ++)
                                             {
                                                 if(*cp == ':')
                                                 {
@@ -2394,7 +2394,7 @@
                                             else
                                             {
                                                 /* Then it is the default namespace */
-                                                cp = text_value;
+                                                cp = (axis2_char_t*)text_value;
                                                 qname_ns = axiom_element_get_default_namespace(current_element,
env, current_node);
                                             }
                                           

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl?rev=741839&r1=741838&r2=741839&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl
Sat Feb  7 04:13:24 2009
@@ -185,11 +185,12 @@
 
 
 
-     /**
-      * function to free any soap input headers
-      */
      <xsl:for-each select="method">
         <xsl:if test="input/param[@location='soap_header']">
+
+         /**
+          * function to free soap input headers
+          */
          void
          axis2_skel_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="@name"/>_free_input_headers(const
axutil_env_t *env, <xsl:for-each select="input/param[@location='soap_header']"><xsl:if
test="position()!=1">,</xsl:if>
                                                  <xsl:variable name="inputtype"><xsl:value-of
select="@type"/></xsl:variable>
@@ -216,11 +217,12 @@
 
 
 
-     /**
-      * function to free any soap output headers
-      */
      <xsl:for-each select="method">
         <xsl:if test="output/param[@location='soap_header']">
+
+         /**
+          * function to free any soap output headers
+          */
          void
          axis2_skel_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="@name"/>_free_output_headers(const
axutil_env_t *env, <xsl:for-each select="output/param[@location='soap_header']"><xsl:if
test="position()!=1">,</xsl:if>
                                                  <xsl:variable name="outputtype"><xsl:value-of
select="@type"/></xsl:variable>
@@ -545,6 +547,16 @@
                                     ret_val<xsl:value-of select="$position"/> = <xsl:value-of
select="substring-before(output/param/@type, '_t*')"/>_create_with_values(env, ret_unwrapped);
                                 </xsl:otherwise>
                             </xsl:choose>
+                            
+                            <!-- if the output type is a string, we have to free it, just
since user don't have a way to free it, and the wrapper
+                                 keep a deep copy of the string,-->
+                            <xsl:if test="axis2_char_t*">
+                                if(ret_unwrapped)
+                                {
+                                    /* we are freeing this for the user */
+                                    AXIS2_FREE(env->allocator, ret_unwrapped);
+                                }
+                            </xsl:if>
                         }
                     </xsl:when>
                     <xsl:otherwise>



Mime
View raw message