Skip to content

Commit dcae579

Browse files
committed
Remove unneeded function pointer casts
1 parent 19f0950 commit dcae579

2 files changed

Lines changed: 15 additions & 42 deletions

File tree

runsuite.c

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,8 @@ xsdIncorectTestCase(xmlNodePtr cur) {
327327
}
328328
xmlNodeDump(buf, test->doc, test, 0, 0);
329329
pctxt = xmlRelaxNGNewMemParserCtxt((const char *)buf->content, buf->use);
330-
xmlRelaxNGSetParserErrors(pctxt,
331-
(xmlRelaxNGValidityErrorFunc) testErrorHandler,
332-
(xmlRelaxNGValidityWarningFunc) testErrorHandler,
333-
pctxt);
330+
xmlRelaxNGSetParserErrors(pctxt, testErrorHandler, testErrorHandler,
331+
pctxt);
334332
rng = xmlRelaxNGParse(pctxt);
335333
xmlRelaxNGFreeParserCtxt(pctxt);
336334
if (rng != NULL) {
@@ -462,10 +460,8 @@ xsdTestCase(xmlNodePtr tst) {
462460
}
463461
xmlNodeDump(buf, test->doc, test, 0, 0);
464462
pctxt = xmlRelaxNGNewMemParserCtxt((const char *)buf->content, buf->use);
465-
xmlRelaxNGSetParserErrors(pctxt,
466-
(xmlRelaxNGValidityErrorFunc) testErrorHandler,
467-
(xmlRelaxNGValidityWarningFunc) testErrorHandler,
468-
pctxt);
463+
xmlRelaxNGSetParserErrors(pctxt, testErrorHandler, testErrorHandler,
464+
pctxt);
469465
rng = xmlRelaxNGParse(pctxt);
470466
xmlRelaxNGFreeParserCtxt(pctxt);
471467
if (extraMemoryFromResolver)
@@ -510,9 +506,7 @@ xsdTestCase(xmlNodePtr tst) {
510506
nb_tests++;
511507
ctxt = xmlRelaxNGNewValidCtxt(rng);
512508
xmlRelaxNGSetValidErrors(ctxt,
513-
(xmlRelaxNGValidityErrorFunc) testErrorHandler,
514-
(xmlRelaxNGValidityWarningFunc) testErrorHandler,
515-
ctxt);
509+
testErrorHandler, testErrorHandler, ctxt);
516510
ret = xmlRelaxNGValidateDoc(ctxt, doc);
517511
xmlRelaxNGFreeValidCtxt(ctxt);
518512
if (ret > 0) {
@@ -567,9 +561,7 @@ xsdTestCase(xmlNodePtr tst) {
567561
nb_tests++;
568562
ctxt = xmlRelaxNGNewValidCtxt(rng);
569563
xmlRelaxNGSetValidErrors(ctxt,
570-
(xmlRelaxNGValidityErrorFunc) testErrorHandler,
571-
(xmlRelaxNGValidityWarningFunc) testErrorHandler,
572-
ctxt);
564+
testErrorHandler, testErrorHandler, ctxt);
573565
ret = xmlRelaxNGValidateDoc(ctxt, doc);
574566
xmlRelaxNGFreeValidCtxt(ctxt);
575567
if (ret == 0) {
@@ -825,10 +817,7 @@ xstcTestInstance(xmlNodePtr cur, xmlSchemaPtr schemas,
825817
}
826818

827819
ctxt = xmlSchemaNewValidCtxt(schemas);
828-
xmlSchemaSetValidErrors(ctxt,
829-
(xmlSchemaValidityErrorFunc) testErrorHandler,
830-
(xmlSchemaValidityWarningFunc) testErrorHandler,
831-
ctxt);
820+
xmlSchemaSetValidErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
832821
ret = xmlSchemaValidateDoc(ctxt, doc);
833822

834823
if (xmlStrEqual(validity, BAD_CAST "valid")) {
@@ -916,10 +905,8 @@ xstcTestGroup(xmlNodePtr cur, const char *base) {
916905
if (xmlStrEqual(validity, BAD_CAST "valid")) {
917906
nb_schematas++;
918907
ctxt = xmlSchemaNewParserCtxt((const char *) path);
919-
xmlSchemaSetParserErrors(ctxt,
920-
(xmlSchemaValidityErrorFunc) testErrorHandler,
921-
(xmlSchemaValidityWarningFunc) testErrorHandler,
922-
ctxt);
908+
xmlSchemaSetParserErrors(ctxt, testErrorHandler, testErrorHandler,
909+
ctxt);
923910
schemas = xmlSchemaParse(ctxt);
924911
xmlSchemaFreeParserCtxt(ctxt);
925912
if (schemas == NULL) {
@@ -952,10 +939,8 @@ xstcTestGroup(xmlNodePtr cur, const char *base) {
952939
} else if (xmlStrEqual(validity, BAD_CAST "invalid")) {
953940
nb_schematas++;
954941
ctxt = xmlSchemaNewParserCtxt((const char *) path);
955-
xmlSchemaSetParserErrors(ctxt,
956-
(xmlSchemaValidityErrorFunc) testErrorHandler,
957-
(xmlSchemaValidityWarningFunc) testErrorHandler,
958-
ctxt);
942+
xmlSchemaSetParserErrors(ctxt, testErrorHandler, testErrorHandler,
943+
ctxt);
959944
schemas = xmlSchemaParse(ctxt);
960945
xmlSchemaFreeParserCtxt(ctxt);
961946
if (schemas != NULL) {

runtest.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3019,10 +3019,7 @@ schemasOneTest(const char *sch,
30193019
}
30203020

30213021
ctxt = xmlSchemaNewValidCtxt(schemas);
3022-
xmlSchemaSetValidErrors(ctxt,
3023-
(xmlSchemaValidityErrorFunc) testErrorHandler,
3024-
(xmlSchemaValidityWarningFunc) testErrorHandler,
3025-
ctxt);
3022+
xmlSchemaSetValidErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
30263023
validResult = xmlSchemaValidateDoc(ctxt, doc);
30273024
if (validResult == 0) {
30283025
fprintf(schemasOutput, "%s validates\n", filename);
@@ -3087,10 +3084,7 @@ schemasTest(const char *filename,
30873084

30883085
/* first compile the schemas if possible */
30893086
ctxt = xmlSchemaNewParserCtxt(filename);
3090-
xmlSchemaSetParserErrors(ctxt,
3091-
(xmlSchemaValidityErrorFunc) testErrorHandler,
3092-
(xmlSchemaValidityWarningFunc) testErrorHandler,
3093-
ctxt);
3087+
xmlSchemaSetParserErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
30943088
schemas = xmlSchemaParse(ctxt);
30953089
xmlSchemaFreeParserCtxt(ctxt);
30963090

@@ -3196,10 +3190,7 @@ rngOneTest(const char *sch,
31963190
}
31973191

31983192
ctxt = xmlRelaxNGNewValidCtxt(schemas);
3199-
xmlRelaxNGSetValidErrors(ctxt,
3200-
(xmlRelaxNGValidityErrorFunc) testErrorHandler,
3201-
(xmlRelaxNGValidityWarningFunc) testErrorHandler,
3202-
ctxt);
3193+
xmlRelaxNGSetValidErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
32033194
ret = xmlRelaxNGValidateDoc(ctxt, doc);
32043195
if (ret == 0) {
32053196
testErrorHandler(NULL, "%s validates\n", filename);
@@ -3266,10 +3257,7 @@ rngTest(const char *filename,
32663257

32673258
/* first compile the schemas if possible */
32683259
ctxt = xmlRelaxNGNewParserCtxt(filename);
3269-
xmlRelaxNGSetParserErrors(ctxt,
3270-
(xmlRelaxNGValidityErrorFunc) testErrorHandler,
3271-
(xmlRelaxNGValidityWarningFunc) testErrorHandler,
3272-
ctxt);
3260+
xmlRelaxNGSetParserErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
32733261
schemas = xmlRelaxNGParse(ctxt);
32743262
xmlRelaxNGFreeParserCtxt(ctxt);
32753263

0 commit comments

Comments
 (0)