Commit dcae579e authored by Nick Wellnhofer's avatar Nick Wellnhofer

Remove unneeded function pointer casts

parent 19f0950d
...@@ -327,10 +327,8 @@ xsdIncorectTestCase(xmlNodePtr cur) { ...@@ -327,10 +327,8 @@ xsdIncorectTestCase(xmlNodePtr cur) {
} }
xmlNodeDump(buf, test->doc, test, 0, 0); xmlNodeDump(buf, test->doc, test, 0, 0);
pctxt = xmlRelaxNGNewMemParserCtxt((const char *)buf->content, buf->use); pctxt = xmlRelaxNGNewMemParserCtxt((const char *)buf->content, buf->use);
xmlRelaxNGSetParserErrors(pctxt, xmlRelaxNGSetParserErrors(pctxt, testErrorHandler, testErrorHandler,
(xmlRelaxNGValidityErrorFunc) testErrorHandler, pctxt);
(xmlRelaxNGValidityWarningFunc) testErrorHandler,
pctxt);
rng = xmlRelaxNGParse(pctxt); rng = xmlRelaxNGParse(pctxt);
xmlRelaxNGFreeParserCtxt(pctxt); xmlRelaxNGFreeParserCtxt(pctxt);
if (rng != NULL) { if (rng != NULL) {
...@@ -462,10 +460,8 @@ xsdTestCase(xmlNodePtr tst) { ...@@ -462,10 +460,8 @@ xsdTestCase(xmlNodePtr tst) {
} }
xmlNodeDump(buf, test->doc, test, 0, 0); xmlNodeDump(buf, test->doc, test, 0, 0);
pctxt = xmlRelaxNGNewMemParserCtxt((const char *)buf->content, buf->use); pctxt = xmlRelaxNGNewMemParserCtxt((const char *)buf->content, buf->use);
xmlRelaxNGSetParserErrors(pctxt, xmlRelaxNGSetParserErrors(pctxt, testErrorHandler, testErrorHandler,
(xmlRelaxNGValidityErrorFunc) testErrorHandler, pctxt);
(xmlRelaxNGValidityWarningFunc) testErrorHandler,
pctxt);
rng = xmlRelaxNGParse(pctxt); rng = xmlRelaxNGParse(pctxt);
xmlRelaxNGFreeParserCtxt(pctxt); xmlRelaxNGFreeParserCtxt(pctxt);
if (extraMemoryFromResolver) if (extraMemoryFromResolver)
...@@ -510,9 +506,7 @@ xsdTestCase(xmlNodePtr tst) { ...@@ -510,9 +506,7 @@ xsdTestCase(xmlNodePtr tst) {
nb_tests++; nb_tests++;
ctxt = xmlRelaxNGNewValidCtxt(rng); ctxt = xmlRelaxNGNewValidCtxt(rng);
xmlRelaxNGSetValidErrors(ctxt, xmlRelaxNGSetValidErrors(ctxt,
(xmlRelaxNGValidityErrorFunc) testErrorHandler, testErrorHandler, testErrorHandler, ctxt);
(xmlRelaxNGValidityWarningFunc) testErrorHandler,
ctxt);
ret = xmlRelaxNGValidateDoc(ctxt, doc); ret = xmlRelaxNGValidateDoc(ctxt, doc);
xmlRelaxNGFreeValidCtxt(ctxt); xmlRelaxNGFreeValidCtxt(ctxt);
if (ret > 0) { if (ret > 0) {
...@@ -567,9 +561,7 @@ xsdTestCase(xmlNodePtr tst) { ...@@ -567,9 +561,7 @@ xsdTestCase(xmlNodePtr tst) {
nb_tests++; nb_tests++;
ctxt = xmlRelaxNGNewValidCtxt(rng); ctxt = xmlRelaxNGNewValidCtxt(rng);
xmlRelaxNGSetValidErrors(ctxt, xmlRelaxNGSetValidErrors(ctxt,
(xmlRelaxNGValidityErrorFunc) testErrorHandler, testErrorHandler, testErrorHandler, ctxt);
(xmlRelaxNGValidityWarningFunc) testErrorHandler,
ctxt);
ret = xmlRelaxNGValidateDoc(ctxt, doc); ret = xmlRelaxNGValidateDoc(ctxt, doc);
xmlRelaxNGFreeValidCtxt(ctxt); xmlRelaxNGFreeValidCtxt(ctxt);
if (ret == 0) { if (ret == 0) {
...@@ -825,10 +817,7 @@ xstcTestInstance(xmlNodePtr cur, xmlSchemaPtr schemas, ...@@ -825,10 +817,7 @@ xstcTestInstance(xmlNodePtr cur, xmlSchemaPtr schemas,
} }
ctxt = xmlSchemaNewValidCtxt(schemas); ctxt = xmlSchemaNewValidCtxt(schemas);
xmlSchemaSetValidErrors(ctxt, xmlSchemaSetValidErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
(xmlSchemaValidityErrorFunc) testErrorHandler,
(xmlSchemaValidityWarningFunc) testErrorHandler,
ctxt);
ret = xmlSchemaValidateDoc(ctxt, doc); ret = xmlSchemaValidateDoc(ctxt, doc);
if (xmlStrEqual(validity, BAD_CAST "valid")) { if (xmlStrEqual(validity, BAD_CAST "valid")) {
...@@ -916,10 +905,8 @@ xstcTestGroup(xmlNodePtr cur, const char *base) { ...@@ -916,10 +905,8 @@ xstcTestGroup(xmlNodePtr cur, const char *base) {
if (xmlStrEqual(validity, BAD_CAST "valid")) { if (xmlStrEqual(validity, BAD_CAST "valid")) {
nb_schematas++; nb_schematas++;
ctxt = xmlSchemaNewParserCtxt((const char *) path); ctxt = xmlSchemaNewParserCtxt((const char *) path);
xmlSchemaSetParserErrors(ctxt, xmlSchemaSetParserErrors(ctxt, testErrorHandler, testErrorHandler,
(xmlSchemaValidityErrorFunc) testErrorHandler, ctxt);
(xmlSchemaValidityWarningFunc) testErrorHandler,
ctxt);
schemas = xmlSchemaParse(ctxt); schemas = xmlSchemaParse(ctxt);
xmlSchemaFreeParserCtxt(ctxt); xmlSchemaFreeParserCtxt(ctxt);
if (schemas == NULL) { if (schemas == NULL) {
...@@ -952,10 +939,8 @@ xstcTestGroup(xmlNodePtr cur, const char *base) { ...@@ -952,10 +939,8 @@ xstcTestGroup(xmlNodePtr cur, const char *base) {
} else if (xmlStrEqual(validity, BAD_CAST "invalid")) { } else if (xmlStrEqual(validity, BAD_CAST "invalid")) {
nb_schematas++; nb_schematas++;
ctxt = xmlSchemaNewParserCtxt((const char *) path); ctxt = xmlSchemaNewParserCtxt((const char *) path);
xmlSchemaSetParserErrors(ctxt, xmlSchemaSetParserErrors(ctxt, testErrorHandler, testErrorHandler,
(xmlSchemaValidityErrorFunc) testErrorHandler, ctxt);
(xmlSchemaValidityWarningFunc) testErrorHandler,
ctxt);
schemas = xmlSchemaParse(ctxt); schemas = xmlSchemaParse(ctxt);
xmlSchemaFreeParserCtxt(ctxt); xmlSchemaFreeParserCtxt(ctxt);
if (schemas != NULL) { if (schemas != NULL) {
......
...@@ -3019,10 +3019,7 @@ schemasOneTest(const char *sch, ...@@ -3019,10 +3019,7 @@ schemasOneTest(const char *sch,
} }
ctxt = xmlSchemaNewValidCtxt(schemas); ctxt = xmlSchemaNewValidCtxt(schemas);
xmlSchemaSetValidErrors(ctxt, xmlSchemaSetValidErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
(xmlSchemaValidityErrorFunc) testErrorHandler,
(xmlSchemaValidityWarningFunc) testErrorHandler,
ctxt);
validResult = xmlSchemaValidateDoc(ctxt, doc); validResult = xmlSchemaValidateDoc(ctxt, doc);
if (validResult == 0) { if (validResult == 0) {
fprintf(schemasOutput, "%s validates\n", filename); fprintf(schemasOutput, "%s validates\n", filename);
...@@ -3087,10 +3084,7 @@ schemasTest(const char *filename, ...@@ -3087,10 +3084,7 @@ schemasTest(const char *filename,
/* first compile the schemas if possible */ /* first compile the schemas if possible */
ctxt = xmlSchemaNewParserCtxt(filename); ctxt = xmlSchemaNewParserCtxt(filename);
xmlSchemaSetParserErrors(ctxt, xmlSchemaSetParserErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
(xmlSchemaValidityErrorFunc) testErrorHandler,
(xmlSchemaValidityWarningFunc) testErrorHandler,
ctxt);
schemas = xmlSchemaParse(ctxt); schemas = xmlSchemaParse(ctxt);
xmlSchemaFreeParserCtxt(ctxt); xmlSchemaFreeParserCtxt(ctxt);
...@@ -3196,10 +3190,7 @@ rngOneTest(const char *sch, ...@@ -3196,10 +3190,7 @@ rngOneTest(const char *sch,
} }
ctxt = xmlRelaxNGNewValidCtxt(schemas); ctxt = xmlRelaxNGNewValidCtxt(schemas);
xmlRelaxNGSetValidErrors(ctxt, xmlRelaxNGSetValidErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
(xmlRelaxNGValidityErrorFunc) testErrorHandler,
(xmlRelaxNGValidityWarningFunc) testErrorHandler,
ctxt);
ret = xmlRelaxNGValidateDoc(ctxt, doc); ret = xmlRelaxNGValidateDoc(ctxt, doc);
if (ret == 0) { if (ret == 0) {
testErrorHandler(NULL, "%s validates\n", filename); testErrorHandler(NULL, "%s validates\n", filename);
...@@ -3266,10 +3257,7 @@ rngTest(const char *filename, ...@@ -3266,10 +3257,7 @@ rngTest(const char *filename,
/* first compile the schemas if possible */ /* first compile the schemas if possible */
ctxt = xmlRelaxNGNewParserCtxt(filename); ctxt = xmlRelaxNGNewParserCtxt(filename);
xmlRelaxNGSetParserErrors(ctxt, xmlRelaxNGSetParserErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
(xmlRelaxNGValidityErrorFunc) testErrorHandler,
(xmlRelaxNGValidityWarningFunc) testErrorHandler,
ctxt);
schemas = xmlRelaxNGParse(ctxt); schemas = xmlRelaxNGParse(ctxt);
xmlRelaxNGFreeParserCtxt(ctxt); xmlRelaxNGFreeParserCtxt(ctxt);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment