[libxslt] Fix deallocator signatures



commit 6a822a2c1a8d8a917ba4898ec65bfa90a4d42d54
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Wed Nov 29 16:04:25 2017 +0100

    Fix deallocator signatures

 libexslt/functions.c |    6 ++++--
 libxslt/extensions.c |    8 ++++++--
 libxslt/pattern.c    |    7 ++++++-
 3 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/libexslt/functions.c b/libexslt/functions.c
index 1711ca1..8835634 100644
--- a/libexslt/functions.c
+++ b/libexslt/functions.c
@@ -262,7 +262,9 @@ exsltFuncNewFunctionData (void) {
  * Deallocates an #exsltFuncResultPreComp
  */
 static void
-exsltFreeFuncResultPreComp (exsltFuncResultPreComp *comp) {
+exsltFreeFuncResultPreComp (xsltElemPreCompPtr ecomp) {
+    exsltFuncResultPreComp *comp = (exsltFuncResultPreComp *) ecomp;
+
     if (comp == NULL)
        return;
 
@@ -648,7 +650,7 @@ exsltFuncResultComp (xsltStylesheetPtr style, xmlNodePtr inst,
     memset(ret, 0, sizeof(exsltFuncResultPreComp));
 
     xsltInitElemPreComp ((xsltElemPreCompPtr) ret, style, inst, function,
-                (xsltElemPreCompDeallocator) exsltFreeFuncResultPreComp);
+                exsltFreeFuncResultPreComp);
     ret->select = NULL;
 
     /*
diff --git a/libxslt/extensions.c b/libxslt/extensions.c
index b38f018..26f9ad0 100644
--- a/libxslt/extensions.c
+++ b/libxslt/extensions.c
@@ -1501,6 +1501,11 @@ xsltUnregisterAllExtModuleFunction(void)
 }
 
 
+static void
+xsltFreeElemPreComp(xsltElemPreCompPtr comp) {
+    xmlFree(comp);
+}
+
 /**
  * xsltNewElemPreComp:
  * @style:  the XSLT stylesheet
@@ -1525,8 +1530,7 @@ xsltNewElemPreComp(xsltStylesheetPtr style, xmlNodePtr inst,
     }
     memset(cur, 0, sizeof(xsltElemPreComp));
 
-    xsltInitElemPreComp(cur, style, inst, function,
-                        (xsltElemPreCompDeallocator) xmlFree);
+    xsltInitElemPreComp(cur, style, inst, function, xsltFreeElemPreComp);
 
     return (cur);
 }
diff --git a/libxslt/pattern.c b/libxslt/pattern.c
index 9a97070..07f11f9 100644
--- a/libxslt/pattern.c
+++ b/libxslt/pattern.c
@@ -519,6 +519,11 @@ xsltPatPushState(xsltTransformContextPtr ctxt, xsltStepStates *states,
     return(0);
 }
 
+static void
+xmlXPathFreeObjectWrapper(void *obj) {
+    xmlXPathFreeObject((xmlXPathObjectPtr) obj);
+}
+
 /**
  * xsltTestCompMatchDirect:
  * @ctxt:  a XSLT process context
@@ -604,7 +609,7 @@ xsltTestCompMatchDirect(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp,
            XSLT_RUNTIME_EXTRA(ctxt, sel->indexExtra, ival) =
                0;
            XSLT_RUNTIME_EXTRA_FREE(ctxt, sel->lenExtra) =
-               (xmlFreeFunc) xmlXPathFreeObject;
+               xmlXPathFreeObjectWrapper;
        } else
            list = newlist;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]