mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
Fix -Wcast-function-type warnings (GCC 8)
Use xmlGenericError instead of fprintf as error handler. It also prints to stderr by default.
This commit is contained in:
16
debugXML.c
16
debugXML.c
@ -2363,10 +2363,7 @@ xmlShellRNGValidate(xmlShellCtxtPtr sctxt, char *schemas,
|
||||
int ret;
|
||||
|
||||
ctxt = xmlRelaxNGNewParserCtxt(schemas);
|
||||
xmlRelaxNGSetParserErrors(ctxt,
|
||||
(xmlRelaxNGValidityErrorFunc) fprintf,
|
||||
(xmlRelaxNGValidityWarningFunc) fprintf,
|
||||
stderr);
|
||||
xmlRelaxNGSetParserErrors(ctxt, xmlGenericError, xmlGenericError, NULL);
|
||||
relaxngschemas = xmlRelaxNGParse(ctxt);
|
||||
xmlRelaxNGFreeParserCtxt(ctxt);
|
||||
if (relaxngschemas == NULL) {
|
||||
@ -2375,10 +2372,7 @@ xmlShellRNGValidate(xmlShellCtxtPtr sctxt, char *schemas,
|
||||
return(-1);
|
||||
}
|
||||
vctxt = xmlRelaxNGNewValidCtxt(relaxngschemas);
|
||||
xmlRelaxNGSetValidErrors(vctxt,
|
||||
(xmlRelaxNGValidityErrorFunc) fprintf,
|
||||
(xmlRelaxNGValidityWarningFunc) fprintf,
|
||||
stderr);
|
||||
xmlRelaxNGSetValidErrors(vctxt, xmlGenericError, xmlGenericError, NULL);
|
||||
ret = xmlRelaxNGValidateDoc(vctxt, sctxt->doc);
|
||||
if (ret == 0) {
|
||||
fprintf(stderr, "%s validates\n", sctxt->filename);
|
||||
@ -2647,9 +2641,9 @@ xmlShellValidate(xmlShellCtxtPtr ctxt, char *dtd,
|
||||
int res = -1;
|
||||
|
||||
if ((ctxt == NULL) || (ctxt->doc == NULL)) return(-1);
|
||||
vctxt.userData = stderr;
|
||||
vctxt.error = (xmlValidityErrorFunc) fprintf;
|
||||
vctxt.warning = (xmlValidityWarningFunc) fprintf;
|
||||
vctxt.userData = NULL;
|
||||
vctxt.error = xmlGenericError;
|
||||
vctxt.warning = xmlGenericError;
|
||||
|
||||
if ((dtd == NULL) || (dtd[0] == 0)) {
|
||||
res = xmlValidateDocument(&vctxt, ctxt->doc);
|
||||
|
Reference in New Issue
Block a user