From 17367a564239f5f304a73b67f2a06f83eee417a1 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Aug 2023 15:36:54 +0200 Subject: [PATCH] tests/runtests.c: Re-apply 883115d0a3e3ade5cdb3a893dfa686d6c5e9630d and c094e450a136ffdf4d3e128588b615008a35489e This effectively reverts commit 42dc2c2c4e0fbb7dbda2a9fde0929c1509a82724. --- expat/tests/basic_tests.c | 6 +++--- expat/tests/handlers.c | 2 +- expat/tests/handlers.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/expat/tests/basic_tests.c b/expat/tests/basic_tests.c index da23d9cb..71a5c0d3 100644 --- a/expat/tests/basic_tests.c +++ b/expat/tests/basic_tests.c @@ -2569,7 +2569,7 @@ START_TEST(test_ext_entity_ref_parameter) { * what NULL would cause to be passed. */ XML_SetExternalEntityRefHandlerArg(g_parser, (void *)text); - g_handler_data = (void *)text; + g_handler_data = text; if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR) xml_failure(g_parser); @@ -2579,7 +2579,7 @@ START_TEST(test_ext_entity_ref_parameter) { XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS); XML_SetExternalEntityRefHandler(g_parser, external_entity_ref_param_checker); XML_SetExternalEntityRefHandlerArg(g_parser, NULL); - g_handler_data = (void *)g_parser; + g_handler_data = g_parser; if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR) xml_failure(g_parser); @@ -4889,10 +4889,10 @@ START_TEST(test_nested_entity_suspend) { const XML_Char *const expected = XCS("start") XCS("e3 head") XCS("e2 head") XCS("e1") XCS("e2 tail") XCS("e3 tail") XCS("end"); CharData storage; + CharData_Init(&storage); XML_Parser parser = XML_ParserCreate(NULL); ParserPlusStorage parserPlusStorage = {parser, &storage}; - CharData_Init(&storage); XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS); XML_SetCommentHandler(parser, accumulate_and_suspend_comment_handler); XML_SetUserData(parser, &parserPlusStorage); diff --git a/expat/tests/handlers.c b/expat/tests/handlers.c index dab253a5..28559dc3 100644 --- a/expat/tests/handlers.c +++ b/expat/tests/handlers.c @@ -59,7 +59,7 @@ /* Global variables for user parameter settings tests */ /* Variable holding the expected handler userData */ -void *g_handler_data = NULL; +const void *g_handler_data = NULL; /* Count of the number of times the comment handler has been invoked */ int g_comment_count = 0; /* Count of the number of skipped entities */ diff --git a/expat/tests/handlers.h b/expat/tests/handlers.h index b74e386d..5b50cb16 100644 --- a/expat/tests/handlers.h +++ b/expat/tests/handlers.h @@ -50,7 +50,7 @@ extern "C" { # include "expat.h" /* Variable holding the expected handler userData */ -extern void *g_handler_data; +extern const void *g_handler_data; /* Count of the number of times the comment handler has been invoked */ extern int g_comment_count; /* Count of the number of skipped entities */