[libxml2] Remove unneeded function pointer casts



commit dcae579eca047affba1f5daef98b11b9593388db
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Tue Jan 1 16:48:40 2019 +0100

    Remove unneeded function pointer casts

 runsuite.c | 37 +++++++++++--------------------------
 runtest.c  | 20 ++++----------------
 2 files changed, 15 insertions(+), 42 deletions(-)
---
diff --git a/runsuite.c b/runsuite.c
index aaab13e1..767455bd 100644
--- a/runsuite.c
+++ b/runsuite.c
@@ -327,10 +327,8 @@ xsdIncorectTestCase(xmlNodePtr cur) {
     }
     xmlNodeDump(buf, test->doc, test, 0, 0);
     pctxt = xmlRelaxNGNewMemParserCtxt((const char *)buf->content, buf->use);
-    xmlRelaxNGSetParserErrors(pctxt,
-         (xmlRelaxNGValidityErrorFunc) testErrorHandler,
-         (xmlRelaxNGValidityWarningFunc) testErrorHandler,
-        pctxt);
+    xmlRelaxNGSetParserErrors(pctxt, testErrorHandler, testErrorHandler,
+            pctxt);
     rng = xmlRelaxNGParse(pctxt);
     xmlRelaxNGFreeParserCtxt(pctxt);
     if (rng != NULL) {
@@ -462,10 +460,8 @@ xsdTestCase(xmlNodePtr tst) {
     }
     xmlNodeDump(buf, test->doc, test, 0, 0);
     pctxt = xmlRelaxNGNewMemParserCtxt((const char *)buf->content, buf->use);
-    xmlRelaxNGSetParserErrors(pctxt,
-         (xmlRelaxNGValidityErrorFunc) testErrorHandler,
-         (xmlRelaxNGValidityWarningFunc) testErrorHandler,
-        pctxt);
+    xmlRelaxNGSetParserErrors(pctxt, testErrorHandler, testErrorHandler,
+            pctxt);
     rng = xmlRelaxNGParse(pctxt);
     xmlRelaxNGFreeParserCtxt(pctxt);
     if (extraMemoryFromResolver)
@@ -510,9 +506,7 @@ xsdTestCase(xmlNodePtr tst) {
                nb_tests++;
                ctxt = xmlRelaxNGNewValidCtxt(rng);
                xmlRelaxNGSetValidErrors(ctxt,
-                    (xmlRelaxNGValidityErrorFunc) testErrorHandler,
-                    (xmlRelaxNGValidityWarningFunc) testErrorHandler,
-                    ctxt);
+                        testErrorHandler, testErrorHandler, ctxt);
                ret = xmlRelaxNGValidateDoc(ctxt, doc);
                xmlRelaxNGFreeValidCtxt(ctxt);
                if (ret > 0) {
@@ -567,9 +561,7 @@ xsdTestCase(xmlNodePtr tst) {
                nb_tests++;
                ctxt = xmlRelaxNGNewValidCtxt(rng);
                xmlRelaxNGSetValidErrors(ctxt,
-                    (xmlRelaxNGValidityErrorFunc) testErrorHandler,
-                    (xmlRelaxNGValidityWarningFunc) testErrorHandler,
-                    ctxt);
+                        testErrorHandler, testErrorHandler, ctxt);
                ret = xmlRelaxNGValidateDoc(ctxt, doc);
                xmlRelaxNGFreeValidCtxt(ctxt);
                if (ret == 0) {
@@ -825,10 +817,7 @@ xstcTestInstance(xmlNodePtr cur, xmlSchemaPtr schemas,
     }
 
     ctxt = xmlSchemaNewValidCtxt(schemas);
-    xmlSchemaSetValidErrors(ctxt,
-         (xmlSchemaValidityErrorFunc) testErrorHandler,
-         (xmlSchemaValidityWarningFunc) testErrorHandler,
-        ctxt);
+    xmlSchemaSetValidErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
     ret = xmlSchemaValidateDoc(ctxt, doc);
 
     if (xmlStrEqual(validity, BAD_CAST "valid")) {
@@ -916,10 +905,8 @@ xstcTestGroup(xmlNodePtr cur, const char *base) {
     if (xmlStrEqual(validity, BAD_CAST "valid")) {
         nb_schematas++;
        ctxt = xmlSchemaNewParserCtxt((const char *) path);
-       xmlSchemaSetParserErrors(ctxt,
-            (xmlSchemaValidityErrorFunc) testErrorHandler,
-            (xmlSchemaValidityWarningFunc) testErrorHandler,
-            ctxt);
+       xmlSchemaSetParserErrors(ctxt, testErrorHandler, testErrorHandler,
+                ctxt);
        schemas = xmlSchemaParse(ctxt);
        xmlSchemaFreeParserCtxt(ctxt);
        if (schemas == NULL) {
@@ -952,10 +939,8 @@ xstcTestGroup(xmlNodePtr cur, const char *base) {
     } else if (xmlStrEqual(validity, BAD_CAST "invalid")) {
         nb_schematas++;
        ctxt = xmlSchemaNewParserCtxt((const char *) path);
-       xmlSchemaSetParserErrors(ctxt,
-            (xmlSchemaValidityErrorFunc) testErrorHandler,
-            (xmlSchemaValidityWarningFunc) testErrorHandler,
-            ctxt);
+       xmlSchemaSetParserErrors(ctxt, testErrorHandler, testErrorHandler,
+                ctxt);
        schemas = xmlSchemaParse(ctxt);
        xmlSchemaFreeParserCtxt(ctxt);
        if (schemas != NULL) {
diff --git a/runtest.c b/runtest.c
index 80e498c7..b1c30d85 100644
--- a/runtest.c
+++ b/runtest.c
@@ -3019,10 +3019,7 @@ schemasOneTest(const char *sch,
     }
 
     ctxt = xmlSchemaNewValidCtxt(schemas);
-    xmlSchemaSetValidErrors(ctxt,
-         (xmlSchemaValidityErrorFunc) testErrorHandler,
-         (xmlSchemaValidityWarningFunc) testErrorHandler,
-        ctxt);
+    xmlSchemaSetValidErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
     validResult = xmlSchemaValidateDoc(ctxt, doc);
     if (validResult == 0) {
        fprintf(schemasOutput, "%s validates\n", filename);
@@ -3087,10 +3084,7 @@ schemasTest(const char *filename,
 
     /* first compile the schemas if possible */
     ctxt = xmlSchemaNewParserCtxt(filename);
-    xmlSchemaSetParserErrors(ctxt,
-         (xmlSchemaValidityErrorFunc) testErrorHandler,
-         (xmlSchemaValidityWarningFunc) testErrorHandler,
-        ctxt);
+    xmlSchemaSetParserErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
     schemas = xmlSchemaParse(ctxt);
     xmlSchemaFreeParserCtxt(ctxt);
 
@@ -3196,10 +3190,7 @@ rngOneTest(const char *sch,
     }
 
     ctxt = xmlRelaxNGNewValidCtxt(schemas);
-    xmlRelaxNGSetValidErrors(ctxt,
-         (xmlRelaxNGValidityErrorFunc) testErrorHandler,
-         (xmlRelaxNGValidityWarningFunc) testErrorHandler,
-        ctxt);
+    xmlRelaxNGSetValidErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
     ret = xmlRelaxNGValidateDoc(ctxt, doc);
     if (ret == 0) {
        testErrorHandler(NULL, "%s validates\n", filename);
@@ -3266,10 +3257,7 @@ rngTest(const char *filename,
 
     /* first compile the schemas if possible */
     ctxt = xmlRelaxNGNewParserCtxt(filename);
-    xmlRelaxNGSetParserErrors(ctxt,
-         (xmlRelaxNGValidityErrorFunc) testErrorHandler,
-         (xmlRelaxNGValidityWarningFunc) testErrorHandler,
-        ctxt);
+    xmlRelaxNGSetParserErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
     schemas = xmlRelaxNGParse(ctxt);
     xmlRelaxNGFreeParserCtxt(ctxt);
 


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