1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

Fix calls to deprecated init/cleanup functions

Only use xmlInitParser/xmlCleanupParser.
This commit is contained in:
Nick Wellnhofer
2022-03-29 14:18:31 +02:00
parent d9335077dd
commit 92bff86614
7 changed files with 5 additions and 8 deletions

View File

@@ -10882,8 +10882,6 @@ xmlParseExtParsedEnt(xmlParserCtxtPtr ctxt) {
if ((ctxt == NULL) || (ctxt->input == NULL)) if ((ctxt == NULL) || (ctxt->input == NULL))
return(-1); return(-1);
xmlDefaultSAXHandlerInit();
xmlDetectSAX2(ctxt); xmlDetectSAX2(ctxt);
GROW; GROW;

View File

@@ -1554,7 +1554,7 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
return(-1); return(-1);
} }
xmlDefaultSAXHandlerInit(); xmlInitParser();
if (ctxt->dict == NULL) if (ctxt->dict == NULL)
ctxt->dict = xmlDictCreate(); ctxt->dict = xmlDictCreate();

View File

@@ -216,7 +216,7 @@ testRegexpFile(const char *filename) {
int main(int argc, char **argv) { int main(int argc, char **argv) {
xmlInitMemory(); xmlInitParser();
if (argc == 1) { if (argc == 1) {
int ret; int ret;

View File

@@ -278,7 +278,7 @@ int main(int argc, char **argv) {
char *filename = NULL; char *filename = NULL;
int i; int i;
xmlInitMemory(); xmlInitParser();
if (argc <= 1) { if (argc <= 1) {
usage(argv[0]); usage(argv[0]);

View File

@@ -169,7 +169,6 @@ int main(int argc, char **argv) {
printf("\t--memory : test the schemas in memory parsing\n"); printf("\t--memory : test the schemas in memory parsing\n");
#endif #endif
} }
xmlRelaxNGCleanupTypes();
xmlCleanupParser(); xmlCleanupParser();
xmlMemoryDump(); xmlMemoryDump();

View File

@@ -160,7 +160,6 @@ int main(int argc, char **argv) {
#endif #endif
} }
failed_schemas: failed_schemas:
xmlSchemaCleanupTypes();
xmlCleanupParser(); xmlCleanupParser();
xmlMemoryDump(); xmlMemoryDump();

View File

@@ -130,6 +130,8 @@ int main(int argc, char **argv) {
int usefile = 0; int usefile = 0;
char *filename = NULL; char *filename = NULL;
xmlInitParser();
for (i = 1; i < argc ; i++) { for (i = 1; i < argc ; i++) {
#if defined(LIBXML_XPTR_ENABLED) #if defined(LIBXML_XPTR_ENABLED)
if ((!strcmp(argv[i], "-xptr")) || (!strcmp(argv[i], "--xptr"))) if ((!strcmp(argv[i], "-xptr")) || (!strcmp(argv[i], "--xptr")))
@@ -158,7 +160,6 @@ int main(int argc, char **argv) {
xmlSubstituteEntitiesDefaultValue = 1; xmlSubstituteEntitiesDefaultValue = 1;
#ifdef LIBXML_SAX1_ENABLED #ifdef LIBXML_SAX1_ENABLED
if (nocdata != 0) { if (nocdata != 0) {
xmlDefaultSAXHandlerInit();
xmlDefaultSAXHandler.cdataBlock = NULL; xmlDefaultSAXHandler.cdataBlock = NULL;
} }
#endif #endif