Fixed problem with cleanup of RVT's, should clear bug350085; cleaned up
authorWilliam M. Brack <wbrack@src.gnome.org>
Wed, 9 Aug 2006 18:22:39 +0000 (18:22 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Wed, 9 Aug 2006 18:22:39 +0000 (18:22 +0000)
* libxslt/transform.c: Fixed problem with cleanup of RVT's, should
  clear bug350085; cleaned up most warnings (still a problem in
  xsltShallowCopyNsNode)
* trivial warning cleanup in libxslt/[extensions.c, namespaces.c,
  xslt.c and xsltInternals.h] and libexslt/functions.c

ChangeLog
libexslt/functions.c
libxslt/extensions.c
libxslt/namespaces.c
libxslt/transform.c
libxslt/xslt.c
libxslt/xsltInternals.h

index d4fdded..8c460b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Aug  9 13:22:13 PDT 2006 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/transform.c: Fixed problem with cleanup of RVT's, should
+         clear bug350085; cleaned up most warnings (still a problem in
+         xsltShallowCopyNsNode)
+       * trivial warning cleanup in libxslt/[extensions.c, namespaces.c,
+         xslt.c and xsltInternals.h] and libexslt/functions.c
+
 Fri Aug  4 14:50:41 CEST 2006 Daniel Veillard <daniel@veillard.com>
 
        * python/generator.py: fixed the conversion of long parameters
index 2cf7249..bbeb182 100644 (file)
@@ -57,7 +57,7 @@ static void exsltFuncFunctionFunction (xmlXPathParserContextPtr ctxt,
                                       int nargs);
 static exsltFuncFunctionData *exsltFuncNewFunctionData(void);
 
-static const xmlChar *exsltResultDataID = (const xmlChar *) "EXSLT Result";
+/*static const xmlChar *exsltResultDataID = (const xmlChar *) "EXSLT Result";*/
 
 /**
  * exsltFuncRegisterFunc:
index b28ad6b..ddd5476 100644 (file)
@@ -324,7 +324,7 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI)
     const xmlChar *ext_directory = NULL;
     const xmlChar *protocol = NULL;
     xmlChar *i, *regfunc_name;
-    int rc, seen_before;
+    int rc;
 
     /* check for bad inputs */
     if (URI == NULL)
@@ -337,8 +337,7 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI)
     }
 
     /* have we attempted to register this module already? */
-    seen_before = (int) xmlHashLookup(xsltModuleHash, URI);
-    if (0 != seen_before) {
+    if (xmlHashLookup(xsltModuleHash, URI) != NULL) {
         return (-1);
     }
 
@@ -778,8 +777,9 @@ xsltStyleGetExtData(xsltStylesheetPtr style, const xmlChar * URI)
     return(NULL);
 }
 
+#ifdef XSLT_REFACTORED
 /**
- * xsltStyleGetExtDataPerStylesheetLevel:
+ * xsltStyleStylesheetLevelGetExtData:
  * @style: an XSLT stylesheet
  * @URI:  the URI associated to the exension module
  *
@@ -815,6 +815,7 @@ xsltStyleStylesheetLevelGetExtData(xsltStylesheetPtr style,
        return (dataContainer->extData);
     return(NULL);
 }
+#endif
 
 /**
  * xsltGetExtData:
index e27e0e5..a8ba8e2 100644 (file)
@@ -813,8 +813,8 @@ xsltCopyNamespaceList(xsltTransformContextPtr ctxt, xmlNodePtr node,
  * Returns: a new xmlNsPtr, or NULL in case of an error.
  */
 xmlNsPtr
-xsltCopyNamespace(xsltTransformContextPtr ctxt, xmlNodePtr elem,
-                 xmlNsPtr ns)
+xsltCopyNamespace(xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
+                 xmlNodePtr elem, xmlNsPtr ns)
 {    
     if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
        return(NULL);
index e9eda83..7594716 100644 (file)
@@ -1316,6 +1316,10 @@ xsltShallowCopyNsNode(xsltTransformContextPtr ctxt,
                      xmlNodePtr insert,
                      xmlNsPtr ns)
 {
+    /*
+     * TODO: Contrary to header comments, this is declared as int.  
+     * be modified to return a node pointer, or NULL if any error
+     */
     xmlNsPtr tmpns;
 
     if ((insert == NULL) || (insert->type != XML_ELEMENT_NODE))
@@ -3016,13 +3020,13 @@ xsltApplyXSLTTemplate(xsltTransformContextPtr ctxt,
     * was not called by the extension author.
     */
     if (oldLocalFragmentTop != ctxt->localRVT) {
-       xmlDocPtr cur = ctxt->localRVT, tmp;
+       xmlDocPtr curdoc = ctxt->localRVT, tmp;
 
        do {
-           tmp = cur;
-           cur = (xmlDocPtr) cur->next;
+           tmp = curdoc;
+           curdoc = (xmlDocPtr) curdoc->next;
            xsltReleaseRVT(ctxt, tmp);
-       } while (cur != oldLocalFragmentTop);
+       } while (curdoc != oldLocalFragmentTop);
     }
     ctxt->localRVT = oldLocalFragmentTop;
 
@@ -3033,11 +3037,11 @@ xsltApplyXSLTTemplate(xsltTransformContextPtr ctxt,
     * of the obsolete xsltRegisterTmpRVT().    
     */
     if (ctxt->tmpRVT) {
-       xmlDocPtr cur = ctxt->tmpRVT, tmp;
+       xmlDocPtr curdoc = ctxt->tmpRVT, tmp;
 
-       while (cur != NULL) {
-           tmp = cur;
-           cur = (xmlDocPtr) cur->next;
+       while (curdoc != NULL) {
+           tmp = curdoc;
+           curdoc = (xmlDocPtr) curdoc->next;
            xsltReleaseRVT(ctxt, tmp);
        }       
     }
@@ -6013,10 +6017,19 @@ xsltApplyStylesheetInternal(xsltStylesheetPtr style, xmlDocPtr doc,
         }
         vptr = vptr->next;
     }
+#if 0
+    /*
+     * code disabled by wmb; awaiting kb's review
+     * problem is that global variable(s) may contain xpath objects
+     * from doc associated with RVT, so can't be freed at this point.
+     * xsltFreeTransformContext includes a call to xsltFreeRVTs, so
+     * I assume this shouldn't be required at this point.
+     */
     /*
     * Free all remaining tree fragments.
     */
     xsltFreeRVTs(ctxt);
+#endif
     /*
      * Do some post processing work depending on the generated output
      */
index 650a2ca..5d39e86 100644 (file)
@@ -843,12 +843,13 @@ xsltFreeStylesheetList(xsltStylesheetPtr style) {
  * @node: the element where the stylesheet is rooted at
  *
  * Actually @node need not be the document-element, but
- * currently Libxslt does not support embedeed stylesheets.
+ * currently Libxslt does not support embedded stylesheets.
  *
  * Returns 0 if OK, -1 on API or internal errors.
  */
 static int
-xsltCleanupStylesheetTree(xmlDocPtr doc, xmlNodePtr rootElem)
+xsltCleanupStylesheetTree(xmlDocPtr doc ATTRIBUTE_UNUSED,
+                         xmlNodePtr rootElem ATTRIBUTE_UNUSED)
 {    
 #if 0 /* TODO: Currently disabled, since probably not needed. */
     xmlNodePtr cur;
index 62062c5..8b995c8 100644 (file)
@@ -389,15 +389,16 @@ typedef enum {
     XSLT_FUNC_PARAM,
     XSLT_FUNC_VARIABLE,
     XSLT_FUNC_WHEN,
-    XSLT_FUNC_EXTENSION,
+    XSLT_FUNC_EXTENSION
 #ifdef XSLT_REFACTORED
+    ,
     XSLT_FUNC_OTHERWISE,
     XSLT_FUNC_FALLBACK,
     XSLT_FUNC_MESSAGE,
     XSLT_FUNC_INCLUDE,
     XSLT_FUNC_ATTRSET,
     XSLT_FUNC_LITERAL_RESULT_ELEMENT,
-    XSLT_FUNC_UNKOWN_FORWARDS_COMPAT,
+    XSLT_FUNC_UNKOWN_FORWARDS_COMPAT
 #endif
 } xsltStyleType;