[libxslt] Fix extension callback signatures



commit 3bea417b5e7e417fdfed4b30448cd68b2a50fe49
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Wed Nov 29 16:12:36 2017 +0100

    Fix extension callback signatures

 libexslt/functions.c |   19 +++++++++++--------
 libexslt/saxon.c     |    9 +++++----
 python/libxslt.c     |    8 ++++----
 3 files changed, 20 insertions(+), 16 deletions(-)
---
diff --git a/libexslt/functions.c b/libexslt/functions.c
index 8835634..c93df26 100644
--- a/libexslt/functions.c
+++ b/libexslt/functions.c
@@ -142,7 +142,7 @@ exsltFuncRegisterImportFunc (void *payload, void *vctxt,
  *
  * Returns the data for this transformation
  */
-static exsltFuncData *
+static void *
 exsltFuncInit (xsltTransformContextPtr ctxt, const xmlChar *URI) {
     exsltFuncData *ret;
     xsltStylesheetPtr tmp;
@@ -187,7 +187,9 @@ exsltFuncInit (xsltTransformContextPtr ctxt, const xmlChar *URI) {
 static void
 exsltFuncShutdown (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
                   const xmlChar *URI ATTRIBUTE_UNUSED,
-                  exsltFuncData *data) {
+                  void *vdata) {
+    exsltFuncData *data = (exsltFuncData *) vdata;
+
     if (data->result != NULL)
        xmlXPathFreeObject(data->result);
     xmlFree(data);
@@ -203,7 +205,7 @@ exsltFuncShutdown (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
  *
  * Returns the allocated data
  */
-static xmlHashTablePtr
+static void *
 exsltFuncStyleInit (xsltStylesheetPtr style ATTRIBUTE_UNUSED,
                    const xmlChar *URI ATTRIBUTE_UNUSED) {
     return xmlHashCreate(1);
@@ -226,7 +228,8 @@ exsltFuncFreeDataEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
 static void
 exsltFuncStyleShutdown (xsltStylesheetPtr style ATTRIBUTE_UNUSED,
                        const xmlChar *URI ATTRIBUTE_UNUSED,
-                       xmlHashTablePtr data) {
+                       void *vdata) {
+    xmlHashTablePtr data = (xmlHashTablePtr) vdata;
     xmlHashFree(data, exsltFuncFreeDataEntry);
 }
 
@@ -792,10 +795,10 @@ exsltFuncResultElem (xsltTransformContextPtr ctxt,
 void
 exsltFuncRegister (void) {
     xsltRegisterExtModuleFull (EXSLT_FUNCTIONS_NAMESPACE,
-                      (xsltExtInitFunction) exsltFuncInit,
-                      (xsltExtShutdownFunction) exsltFuncShutdown,
-                      (xsltStyleExtInitFunction) exsltFuncStyleInit,
-                      (xsltStyleExtShutdownFunction) exsltFuncStyleShutdown);
+                      exsltFuncInit,
+                      exsltFuncShutdown,
+                      exsltFuncStyleInit,
+                      exsltFuncStyleShutdown);
 
     xsltRegisterExtModuleTopLevel ((const xmlChar *) "function",
                                   EXSLT_FUNCTIONS_NAMESPACE,
diff --git a/libexslt/saxon.c b/libexslt/saxon.c
index 3b218f9..00b74a4 100644
--- a/libexslt/saxon.c
+++ b/libexslt/saxon.c
@@ -29,7 +29,7 @@
  *
  * Returns the data for this transformation
  */
-static xmlHashTablePtr
+static void *
 exsltSaxonInit (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
                const xmlChar *URI ATTRIBUTE_UNUSED) {
     return xmlHashCreate(1);
@@ -52,7 +52,8 @@ exsltSaxonFreeCompExprEntry(void *payload,
 static void
 exsltSaxonShutdown (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
                    const xmlChar *URI ATTRIBUTE_UNUSED,
-                   xmlHashTablePtr data) {
+                   void *vdata) {
+    xmlHashTablePtr data = (xmlHashTablePtr) vdata;
     xmlHashFree(data, exsltSaxonFreeCompExprEntry);
 }
 
@@ -299,8 +300,8 @@ exsltSaxonLineNumberFunction(xmlXPathParserContextPtr ctxt, int nargs) {
 void
 exsltSaxonRegister (void) {
      xsltRegisterExtModule (SAXON_NAMESPACE,
-                           (xsltExtInitFunction) exsltSaxonInit,
-                           (xsltExtShutdownFunction) exsltSaxonShutdown);
+                           exsltSaxonInit,
+                           exsltSaxonShutdown);
      xsltRegisterExtModuleFunction((const xmlChar *) "expression",
                                   SAXON_NAMESPACE,
                                   exsltSaxonExpressionFunction);
diff --git a/python/libxslt.c b/python/libxslt.c
index b1fb18d..6db61c5 100644
--- a/python/libxslt.c
+++ b/python/libxslt.c
@@ -1127,10 +1127,10 @@ libxslt_xsltRegisterExtensionClass(PyObject *self ATTRIBUTE_UNUSED,
     Py_XINCREF(pyobj_c);
 
     ret = xsltRegisterExtModuleFull(ns_uri,
-       (xsltExtInitFunction) libxslt_xsltPythonExtModuleCtxtInit,
-       (xsltExtShutdownFunction) libxslt_xsltPythonExtModuleCtxtShutdown,
-       (xsltStyleExtInitFunction) libxslt_xsltPythonExtModuleStyleInit,
-       (xsltStyleExtShutdownFunction) libxslt_xsltPythonExtModuleStyleShutdown);
+       libxslt_xsltPythonExtModuleCtxtInit,
+       libxslt_xsltPythonExtModuleCtxtShutdown,
+       libxslt_xsltPythonExtModuleStyleInit,
+       libxslt_xsltPythonExtModuleStyleShutdown);
     py_retval = libxml_intWrap((int) ret);
     if (ret < 0) {
        Py_XDECREF(pyobj_c);


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