summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--expat/examples/elements.c2
-rw-r--r--expat/tests/runtests.c552
-rw-r--r--expat/tests/structdata.c2
-rw-r--r--expat/xmlwf/readfilemap.c4
4 files changed, 281 insertions, 279 deletions
diff --git a/expat/examples/elements.c b/expat/examples/elements.c
index 2f253f7c..9d2027e4 100644
--- a/expat/examples/elements.c
+++ b/expat/examples/elements.c
@@ -91,7 +91,7 @@ main(int argc, char *argv[])
do {
size_t len = fread(buf, 1, sizeof(buf), stdin);
done = len < sizeof(buf);
- if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) {
+ if (XML_Parse(parser, buf, (int)len, done) == XML_STATUS_ERROR) {
fprintf(stderr,
"%" XML_FMT_STR " at line %" XML_FMT_INT_MOD "u\n",
XML_ErrorString(XML_GetErrorCode(parser)),
diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c
index b39b44b3..4ffe80cd 100644
--- a/expat/tests/runtests.c
+++ b/expat/tests/runtests.c
@@ -165,7 +165,7 @@ static void
_expect_failure(const char *text, enum XML_Error errorCode, const char *errorMessage,
const char *file, int lineno)
{
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_OK)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_OK)
/* Hackish use of _fail_unless() macro, but let's us report
the right filename and line number. */
_fail_unless(0, file, lineno, errorMessage);
@@ -397,7 +397,7 @@ external_entity_optioner(XML_Parser parser,
if (ext_parser == NULL)
return XML_STATUS_ERROR;
rc = _XML_Parse_SINGLE_BYTES(ext_parser, options->parse_text,
- strlen(options->parse_text),
+ (int)strlen(options->parse_text),
XML_TRUE);
XML_ParserFree(ext_parser);
return rc;
@@ -518,7 +518,7 @@ START_TEST(test_bom_utf8)
/* This test is really just making sure we don't core on a UTF-8 BOM. */
const char *text = "\357\273\277<e/>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -584,7 +584,7 @@ _run_character_check(const char *text, const XML_Char *expected,
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
XML_SetCharacterDataHandler(parser, accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
_xml_failure(parser, file, line);
CharData_CheckXMLChars(&storage, expected);
}
@@ -601,7 +601,7 @@ _run_attribute_check(const char *text, const XML_Char *expected,
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
XML_SetStartElementHandler(parser, accumulate_attribute);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
_xml_failure(parser, file, line);
CharData_CheckXMLChars(&storage, expected);
}
@@ -634,7 +634,7 @@ _run_ext_character_check(const char *text,
test_data->storage = &storage;
XML_SetUserData(parser, test_data);
XML_SetCharacterDataHandler(parser, ext_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
_xml_failure(parser, file, line);
CharData_CheckXMLChars(&storage, expected);
@@ -753,7 +753,7 @@ START_TEST(test_illegal_utf8)
for (i = 128; i <= 255; ++i) {
sprintf(text, "<e>%ccd</e>", i);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_OK) {
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_OK) {
sprintf(text,
"expected token error for '%c' (ordinal %d) in UTF-8 text",
i, i);
@@ -1093,7 +1093,7 @@ START_TEST(test_line_number_after_parse)
"\n</tag>";
XML_Size lineno;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_FALSE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
lineno = XML_GetCurrentLineNumber(parser);
if (lineno != 4) {
@@ -1111,7 +1111,7 @@ START_TEST(test_column_number_after_parse)
const char *text = "<tag></tag>";
XML_Size colno;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_FALSE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
colno = XML_GetCurrentColumnNumber(parser);
if (colno != 11) {
@@ -1177,7 +1177,7 @@ START_TEST(test_line_and_column_numbers_inside_handlers)
XML_SetUserData(parser, &storage);
XML_SetStartElementHandler(parser, start_element_event_handler2);
XML_SetEndElementHandler(parser, end_element_event_handler2);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
StructData_CheckItems(&storage, expected, expected_count);
@@ -1193,7 +1193,7 @@ START_TEST(test_line_number_after_error)
" <b>\n"
" </a>"; /* missing </b> */
XML_Size lineno;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_FALSE) != XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_FALSE) != XML_STATUS_ERROR)
fail("Expected a parse error");
lineno = XML_GetCurrentLineNumber(parser);
@@ -1213,7 +1213,7 @@ START_TEST(test_column_number_after_error)
" <b>\n"
" </a>"; /* missing </b> */
XML_Size colno;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_FALSE) != XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_FALSE) != XML_STATUS_ERROR)
fail("Expected a parse error");
colno = XML_GetCurrentColumnNumber(parser);
@@ -1256,7 +1256,7 @@ START_TEST(test_really_long_lines)
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
"</e>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -1292,7 +1292,7 @@ START_TEST(test_really_long_encoded_lines)
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
"</e>";
- int parse_len = strlen(text);
+ int parse_len = (int)strlen(text);
/* Need a cdata handler to provoke the code path we want to test */
XML_SetCharacterDataHandler(parser, dummy_cdata_handler);
@@ -1335,7 +1335,7 @@ START_TEST(test_end_element_events)
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
XML_SetEndElementHandler(parser, end_element_event_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
}
@@ -1449,7 +1449,7 @@ START_TEST(test_attr_whitespace_normalization)
XML_SetStartElementHandler(parser,
check_attr_contains_normalized_whitespace);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -1518,7 +1518,7 @@ START_TEST(test_unknown_encoding_internal_entity)
"<test a='&foo;'/>";
XML_SetUnknownEncodingHandler(parser, UnknownEncodingHandler, NULL);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -1549,7 +1549,7 @@ START_TEST(test_unrecognised_encoding_internal_entity)
XML_SetUnknownEncodingHandler(parser,
UnrecognisedEncodingHandler,
NULL);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_ERROR)
fail("Unrecognised encoding not rejected");
}
END_TEST
@@ -1574,7 +1574,7 @@ external_entity_loader(XML_Parser parser,
}
if ( _XML_Parse_SINGLE_BYTES(extparser,
test_data->parse_text,
- strlen(test_data->parse_text),
+ (int)strlen(test_data->parse_text),
XML_TRUE)
== XML_STATUS_ERROR) {
xml_failure(extparser);
@@ -1679,7 +1679,7 @@ external_entity_faulter(XML_Parser parser,
}
if (_XML_Parse_SINGLE_BYTES(ext_parser,
fault->parse_text,
- strlen(fault->parse_text),
+ (int)strlen(fault->parse_text),
XML_TRUE) != XML_STATUS_ERROR)
fail(fault->fail_text);
if (XML_GetErrorCode(ext_parser) != fault->error)
@@ -1741,7 +1741,7 @@ START_TEST(test_wfc_undeclared_entity_unread_external_subset) {
"<!DOCTYPE doc SYSTEM 'foo'>\n"
"<doc>&entity;</doc>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -2077,12 +2077,12 @@ START_TEST(test_dtd_attr_handling)
for (test = attr_data; test->definition != NULL; test++) {
XML_SetAttlistDeclHandler(parser, verify_attlist_decl_handler);
XML_SetUserData(parser, test);
- if (_XML_Parse_SINGLE_BYTES(parser, prolog, strlen(prolog),
+ if (_XML_Parse_SINGLE_BYTES(parser, prolog, (int)strlen(prolog),
XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
if (_XML_Parse_SINGLE_BYTES(parser,
test->definition,
- strlen(test->definition),
+ (int)strlen(test->definition),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
XML_ParserReset(parser, NULL);
@@ -2103,7 +2103,7 @@ START_TEST(test_empty_ns_without_namespaces)
" <e xmlns:prefix=''/>\n"
"</doc>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -2121,7 +2121,7 @@ START_TEST(test_ns_in_attribute_default_without_namespaces)
" ]>\n"
"<e:element/>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -2174,7 +2174,7 @@ START_TEST(test_stop_parser_between_char_data_calls)
XML_SetCharacterDataHandler(parser, clearing_aborting_character_handler);
resumable = XML_FALSE;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_ERROR)
xml_failure(parser);
if (XML_GetErrorCode(parser) != XML_ERROR_ABORTED)
xml_failure(parser);
@@ -2195,12 +2195,12 @@ START_TEST(test_suspend_parser_between_char_data_calls)
XML_SetCharacterDataHandler(parser, clearing_aborting_character_handler);
resumable = XML_TRUE;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) != XML_STATUS_SUSPENDED)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_SUSPENDED)
xml_failure(parser);
if (XML_GetErrorCode(parser) != XML_ERROR_NONE)
xml_failure(parser);
/* Try parsing directly */
- if (XML_Parse(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_ERROR)
fail("Attempt to continue parse while suspended not faulted");
if (XML_GetErrorCode(parser) != XML_ERROR_SUSPENDED)
fail("Suspended parse not faulted with correct error");
@@ -2244,7 +2244,7 @@ START_TEST(test_repeated_stop_parser_between_char_data_calls)
XML_SetCharacterDataHandler(parser, parser_stop_character_handler);
resumable = XML_FALSE;
abortable = XML_FALSE;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
fail("Failed to double-stop parser");
@@ -2252,7 +2252,7 @@ START_TEST(test_repeated_stop_parser_between_char_data_calls)
XML_SetCharacterDataHandler(parser, parser_stop_character_handler);
resumable = XML_TRUE;
abortable = XML_FALSE;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_SUSPENDED)
fail("Failed to double-suspend parser");
@@ -2260,7 +2260,7 @@ START_TEST(test_repeated_stop_parser_between_char_data_calls)
XML_SetCharacterDataHandler(parser, parser_stop_character_handler);
resumable = XML_TRUE;
abortable = XML_TRUE;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
fail("Failed to suspend-abort parser");
}
@@ -2280,7 +2280,7 @@ START_TEST(test_good_cdata_ascii)
XML_SetStartCdataSectionHandler(parser, dummy_start_cdata_handler);
XML_SetEndCdataSectionHandler(parser, dummy_end_cdata_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -2291,7 +2291,7 @@ START_TEST(test_good_cdata_ascii)
XML_SetCharacterDataHandler(parser, accumulate_characters);
XML_SetDefaultHandler(parser, dummy_default_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
}
@@ -2316,7 +2316,7 @@ START_TEST(test_good_cdata_utf16)
XML_SetUserData(parser, &storage);
XML_SetCharacterDataHandler(parser, accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text) - 1, XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text) - 1, XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
}
@@ -2341,7 +2341,7 @@ START_TEST(test_good_cdata_utf16_le)
XML_SetUserData(parser, &storage);
XML_SetCharacterDataHandler(parser, accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text) - 1, XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text) - 1, XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
}
@@ -2453,7 +2453,7 @@ START_TEST(test_multichar_cdata_utf16)
XML_SetUserData(parser, &storage);
XML_SetCharacterDataHandler(parser, accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text) - 1, XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text) - 1, XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
}
@@ -2479,7 +2479,7 @@ START_TEST(test_utf16_bad_surrogate_pair)
"\xdc\x00\xd8\x00"
"\0]\0]\0>\0<\0/\0a\0>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text) - 1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text) - 1,
XML_TRUE) != XML_STATUS_ERROR)
fail("Reversed UTF-16 surrogate pair not faulted");
if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN)
@@ -2525,7 +2525,7 @@ START_TEST(test_bad_cdata)
size_t i = 0;
for (; i < sizeof(cases) / sizeof(struct CaseData); i++) {
const enum XML_Status actualStatus = _XML_Parse_SINGLE_BYTES(
- parser, cases[i].text, strlen(cases[i].text), XML_TRUE);
+ parser, cases[i].text, (int)strlen(cases[i].text), XML_TRUE);
const enum XML_Error actualError = XML_GetErrorCode(parser);
assert(actualStatus == XML_STATUS_ERROR);
@@ -2597,12 +2597,12 @@ START_TEST(test_bad_cdata_utf16)
enum XML_Status actual_status;
enum XML_Error actual_error;
- if (_XML_Parse_SINGLE_BYTES(parser, prolog, sizeof(prolog)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, prolog, (int)sizeof(prolog)-1,
XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
actual_status = _XML_Parse_SINGLE_BYTES(parser,
cases[i].text,
- cases[i].text_bytes,
+ (int)cases[i].text_bytes,
XML_TRUE);
assert(actual_status == XML_STATUS_ERROR);
actual_error = XML_GetErrorCode(parser);
@@ -2670,7 +2670,7 @@ START_TEST(test_suspend_parser_between_cdata_calls)
XML_SetCharacterDataHandler(parser,
clearing_aborting_character_handler);
resumable = XML_TRUE;
- result = _XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE);
+ result = _XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE);
if (result != XML_STATUS_SUSPENDED) {
if (result == XML_STATUS_ERROR)
xml_failure(parser);
@@ -2765,7 +2765,7 @@ START_TEST(test_default_current)
XML_SetCharacterDataHandler(parser, record_cdata_handler);
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, XCS("DCDCDCDCDCDD"));
@@ -2776,7 +2776,7 @@ START_TEST(test_default_current)
XML_SetCharacterDataHandler(parser, record_cdata_nodefault_handler);
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, XCS("DcccccD"));
@@ -2787,7 +2787,7 @@ START_TEST(test_default_current)
XML_SetCharacterDataHandler(parser, record_cdata_handler);
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, entity_text, strlen(entity_text),
+ if (_XML_Parse_SINGLE_BYTES(parser, entity_text, (int)strlen(entity_text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
/* The default handler suppresses the entity */
@@ -2800,7 +2800,7 @@ START_TEST(test_default_current)
XML_SetSkippedEntityHandler(parser, record_skip_handler);
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, entity_text, strlen(entity_text),
+ if (_XML_Parse_SINGLE_BYTES(parser, entity_text, (int)strlen(entity_text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
/* The default handler suppresses the entity */
@@ -2812,7 +2812,7 @@ START_TEST(test_default_current)
XML_SetCharacterDataHandler(parser, record_cdata_handler);
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, entity_text, strlen(entity_text),
+ if (_XML_Parse_SINGLE_BYTES(parser, entity_text, (int)strlen(entity_text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, XCS("DDDDDDDDDDDDDDDDDCDD"));
@@ -2823,7 +2823,7 @@ START_TEST(test_default_current)
XML_SetCharacterDataHandler(parser, record_cdata_nodefault_handler);
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, entity_text, strlen(entity_text),
+ if (_XML_Parse_SINGLE_BYTES(parser, entity_text, (int)strlen(entity_text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, XCS("DDDDDDDDDDDDDDDDDcD"));
@@ -2841,7 +2841,7 @@ START_TEST(test_dtd_elements)
"<doc><chapter>Wombats are go</chapter></doc>";
XML_SetElementDeclHandler(parser, dummy_element_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -2869,7 +2869,7 @@ START_TEST(test_set_foreign_dtd)
XML_SetDefaultHandler(parser, dummy_default_handler);
if (XML_UseForeignDTD(parser, XML_TRUE) != XML_ERROR_NONE)
fail("Could not set foreign DTD");
- if (_XML_Parse_SINGLE_BYTES(parser, text1, strlen(text1),
+ if (_XML_Parse_SINGLE_BYTES(parser, text1, (int)strlen(text1),
XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
@@ -2884,7 +2884,7 @@ START_TEST(test_set_foreign_dtd)
fail("Failed to reject late hash salt change");
/* Now finish the parse */
- if (_XML_Parse_SINGLE_BYTES(parser, text2, strlen(text2),
+ if (_XML_Parse_SINGLE_BYTES(parser, text2, (int)strlen(text2),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -2959,7 +2959,7 @@ START_TEST(test_foreign_dtd_with_doctype)
XML_SetDefaultHandler(parser, dummy_default_handler);
if (XML_UseForeignDTD(parser, XML_TRUE) != XML_ERROR_NONE)
fail("Could not set foreign DTD");
- if (_XML_Parse_SINGLE_BYTES(parser, text1, strlen(text1),
+ if (_XML_Parse_SINGLE_BYTES(parser, text1, (int)strlen(text1),
XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
@@ -2974,7 +2974,7 @@ START_TEST(test_foreign_dtd_with_doctype)
fail("Failed to reject late hash salt change");
/* Now finish the parse */
- if (_XML_Parse_SINGLE_BYTES(parser, text2, strlen(text2),
+ if (_XML_Parse_SINGLE_BYTES(parser, text2, (int)strlen(text2),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -3001,7 +3001,7 @@ START_TEST(test_foreign_dtd_without_external_subset)
XML_SetUserData(parser, NULL);
XML_SetExternalEntityRefHandler(parser, external_entity_null_loader);
XML_UseForeignDTD(parser, XML_TRUE);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -3139,7 +3139,7 @@ START_TEST(test_attributes)
XML_SetStartElementHandler(parser, counting_start_element_handler);
XML_SetUserData(parser, info);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -3159,7 +3159,7 @@ START_TEST(test_reset_in_entity)
resumable = XML_TRUE;
XML_SetCharacterDataHandler(parser, clearing_aborting_character_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_FALSE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
XML_GetParsingStatus(parser, &status);
if (status.parsing != XML_SUSPENDED)
@@ -3179,7 +3179,7 @@ START_TEST(test_resume_invalid_parse)
resumable = XML_TRUE;
XML_SetCharacterDataHandler(parser,
clearing_aborting_character_handler);
- if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
if (XML_ResumeParser(parser) == XML_STATUS_OK)
fail("Resumed invalid parse not faulted");
@@ -3196,7 +3196,7 @@ START_TEST(test_resume_resuspended)
resumable = XML_TRUE;
XML_SetCharacterDataHandler(parser,
clearing_aborting_character_handler);
- if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
resumable = XML_TRUE;
XML_SetCharacterDataHandler(parser,
@@ -3220,7 +3220,7 @@ START_TEST(test_cdata_default)
XML_SetUserData(parser, &storage);
XML_SetDefaultHandler(parser, accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -3247,7 +3247,7 @@ external_entity_resetter(XML_Parser parser,
fail("Parsing status is not INITIALIZED");
return XML_STATUS_ERROR;
}
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR) {
xml_failure(parser);
return XML_STATUS_ERROR;
@@ -3258,7 +3258,7 @@ external_entity_resetter(XML_Parser parser,
return XML_STATUS_ERROR;
}
/* Check we can't parse here */
- if (XML_Parse(ext_parser, text, strlen(text),
+ if (XML_Parse(ext_parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
fail("Parsing when finished not faulted");
if (XML_GetErrorCode(ext_parser) != XML_ERROR_FINISHED)
@@ -3282,7 +3282,7 @@ START_TEST(test_subordinate_reset)
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_resetter);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -3320,7 +3320,7 @@ external_entity_suspender(XML_Parser parser,
fail("Could not create external entity parser");
XML_SetElementDeclHandler(ext_parser, entity_suspending_decl_handler);
XML_SetUserData(ext_parser, ext_parser);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR) {
xml_failure(ext_parser);
return XML_STATUS_ERROR;
@@ -3338,7 +3338,7 @@ START_TEST(test_subordinate_suspend)
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_suspender);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -3374,7 +3374,7 @@ external_entity_suspend_xmldecl(XML_Parser parser,
fail("Could not create external entity parser");
XML_SetXmlDeclHandler(ext_parser, entity_suspending_xdecl_handler);
XML_SetUserData(ext_parser, ext_parser);
- rc = _XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text), XML_TRUE);
+ rc = _XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE);
XML_GetParsingStatus(ext_parser, &status);
if (resumable) {
if (rc == XML_STATUS_ERROR)
@@ -3406,7 +3406,7 @@ START_TEST(test_subordinate_xdecl_suspend)
XML_SetExternalEntityRefHandler(parser,
external_entity_suspend_xmldecl);
resumable = XML_TRUE;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -3424,7 +3424,7 @@ START_TEST(test_subordinate_xdecl_abort)
XML_SetExternalEntityRefHandler(parser,
external_entity_suspend_xmldecl);
resumable = XML_FALSE;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -3441,7 +3441,7 @@ external_entity_suspending_faulter(XML_Parser parser,
XML_Parser ext_parser;
ExtFaults *fault = (ExtFaults *)XML_GetUserData(parser);
void *buffer;
- int parse_len = strlen(fault->parse_text);
+ int parse_len = (int)strlen(fault->parse_text);
ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
if (ext_parser == NULL)
@@ -3519,13 +3519,13 @@ START_TEST(test_explicit_encoding)
/* Say we are UTF-8 */
if (XML_SetEncoding(parser, XCS("utf-8")) != XML_STATUS_OK)
fail("Failed to set explicit encoding");
- if (_XML_Parse_SINGLE_BYTES(parser, text1, strlen(text1),
+ if (_XML_Parse_SINGLE_BYTES(parser, text1, (int)strlen(text1),
XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
/* Try to switch encodings mid-parse */
if (XML_SetEncoding(parser, XCS("us-ascii")) != XML_STATUS_ERROR)
fail("Allowed encoding change");
- if (_XML_Parse_SINGLE_BYTES(parser, text2, strlen(text2),
+ if (_XML_Parse_SINGLE_BYTES(parser, text2, (int)strlen(text2),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
/* Try now the parse is over */
@@ -3557,7 +3557,7 @@ START_TEST(test_trailing_cr)
XML_SetCharacterDataHandler(parser, cr_cdata_handler);
XML_SetUserData(parser, &found_cr);
found_cr = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_OK)
fail("Failed to fault unclosed doc");
if (found_cr == 0)
@@ -3568,7 +3568,7 @@ START_TEST(test_trailing_cr)
XML_SetDefaultHandler(parser, cr_cdata_handler);
XML_SetUserData(parser, &found_cr);
found_cr = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_OK)
fail("Failed to fault unclosed doc");
if (found_cr == 0)
@@ -3591,7 +3591,7 @@ external_entity_cr_catcher(XML_Parser parser,
if (ext_parser == NULL)
fail("Could not create external entity parser");
XML_SetCharacterDataHandler(ext_parser, cr_cdata_handler);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(ext_parser);
XML_ParserFree(ext_parser);
@@ -3612,7 +3612,7 @@ external_entity_bad_cr_catcher(XML_Parser parser,
if (ext_parser == NULL)
fail("Could not create external entity parser");
XML_SetCharacterDataHandler(ext_parser, cr_cdata_handler);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_OK)
fail("Async entity error not caught");
if (XML_GetErrorCode(ext_parser) != XML_ERROR_ASYNC_ENTITY)
@@ -3634,7 +3634,7 @@ START_TEST(test_ext_entity_trailing_cr)
XML_SetExternalEntityRefHandler(parser, external_entity_cr_catcher);
XML_SetUserData(parser, &found_cr);
found_cr = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_OK)
xml_failure(parser);
if (found_cr == 0)
@@ -3646,7 +3646,7 @@ START_TEST(test_ext_entity_trailing_cr)
XML_SetExternalEntityRefHandler(parser, external_entity_bad_cr_catcher);
XML_SetUserData(parser, &found_cr);
found_cr = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_OK)
xml_failure(parser);
if (found_cr == 0)
@@ -3669,7 +3669,7 @@ START_TEST(test_trailing_rsqb)
const char *text8 = "<doc>]";
const char text16[] = "\xFF\xFE<\000d\000o\000c\000>\000]\000";
int found_rsqb;
- int text8_len = strlen(text8);
+ int text8_len = (int)strlen(text8);
XML_SetCharacterDataHandler(parser, rsqb_handler);
XML_SetUserData(parser, &found_rsqb);
@@ -3685,7 +3685,7 @@ START_TEST(test_trailing_rsqb)
XML_SetCharacterDataHandler(parser, rsqb_handler);
XML_SetUserData(parser, &found_rsqb);
found_rsqb = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text16, sizeof(text16)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text16, (int)sizeof(text16)-1,
XML_TRUE) == XML_STATUS_OK)
fail("Failed to fault unclosed doc");
if (found_rsqb == 0)
@@ -3696,7 +3696,7 @@ START_TEST(test_trailing_rsqb)
XML_SetDefaultHandler(parser, rsqb_handler);
XML_SetUserData(parser, &found_rsqb);
found_rsqb = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text16, sizeof(text16)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text16, (int)sizeof(text16)-1,
XML_TRUE) == XML_STATUS_OK)
fail("Failed to fault unclosed doc");
if (found_rsqb == 0)
@@ -3719,7 +3719,7 @@ external_entity_rsqb_catcher(XML_Parser parser,
if (ext_parser == NULL)
fail("Could not create external entity parser");
XML_SetCharacterDataHandler(ext_parser, rsqb_handler);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
fail("Async entity error not caught");
if (XML_GetErrorCode(ext_parser) != XML_ERROR_ASYNC_ENTITY)
@@ -3741,7 +3741,7 @@ START_TEST(test_ext_entity_trailing_rsqb)
XML_SetExternalEntityRefHandler(parser, external_entity_rsqb_catcher);
XML_SetUserData(parser, &found_rsqb);
found_rsqb = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_OK)
xml_failure(parser);
if (found_rsqb == 0)
@@ -3770,7 +3770,7 @@ external_entity_good_cdata_ascii(XML_Parser parser,
XML_SetUserData(ext_parser, &storage);
XML_SetCharacterDataHandler(ext_parser, accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(ext_parser);
CharData_CheckXMLChars(&storage, expected);
@@ -3790,7 +3790,7 @@ START_TEST(test_ext_entity_good_cdata)
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser,
external_entity_good_cdata_ascii);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_OK)
xml_failure(parser);
}
@@ -3857,7 +3857,7 @@ external_entity_param_checker(XML_Parser parser,
if (ext_parser == NULL)
fail("Could not create external entity parser");
handler_data = ext_parser;
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR) {
xml_failure(parser);
return XML_STATUS_ERROR;
@@ -3889,7 +3889,7 @@ START_TEST(test_user_parameters)
XML_UseParserAsHandlerArg(parser);
XML_SetUserData(parser, (void *)1);
handler_data = parser;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
if (comment_count != 2)
@@ -3897,7 +3897,7 @@ START_TEST(test_user_parameters)
/* Ensure we can't change policy mid-parse */
if (XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_NEVER))
fail("Changed param entity parsing policy while parsing");
- if (_XML_Parse_SINGLE_BYTES(parser, epilog, strlen(epilog),
+ if (_XML_Parse_SINGLE_BYTES(parser, epilog, (int)strlen(epilog),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
if (comment_count != 3)
@@ -3935,7 +3935,7 @@ external_entity_ref_param_checker(XML_Parser parameter,
ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
if (ext_parser == NULL)
fail("Could not create external entity parser");
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(ext_parser);
@@ -3958,7 +3958,7 @@ START_TEST(test_ext_entity_ref_parameter)
*/
XML_SetExternalEntityRefHandlerArg(parser, (void *)text);
handler_data = (void *)text;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
@@ -3969,7 +3969,7 @@ START_TEST(test_ext_entity_ref_parameter)
external_entity_ref_param_checker);
XML_SetExternalEntityRefHandlerArg(parser, NULL);
handler_data = (void *)parser;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -3990,7 +3990,7 @@ START_TEST(test_empty_parse)
/* Now try with valid text before the empty end */
XML_ParserReset(parser, NULL);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
if (XML_Parse(parser, NULL, 0, XML_TRUE) == XML_STATUS_ERROR)
@@ -3998,7 +3998,7 @@ START_TEST(test_empty_parse)
/* Now try with invalid text before the empty end */
XML_ParserReset(parser, NULL);
- if (_XML_Parse_SINGLE_BYTES(parser, partial, strlen(partial),
+ if (_XML_Parse_SINGLE_BYTES(parser, partial, (int)strlen(partial),
XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
if (XML_Parse(parser, NULL, 0, XML_TRUE) != XML_STATUS_ERROR)
@@ -4068,7 +4068,7 @@ START_TEST(test_get_buffer_1)
if (buffer == NULL)
fail("1.5K buffer failed");
memcpy(buffer, text, strlen(text));
- if (XML_ParseBuffer(parser, strlen(text), XML_FALSE) == XML_STATUS_ERROR)
+ if (XML_ParseBuffer(parser, (int)strlen(text), XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
if (XML_GetBuffer(parser, INT_MAX) != NULL)
fail("INT_MAX buffer not failed");
@@ -4106,7 +4106,7 @@ START_TEST(test_get_buffer_2)
if (buffer == NULL)
fail("1.5K buffer failed");
memcpy(buffer, text, strlen(text));
- if (XML_ParseBuffer(parser, strlen(text), XML_FALSE) == XML_STATUS_ERROR)
+ if (XML_ParseBuffer(parser, (int)strlen(text), XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
/* Extend it, to catch a different code path */
@@ -4123,7 +4123,7 @@ START_TEST(test_byte_info_at_end)
if (XML_GetCurrentByteIndex(parser) != -1 ||
XML_GetCurrentByteCount(parser) != 0)
fail("Byte index/count incorrect at start of parse");
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
/* At end, the count will be zero and the index the end of string */
@@ -4141,7 +4141,7 @@ START_TEST(test_byte_info_at_error)
{
const char *text = PRE_ERROR_STR POST_ERROR_STR;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_OK)
fail("Syntax error not faulted");
if (XML_GetCurrentByteCount(parser) != 0)
@@ -4202,12 +4202,12 @@ START_TEST(test_byte_info_at_cdata)
if (XML_GetInputContext(parser, &offset, &size) != NULL)
fail("Unexpected context at start of parse");
- data.start_element_len = strlen(START_ELEMENT);
- data.cdata_len = strlen(CDATA_TEXT);
- data.total_string_len = strlen(text);
+ data.start_element_len = (int)strlen(START_ELEMENT);
+ data.cdata_len = (int)strlen(CDATA_TEXT);
+ data.total_string_len = (int)strlen(text);
XML_SetCharacterDataHandler(parser, byte_character_handler);
XML_SetUserData(parser, &data);
- if (XML_Parse(parser, text, strlen(text), XML_TRUE) != XML_STATUS_OK)
+ if (XML_Parse(parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_OK)
xml_failure(parser);
}
END_TEST
@@ -4229,7 +4229,7 @@ START_TEST(test_predefined_entities)
*/
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
/* The default handler doesn't translate the entities */
@@ -4274,14 +4274,14 @@ external_entity_param(XML_Parser parser,
fail("Could not create external entity parser");
if (!xcstrcmp(systemId, XCS("004-1.ent"))) {
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, strlen(text1),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, (int)strlen(text1),
XML_TRUE) != XML_STATUS_ERROR)
fail("Inner DTD with invalid tag not rejected");
if (XML_GetErrorCode(ext_parser) != XML_ERROR_EXTERNAL_ENTITY_HANDLING)
xml_failure(ext_parser);
}
else if (!xcstrcmp(systemId, XCS("004-2.ent"))) {
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text2, strlen(text2),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text2, (int)strlen(text2),
XML_TRUE) != XML_STATUS_ERROR)
fail("Invalid tag in external param not rejected");
if (XML_GetErrorCode(ext_parser) != XML_ERROR_SYNTAX)
@@ -4342,7 +4342,7 @@ external_entity_load_ignore(XML_Parser parser,
ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
if (ext_parser == NULL)
fail("Could not create external entity parser");
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
@@ -4369,7 +4369,7 @@ START_TEST(test_ignore_section)
XML_SetElementDeclHandler(parser, dummy_element_decl_handler);
XML_SetStartElementHandler(parser, dummy_start_element);
XML_SetEndElementHandler(parser, dummy_end_element);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -4393,7 +4393,7 @@ external_entity_load_ignore_utf16(XML_Parser parser,
ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
if (ext_parser == NULL)
fail("Could not create external entity parser");
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
@@ -4424,7 +4424,7 @@ START_TEST(test_ignore_section_utf16)
XML_SetElementDeclHandler(parser, dummy_element_decl_handler);
XML_SetStartElementHandler(parser, dummy_start_element);
XML_SetEndElementHandler(parser, dummy_end_element);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -4448,7 +4448,7 @@ external_entity_load_ignore_utf16_be(XML_Parser parser,
ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
if (ext_parser == NULL)
fail("Could not create external entity parser");
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
@@ -4479,7 +4479,7 @@ START_TEST(test_ignore_section_utf16_be)
XML_SetElementDeclHandler(parser, dummy_element_decl_handler);
XML_SetStartElementHandler(parser, dummy_start_element);
XML_SetEndElementHandler(parser, dummy_end_element);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -4548,7 +4548,7 @@ external_entity_valuer(XML_Parser parser,
if (ext_parser == NULL)
fail("Could not create external entity parser");
if (!xcstrcmp(systemId, XCS("004-1.ent"))) {
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, strlen(text1),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, (int)strlen(text1),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(ext_parser);
}
@@ -4559,7 +4559,7 @@ external_entity_valuer(XML_Parser parser,
status = _XML_Parse_SINGLE_BYTES(ext_parser,
fault->parse_text,
- strlen(fault->parse_text),
+ (int)strlen(fault->parse_text),
XML_TRUE);
if (fault->error == XML_ERROR_NONE) {
if (status == XML_STATUS_ERROR)
@@ -4660,7 +4660,7 @@ START_TEST(test_external_entity_values)
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_valuer);
XML_SetUserData(parser, &data_004_2[i]);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
XML_ParserReset(parser, NULL);
@@ -4691,7 +4691,7 @@ external_entity_not_standalone(XML_Parser parser,
if (!xcstrcmp(systemId, XCS("foo"))) {
XML_SetNotStandaloneHandler(ext_parser,
reject_not_standalone_handler);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, strlen(text1),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, (int)strlen(text1),
XML_TRUE) != XML_STATUS_ERROR)
fail("Expected not standalone rejection");
if (XML_GetErrorCode(ext_parser) != XML_ERROR_NOT_STANDALONE)
@@ -4701,7 +4701,7 @@ external_entity_not_standalone(XML_Parser parser,
return XML_STATUS_ERROR;
}
else if (!xcstrcmp(systemId, XCS("bar"))) {
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text2, strlen(text2),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text2, (int)strlen(text2),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(ext_parser);
}
@@ -4745,14 +4745,14 @@ external_entity_value_aborter(XML_Parser parser,
if (ext_parser == NULL)
fail("Could not create external entity parser");
if (!xcstrcmp(systemId, XCS("004-1.ent"))) {
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, strlen(text1),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, (int)strlen(text1),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(ext_parser);
}
if (!xcstrcmp(systemId, XCS("004-2.ent"))) {
XML_SetXmlDeclHandler(ext_parser, entity_suspending_xdecl_handler);
XML_SetUserData(ext_parser, ext_parser);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text2, strlen(text2),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text2, (int)strlen(text2),
XML_TRUE) != XML_STATUS_ERROR)
fail("Aborted parse not faulted");
if (XML_GetErrorCode(ext_parser) != XML_ERROR_ABORTED)
@@ -4773,7 +4773,7 @@ START_TEST(test_ext_entity_value_abort)
XML_SetExternalEntityRefHandler(parser,
external_entity_value_aborter);
resumable = XML_FALSE;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -4848,7 +4848,7 @@ START_TEST(test_dtd_stop_processing)
XML_SetEntityDeclHandler(parser, dummy_entity_decl_handler);
dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
if (dummy_handler_flags != 0)
@@ -4867,7 +4867,7 @@ START_TEST(test_public_notation_no_sysid)
dummy_handler_flags = 0;
XML_SetNotationDeclHandler(parser, dummy_notation_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
if (dummy_handler_flags != DUMMY_NOTATION_DECL_HANDLER_FLAG)
@@ -4880,7 +4880,7 @@ record_element_start_handler(void *userData,
const XML_Char *name,
const XML_Char **UNUSED_P(atts))
{
- CharData_AppendXMLChars((CharData *)userData, name, xcstrlen(name));
+ CharData_AppendXMLChars((CharData *)userData, name, (int)xcstrlen(name));
}
START_TEST(test_nested_groups)
@@ -4902,7 +4902,7 @@ START_TEST(test_nested_groups)
XML_SetStartElementHandler(parser, record_element_start_handler);
XML_SetUserData(parser, &storage);
dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, XCS("doce"));
@@ -4928,7 +4928,7 @@ START_TEST(test_group_choice)
XML_SetElementDeclHandler(parser, dummy_element_decl_handler);
dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
if (dummy_handler_flags != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
@@ -4960,7 +4960,7 @@ external_entity_public(XML_Parser parser,
}
else
fail("Unexpected parameters to external entity parser");
- parse_res = _XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ parse_res = _XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE);
XML_ParserFree(ext_parser);
return parse_res;
@@ -4981,7 +4981,7 @@ START_TEST(test_standalone_parameter_entity)
XML_SetUserData(parser, dtd_data);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_public);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -5004,7 +5004,7 @@ START_TEST(test_skipped_parameter_entity)
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetSkippedEntityHandler(parser, dummy_skip_handler);
dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
if (dummy_handler_flags != DUMMY_SKIP_HANDLER_FLAG)
@@ -5061,7 +5061,7 @@ external_entity_devaluer(XML_Parser parser,
fail("Could note create external entity parser");
if (clear_handler)
XML_SetExternalEntityRefHandler(ext_parser, NULL);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(ext_parser);
@@ -5078,7 +5078,7 @@ START_TEST(test_undefined_ext_entity_in_external_dtd)
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_devaluer);
XML_SetUserData(parser, (void *)(intptr_t)XML_FALSE);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
@@ -5089,7 +5089,7 @@ START_TEST(test_undefined_ext_entity_in_external_dtd)
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_devaluer);
XML_SetUserData(parser, (void *)(intptr_t)XML_TRUE);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -5113,13 +5113,13 @@ START_TEST(test_suspend_xdecl)
XML_SetXmlDeclHandler(parser, aborting_xdecl_handler);
resumable = XML_TRUE;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_SUSPENDED)
xml_failure(parser);
if (XML_GetErrorCode(parser) != XML_ERROR_NONE)
xml_failure(parser);
/* Attempt to start a new parse while suspended */
- if (XML_Parse(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_ERROR)
fail("Attempt to parse while suspended not faulted");
if (XML_GetErrorCode(parser) != XML_ERROR_SUSPENDED)
fail("Suspended parse not faulted with correct error");
@@ -5150,7 +5150,7 @@ START_TEST(test_abort_epilog)
XML_SetDefaultHandler(parser, selective_aborting_default_handler);
XML_SetUserData(parser, match);
resumable = XML_FALSE;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
fail("Abort not triggered");
if (XML_GetErrorCode(parser) != XML_ERROR_ABORTED)
@@ -5180,7 +5180,7 @@ START_TEST(test_suspend_epilog)
XML_SetDefaultHandler(parser, selective_aborting_default_handler);
XML_SetUserData(parser, match);
resumable = XML_TRUE;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_SUSPENDED)
xml_failure(parser);
}
@@ -5200,7 +5200,7 @@ START_TEST(test_partial_char_in_epilog)
const char *text = "<doc></doc>\xe2\x82";
/* First check that no fault is raised if the parse is not finished */
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
/* Now check that it is faulted once we finish */
@@ -5233,7 +5233,7 @@ START_TEST(test_hash_collision)
"</doc>\n";
XML_SetHashSalt(parser, COLLIDING_HASH_SALT);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -5267,7 +5267,7 @@ START_TEST(test_suspend_resume_internal_entity)
XML_SetStartElementHandler(parser, start_element_suspender);
XML_SetCharacterDataHandler(parser, accumulate_characters);
XML_SetUserData(parser, &storage);
- if (XML_Parse(parser, text, strlen(text),
+ if (XML_Parse(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_SUSPENDED)
xml_failure(parser);
CharData_CheckXMLChars(&storage, XCS(""));
@@ -5290,7 +5290,7 @@ START_TEST(test_resume_entity_with_syntax_error)
"<doc>&foo;</doc>\n";
XML_SetStartElementHandler(parser, start_element_suspender);
- if (XML_Parse(parser, text, strlen(text),
+ if (XML_Parse(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_SUSPENDED)
xml_failure(parser);
if (XML_ResumeParser(parser) != XML_STATUS_ERROR)
@@ -5326,7 +5326,7 @@ START_TEST(test_suspend_resume_parameter_entity)
XML_SetElementDeclHandler(parser, element_decl_suspender);
XML_SetCharacterDataHandler(parser, accumulate_characters);
XML_SetUserData(parser, &storage);
- if (XML_Parse(parser, text, strlen(text),
+ if (XML_Parse(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_SUSPENDED)
xml_failure(parser);
CharData_CheckXMLChars(&storage, XCS(""));
@@ -5341,7 +5341,7 @@ START_TEST(test_restart_on_error)
{
const char *text = "<$doc><doc></doc>";
- if (XML_Parse(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_ERROR)
fail("Invalid tag name not faulted");
if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN)
xml_failure(parser);
@@ -5379,7 +5379,7 @@ START_TEST(test_trailing_cr_in_att_value)
{
const char *text = "<doc a='value\r'/>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -5401,7 +5401,7 @@ START_TEST(test_standalone_internal_entity)
"<doc att2='any'/>";
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -5423,7 +5423,7 @@ START_TEST(test_skipped_external_entity)
XML_SetUserData(parser, &test_data);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_loader);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -5452,7 +5452,7 @@ external_entity_oneshot_loader(XML_Parser parser,
XML_SetExternalEntityRefHandler(ext_parser, test_data->handler);
if ( _XML_Parse_SINGLE_BYTES(ext_parser,
test_data->parse_text,
- strlen(test_data->parse_text),
+ (int)strlen(test_data->parse_text),
XML_TRUE) == XML_STATUS_ERROR) {
xml_failure(ext_parser);
}
@@ -5476,7 +5476,7 @@ START_TEST(test_skipped_null_loaded_ext_entity)
XML_SetUserData(parser, &test_data);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_oneshot_loader);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -5497,7 +5497,7 @@ START_TEST(test_skipped_unloaded_ext_entity)
XML_SetUserData(parser, &test_data);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_oneshot_loader);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -5528,7 +5528,7 @@ START_TEST(test_param_entity_with_trailing_cr)
entity_name_to_match = XCS(PARAM_ENTITY_NAME);
entity_value_to_match = XCS(PARAM_ENTITY_CORE_VALUE) XCS("\n");
entity_match_flag = ENTITY_MATCH_NOT_FOUND;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
if (entity_match_flag == ENTITY_MATCH_FAIL)
@@ -5581,7 +5581,7 @@ START_TEST(test_invalid_character_entity_3)
/* <doc>&entity;</doc> */
"\0<\0d\0o\0c\0>\0&\0e\0n\0t\0i\0t\0y\0;\0<\0/\0d\0o\0c\0>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) != XML_STATUS_ERROR)
fail("Invalid start of entity name not faulted");
if (XML_GetErrorCode(parser) != XML_ERROR_UNDEFINED_ENTITY)
@@ -5613,7 +5613,7 @@ START_TEST(test_pi_handled_in_default)
CharData_Init(&storage);
XML_SetDefaultHandler(parser, accumulate_characters);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE)== XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -5631,7 +5631,7 @@ START_TEST(test_comment_handled_in_default)
CharData_Init(&storage);
XML_SetDefaultHandler(parser, accumulate_characters);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -5661,7 +5661,7 @@ START_TEST(test_pi_yml)
CharData_Init(&storage);
XML_SetProcessingInstructionHandler(parser, accumulate_pi_characters);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -5677,7 +5677,7 @@ START_TEST(test_pi_xnl)
CharData_Init(&storage);
XML_SetProcessingInstructionHandler(parser, accumulate_pi_characters);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -5693,7 +5693,7 @@ START_TEST(test_pi_xmm)
CharData_Init(&storage);
XML_SetProcessingInstructionHandler(parser, accumulate_pi_characters);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -5720,7 +5720,7 @@ START_TEST(test_utf16_pi)
CharData_Init(&storage);
XML_SetProcessingInstructionHandler(parser, accumulate_pi_characters);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -5747,7 +5747,7 @@ START_TEST(test_utf16_be_pi)
CharData_Init(&storage);
XML_SetProcessingInstructionHandler(parser, accumulate_pi_characters);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -5777,7 +5777,7 @@ START_TEST(test_utf16_be_comment)
CharData_Init(&storage);
XML_SetCommentHandler(parser, accumulate_comment);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -5797,7 +5797,7 @@ START_TEST(test_utf16_le_comment)
CharData_Init(&storage);
XML_SetCommentHandler(parser, accumulate_comment);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -5965,7 +5965,7 @@ START_TEST(test_unknown_encoding_long_name_1)
XML_SetUnknownEncodingHandler(parser, MiscEncodingHandler, NULL);
XML_SetStartElementHandler(parser, record_element_start_handler);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -5989,7 +5989,7 @@ START_TEST(test_unknown_encoding_long_name_2)
XML_SetUnknownEncodingHandler(parser, MiscEncodingHandler, NULL);
XML_SetStartElementHandler(parser, record_element_start_handler);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6183,7 +6183,7 @@ START_TEST(test_ext_entity_latin1_utf16le_bom)
XML_SetExternalEntityRefHandler(parser, external_entity_loader2);
XML_SetUserData(parser, &test_data);
XML_SetCharacterDataHandler(parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6222,7 +6222,7 @@ START_TEST(test_ext_entity_latin1_utf16be_bom)
XML_SetExternalEntityRefHandler(parser, external_entity_loader2);
XML_SetUserData(parser, &test_data);
XML_SetCharacterDataHandler(parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6266,7 +6266,7 @@ START_TEST(test_ext_entity_latin1_utf16le_bom2)
XML_SetExternalEntityRefHandler(parser, external_entity_loader2);
XML_SetUserData(parser, &test_data);
XML_SetCharacterDataHandler(parser, ext2_accumulate_characters);
- if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
}
@@ -6304,7 +6304,7 @@ START_TEST(test_ext_entity_latin1_utf16be_bom2)
XML_SetExternalEntityRefHandler(parser, external_entity_loader2);
XML_SetUserData(parser, &test_data);
XML_SetCharacterDataHandler(parser, ext2_accumulate_characters);
- if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
}
@@ -6341,7 +6341,7 @@ START_TEST(test_ext_entity_utf16_be)
XML_SetExternalEntityRefHandler(parser, external_entity_loader2);
XML_SetUserData(parser, &test_data);
XML_SetCharacterDataHandler(parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6379,7 +6379,7 @@ START_TEST(test_ext_entity_utf16_le)
XML_SetExternalEntityRefHandler(parser, external_entity_loader2);
XML_SetUserData(parser, &test_data);
XML_SetCharacterDataHandler(parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6479,7 +6479,7 @@ START_TEST(test_ext_entity_utf8_non_bom)
XML_SetExternalEntityRefHandler(parser, external_entity_loader2);
XML_SetUserData(parser, &test_data);
XML_SetCharacterDataHandler(parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6535,7 +6535,7 @@ START_TEST(test_trailing_spaces_in_elements)
XML_SetElementHandler(parser, record_element_start_handler,
record_element_end_handler);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6556,7 +6556,7 @@ START_TEST(test_utf16_attribute)
CharData_Init(&storage);
XML_SetStartElementHandler(parser, accumulate_attribute);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6578,7 +6578,7 @@ START_TEST(test_utf16_second_attr)
CharData_Init(&storage);
XML_SetStartElementHandler(parser, accumulate_attribute);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6645,7 +6645,7 @@ START_TEST(test_utf16_pe)
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
XML_SetEntityDeclHandler(parser, accumulate_entity_decl);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6685,7 +6685,7 @@ START_TEST(test_bad_attr_desc_keyword_utf16)
"\0#\x0e\x04\x0e\x08\0>\0\n"
"\0]\0>\0<\0d\0/\0>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) != XML_STATUS_ERROR)
fail("Invalid UTF16 attribute keyword not faulted");
if (XML_GetErrorCode(parser) != XML_ERROR_SYNTAX)
@@ -6720,7 +6720,7 @@ START_TEST(test_bad_doctype_utf16)
"\x06\xf2"
"\0 \0]\0>\0<\0d\0o\0c\0/\0>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) != XML_STATUS_ERROR)
fail("Invalid bytes in DOCTYPE not faulted");
if (XML_GetErrorCode(parser) != XML_ERROR_SYNTAX)
@@ -6799,7 +6799,7 @@ START_TEST(test_entity_in_utf16_be_attr)
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
XML_SetStartElementHandler(parser, accumulate_attribute);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6822,7 +6822,7 @@ START_TEST(test_entity_in_utf16_le_attr)
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
XML_SetStartElementHandler(parser, accumulate_attribute);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6860,7 +6860,7 @@ START_TEST(test_entity_public_utf16_be)
XML_SetExternalEntityRefHandler(parser, external_entity_loader2);
XML_SetUserData(parser, &test_data);
XML_SetCharacterDataHandler(parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -6898,7 +6898,7 @@ START_TEST(test_entity_public_utf16_le)
XML_SetExternalEntityRefHandler(parser, external_entity_loader2);
XML_SetUserData(parser, &test_data);
XML_SetCharacterDataHandler(parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -7050,7 +7050,7 @@ START_TEST(test_default_doctype_handler)
XML_SetUserData(parser, &test_data);
XML_SetDefaultHandler(parser, checking_default_handler);
XML_SetEntityDeclHandler(parser, dummy_entity_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
for (i = 0; test_data[i].expected != NULL; i++)
@@ -7064,7 +7064,7 @@ START_TEST(test_empty_element_abort)
const char *text = "<abort/>";
XML_SetStartElementHandler(parser, start_element_suspender);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
fail("Expected to error on abort");
}
@@ -7150,14 +7150,14 @@ START_TEST(test_return_ns_triplet)
triplet_start_flag = XML_FALSE;
triplet_end_flag = XML_FALSE;
dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
if (!triplet_start_flag)
fail("triplet_start_checker not invoked");
/* Check that unsetting "return triplets" fails while still parsing */
XML_SetReturnNSTriplet(parser, XML_FALSE);
- if (_XML_Parse_SINGLE_BYTES(parser, epilog, strlen(epilog),
+ if (_XML_Parse_SINGLE_BYTES(parser, epilog, (int)strlen(epilog),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
if (!triplet_end_flag)
@@ -7200,7 +7200,7 @@ run_ns_tagname_overwrite_test(const char *text, const XML_Char *result)
XML_SetUserData(parser, &storage);
XML_SetElementHandler(parser,
overwrite_start_checker, overwrite_end_checker);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, result);
}
@@ -7278,7 +7278,7 @@ START_TEST(test_start_ns_clears_start_element)
XML_SetStartNamespaceDeclHandler(parser, start_ns_clearing_start_element);
XML_SetEndNamespaceDeclHandler(parser, dummy_end_namespace_decl_handler);
XML_UseParserAsHandlerArg(parser);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -7305,7 +7305,7 @@ external_entity_handler(XML_Parser parser,
XML_SetUserData(parser, (void *) callno);
p2 = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (_XML_Parse_SINGLE_BYTES(p2, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR) {
+ if (_XML_Parse_SINGLE_BYTES(p2, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR) {
xml_failure(p2);
return XML_STATUS_ERROR;
}
@@ -7329,7 +7329,7 @@ START_TEST(test_default_ns_from_ext_subset_and_ext_ge)
/* We actually need to set this handler to tickle this bug. */
XML_SetStartElementHandler(parser, dummy_start_element);
XML_SetUserData(parser, NULL);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -7398,7 +7398,7 @@ START_TEST(test_ns_prefix_with_empty_uri_4)
XML_SetReturnNSTriplet(parser, XML_TRUE);
XML_SetUserData(parser, (void *)elemstr);
XML_SetEndElementHandler(parser, triplet_end_checker);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -7414,7 +7414,7 @@ START_TEST(test_ns_unbound_prefix)
"]>\n"
"<prefix:doc/>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
fail("Unbound prefix incorrectly passed");
if (XML_GetErrorCode(parser) != XML_ERROR_UNBOUND_PREFIX)
@@ -7433,7 +7433,7 @@ START_TEST(test_ns_default_with_empty_uri)
dummy_start_namespace_decl_handler);
XML_SetEndNamespaceDeclHandler(parser,
dummy_end_namespace_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -7472,7 +7472,7 @@ START_TEST(test_ns_duplicate_hashes)
const char *text =
"<doc xmlns:a='http://example.org/a'\n"
" a:a='v' a:i='w' />";
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -7539,7 +7539,7 @@ START_TEST(test_ns_long_element)
XML_SetElementHandler(parser,
triplet_start_checker,
triplet_end_checker);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -7553,7 +7553,7 @@ START_TEST(test_ns_mixed_prefix_atts)
" xmlns:bar='http://example.org/'>"
"</e>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -7570,7 +7570,7 @@ START_TEST(test_ns_extend_uri_buffer)
" <foo:thisisalongenoughnametotriggerallocationaction"
" foo:a='12' />"
"</foo:e>";
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -7588,7 +7588,7 @@ START_TEST(test_ns_reserved_attributes)
expect_failure(text1, XML_ERROR_RESERVED_PREFIX_XMLNS,
"xmlns not rejected as an attribute");
XML_ParserReset(parser, NULL);
- if (_XML_Parse_SINGLE_BYTES(parser, text2, strlen(text2),
+ if (_XML_Parse_SINGLE_BYTES(parser, text2, (int)strlen(text2),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -7698,10 +7698,10 @@ START_TEST(test_ns_extremely_long_prefix)
"='foo'\n>"
"</doc>";
- if (_XML_Parse_SINGLE_BYTES(parser, text1, strlen(text1),
+ if (_XML_Parse_SINGLE_BYTES(parser, text1, (int)strlen(text1),
XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
- if (_XML_Parse_SINGLE_BYTES(parser, text2, strlen(text2),
+ if (_XML_Parse_SINGLE_BYTES(parser, text2, (int)strlen(text2),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -7776,7 +7776,7 @@ START_TEST(test_ns_utf16_leafname)
CharData_Init(&storage);
XML_SetStartElementHandler(parser, accumulate_attribute);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -7800,7 +7800,7 @@ START_TEST(test_ns_utf16_element_leafname)
CharData_Init(&storage);
XML_SetStartElementHandler(parser, start_element_event_handler);
XML_SetUserData(parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -7832,7 +7832,7 @@ START_TEST(test_ns_utf16_doctype)
XML_SetUserData(parser, &storage);
XML_SetStartElementHandler(parser, start_element_event_handler);
XML_SetUnknownEncodingHandler(parser, MiscEncodingHandler, NULL);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -8103,7 +8103,7 @@ START_TEST(test_misc_utf16le)
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
XML_SetCharacterDataHandler(parser, accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, sizeof(text)-1,
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)sizeof(text)-1,
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckXMLChars(&storage, expected);
@@ -8147,7 +8147,7 @@ START_TEST(test_alloc_parse_xdecl)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
XML_SetXmlDeclHandler(parser, dummy_xdecl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* Resetting the parser is insufficient, because some memory
@@ -8213,7 +8213,7 @@ START_TEST(test_alloc_parse_xdecl_2)
allocation_count = i;
XML_SetXmlDeclHandler(parser, dummy_xdecl_handler);
XML_SetUnknownEncodingHandler(parser, long_encoding_handler, NULL);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -8242,7 +8242,7 @@ START_TEST(test_alloc_parse_pi)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
XML_SetProcessingInstructionHandler(parser, dummy_pi_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -8270,7 +8270,7 @@ START_TEST(test_alloc_parse_pi_2)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
XML_SetProcessingInstructionHandler(parser, dummy_pi_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -8312,7 +8312,7 @@ START_TEST(test_alloc_parse_pi_3)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
XML_SetProcessingInstructionHandler(parser, dummy_pi_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -8338,7 +8338,7 @@ START_TEST(test_alloc_parse_comment)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
XML_SetCommentHandler(parser, dummy_comment_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -8366,7 +8366,7 @@ START_TEST(test_alloc_parse_comment_2)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
XML_SetCommentHandler(parser, dummy_comment_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -8430,7 +8430,7 @@ START_TEST(test_alloc_create_external_parser)
XML_SetUserData(parser, foo_text);
XML_SetExternalEntityRefHandler(parser,
external_entity_duff_loader);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR) {
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_ERROR) {
fail("External parser allocator returned success incorrectly");
}
}
@@ -8455,7 +8455,7 @@ START_TEST(test_alloc_run_external_parser)
XML_SetExternalEntityRefHandler(parser,
external_entity_null_loader);
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
alloc_teardown();
@@ -8519,7 +8519,7 @@ external_entity_dbl_handler(XML_Parser parser,
}
allocation_count = ALLOC_ALWAYS_SUCCEED;
- if (_XML_Parse_SINGLE_BYTES(new_parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR) {
+ if (_XML_Parse_SINGLE_BYTES(new_parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR) {
xml_failure(new_parser);
return XML_STATUS_ERROR;
}
@@ -8545,7 +8545,7 @@ START_TEST(test_alloc_dtd_copy_default_atts)
XML_SetExternalEntityRefHandler(parser,
external_entity_dbl_handler);
XML_SetUserData(parser, NULL);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -8574,7 +8574,7 @@ external_entity_dbl_handler_2(XML_Parser parser,
NULL);
if (new_parser == NULL)
return XML_STATUS_ERROR;
- rv = _XML_Parse_SINGLE_BYTES(new_parser, text, strlen(text),
+ rv = _XML_Parse_SINGLE_BYTES(new_parser, text, (int)strlen(text),
XML_TRUE);
} else {
/* Just run through once */
@@ -8583,7 +8583,7 @@ external_entity_dbl_handler_2(XML_Parser parser,
new_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
if (new_parser == NULL)
return XML_STATUS_ERROR;
- rv =_XML_Parse_SINGLE_BYTES(new_parser, text, strlen(text),
+ rv =_XML_Parse_SINGLE_BYTES(new_parser, text, (int)strlen(text),
XML_TRUE);
}
XML_ParserFree(new_parser);
@@ -8613,7 +8613,7 @@ START_TEST(test_alloc_external_entity)
external_entity_dbl_handler_2);
XML_SetUserData(parser, NULL);
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_OK)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -8650,7 +8650,7 @@ external_entity_alloc_set_encoding(XML_Parser parser,
XML_ParserFree(ext_parser);
return XML_STATUS_ERROR;
}
- status = _XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ status = _XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE);
XML_ParserFree(ext_parser);
if (status == XML_STATUS_ERROR)
@@ -8672,7 +8672,7 @@ START_TEST(test_alloc_ext_entity_set_encoding)
XML_SetExternalEntityRefHandler(parser,
external_entity_alloc_set_encoding);
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_OK)
break;
allocation_count = -1;
@@ -8722,7 +8722,7 @@ START_TEST(test_alloc_internal_entity)
XML_SetUnknownEncodingHandler(parser,
unknown_released_encoding_handler,
NULL);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR)
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
alloc_teardown();
@@ -8779,7 +8779,7 @@ START_TEST(test_alloc_dtd_default_handling)
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
XML_SetCharacterDataHandler(parser, accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -8858,7 +8858,7 @@ START_TEST(test_alloc_realloc_buffer)
if (buffer == NULL)
fail("1.5K buffer reallocation failed");
memcpy(buffer, text, strlen(text));
- if (XML_ParseBuffer(parser, strlen(text),
+ if (XML_ParseBuffer(parser, (int)strlen(text),
XML_FALSE) == XML_STATUS_OK)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -8895,7 +8895,7 @@ external_entity_reallocator(XML_Parser parser,
if (buffer == NULL)
fail("Buffer allocation failed");
memcpy(buffer, text, strlen(text));
- status = XML_ParseBuffer(ext_parser, strlen(text), XML_FALSE);
+ status = XML_ParseBuffer(ext_parser, (int)strlen(text), XML_FALSE);
reallocation_count = -1;
XML_ParserFree(ext_parser);
return (status == XML_STATUS_OK) ? XML_STATUS_OK : XML_STATUS_ERROR;
@@ -8915,7 +8915,7 @@ START_TEST(test_alloc_ext_entity_realloc_buffer)
XML_SetExternalEntityRefHandler(parser,
external_entity_reallocator);
XML_SetUserData(parser, (void *)(intptr_t)i);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) == XML_STATUS_OK)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -8962,7 +8962,7 @@ START_TEST(test_alloc_realloc_many_attributes)
for (i = 0; i < max_realloc_count; i++) {
reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9016,7 +9016,7 @@ START_TEST(test_alloc_public_entity_value)
XML_SetExternalEntityRefHandler(parser, external_entity_public);
/* Provoke a particular code path */
XML_SetEntityDeclHandler(parser, dummy_entity_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9082,7 +9082,7 @@ START_TEST(test_alloc_realloc_subst_public_entity_value)
XML_SetUserData(parser, dtd_text);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_public);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9129,7 +9129,7 @@ START_TEST(test_alloc_parse_public_doctype)
XML_SetDoctypeDeclHandler(parser,
dummy_start_doctype_decl_handler,
dummy_end_doctype_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9178,7 +9178,7 @@ START_TEST(test_alloc_parse_public_doctype_long_name)
XML_SetDoctypeDeclHandler(parser,
dummy_start_doctype_decl_handler,
dummy_end_doctype_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9206,7 +9206,7 @@ external_entity_alloc(XML_Parser parser,
ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
if (ext_parser == NULL)
return XML_STATUS_ERROR;
- parse_res = _XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+ parse_res = _XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text),
XML_TRUE);
XML_ParserFree(ext_parser);
return parse_res;
@@ -9229,7 +9229,7 @@ START_TEST(test_alloc_set_foreign_dtd)
XML_SetExternalEntityRefHandler(parser, external_entity_alloc);
if (XML_UseForeignDTD(parser, XML_TRUE) != XML_ERROR_NONE)
fail("Could not set foreign DTD");
- if (_XML_Parse_SINGLE_BYTES(parser, text1, strlen(text1),
+ if (_XML_Parse_SINGLE_BYTES(parser, text1, (int)strlen(text1),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9264,7 +9264,7 @@ START_TEST(test_alloc_attribute_enum_value)
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
/* An attribute list handler provokes a different code path */
XML_SetAttlistDeclHandler(parser, dummy_attlist_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9322,7 +9322,7 @@ START_TEST(test_alloc_realloc_attribute_enum_value)
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
/* An attribute list handler provokes a different code path */
XML_SetAttlistDeclHandler(parser, dummy_attlist_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9373,7 +9373,7 @@ START_TEST(test_alloc_realloc_implied_attribute)
for (i = 0; i < max_realloc_count; i++) {
reallocation_count = i;
XML_SetAttlistDeclHandler(parser, dummy_attlist_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9424,7 +9424,7 @@ START_TEST(test_alloc_realloc_default_attribute)
for (i = 0; i < max_realloc_count; i++) {
reallocation_count = i;
XML_SetAttlistDeclHandler(parser, dummy_attlist_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9490,7 +9490,7 @@ START_TEST(test_alloc_notation)
dummy_handler_flags = 0;
XML_SetNotationDeclHandler(parser, dummy_notation_decl_handler);
XML_SetEntityDeclHandler(parser, dummy_entity_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9541,7 +9541,7 @@ START_TEST(test_alloc_public_notation)
allocation_count = i;
dummy_handler_flags = 0;
XML_SetNotationDeclHandler(parser, dummy_notation_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9591,7 +9591,7 @@ START_TEST(test_alloc_system_notation)
allocation_count = i;
dummy_handler_flags = 0;
XML_SetNotationDeclHandler(parser, dummy_notation_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9630,7 +9630,7 @@ START_TEST(test_alloc_nested_groups)
XML_SetStartElementHandler(parser, record_element_start_handler);
XML_SetUserData(parser, &storage);
dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9671,7 +9671,7 @@ START_TEST(test_alloc_realloc_nested_groups)
XML_SetStartElementHandler(parser, record_element_start_handler);
XML_SetUserData(parser, &storage);
dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9711,7 +9711,7 @@ START_TEST(test_alloc_large_group)
allocation_count = i;
XML_SetElementDeclHandler(parser, dummy_element_decl_handler);
dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9751,7 +9751,7 @@ START_TEST(test_alloc_realloc_group_choice)
reallocation_count = i;
XML_SetElementDeclHandler(parser, dummy_element_decl_handler);
dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9779,7 +9779,7 @@ START_TEST(test_alloc_pi_in_epilog)
allocation_count = i;
XML_SetProcessingInstructionHandler(parser, dummy_pi_handler);
dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9807,7 +9807,7 @@ START_TEST(test_alloc_comment_in_epilog)
allocation_count = i;
XML_SetCommentHandler(parser, dummy_comment_handler);
dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9851,7 +9851,7 @@ START_TEST(test_alloc_realloc_long_attribute_value)
for (i = 0; i < max_realloc_count; i++) {
reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9873,7 +9873,7 @@ START_TEST(test_alloc_attribute_whitespace)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9895,7 +9895,7 @@ START_TEST(test_alloc_attribute_predefined_entity)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9941,7 +9941,7 @@ START_TEST(test_alloc_long_attr_default_with_char_ref)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -9986,7 +9986,7 @@ START_TEST(test_alloc_long_attr_value)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -10081,7 +10081,7 @@ START_TEST(test_alloc_realloc_param_entity_newline)
XML_SetUserData(parser, dtd_text);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_alloc);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -10129,7 +10129,7 @@ START_TEST(test_alloc_realloc_ce_extends_pe)
XML_SetUserData(parser, dtd_text);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_alloc);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -10165,7 +10165,7 @@ START_TEST(test_alloc_realloc_attributes)
for (i = 0; i < max_realloc_count; i++) {
reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -10206,7 +10206,7 @@ START_TEST(test_alloc_long_doc_name)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -10258,7 +10258,7 @@ START_TEST(test_alloc_long_base)
XML_ParserReset(parser, NULL);
continue;
}
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -10306,7 +10306,7 @@ START_TEST(test_alloc_long_public_id)
XML_SetUserData(parser, entity_text);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_alloc);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -10355,7 +10355,7 @@ START_TEST(test_alloc_long_entity_value)
XML_SetUserData(parser, entity_text);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_alloc);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_alloc_parse_xdecl() */
@@ -10427,7 +10427,7 @@ START_TEST(test_alloc_long_notation)
XML_SetUserData(parser, options);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
@@ -10484,7 +10484,7 @@ START_TEST(test_nsalloc_xmlns)
allocation_count = i;
/* Exercise more code paths with a default handler */
XML_SetDefaultHandler(parser, dummy_default_handler);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* Resetting the parser is insufficient, because some memory
@@ -10530,31 +10530,31 @@ START_TEST(test_nsalloc_parse_buffer)
/* Get the parser into suspended state */
XML_SetCharacterDataHandler(parser, clearing_aborting_character_handler);
resumable = XML_TRUE;
- buffer = XML_GetBuffer(parser, strlen(text));
+ buffer = XML_GetBuffer(parser, (int)strlen(text));
if (buffer == NULL)
fail("Could not acquire parse buffer");
memcpy(buffer, text, strlen(text));
- if (XML_ParseBuffer(parser, strlen(text),
+ if (XML_ParseBuffer(parser, (int)strlen(text),
XML_TRUE) != XML_STATUS_SUSPENDED)
xml_failure(parser);
if (XML_GetErrorCode(parser) != XML_ERROR_NONE)
xml_failure(parser);
- if (XML_ParseBuffer(parser, strlen(text), XML_TRUE) != XML_STATUS_ERROR)
+ if (XML_ParseBuffer(parser, (int)strlen(text), XML_TRUE) != XML_STATUS_ERROR)
fail("Suspended XML_ParseBuffer not faulted");
if (XML_GetErrorCode(parser) != XML_ERROR_SUSPENDED)
xml_failure(parser);
- if (XML_GetBuffer(parser, strlen(text)) != NULL)
+ if (XML_GetBuffer(parser, (int)strlen(text)) != NULL)
fail("Suspended XML_GetBuffer not faulted");
/* Get it going again and complete the world */
XML_SetCharacterDataHandler(parser, NULL);
if (XML_ResumeParser(parser) != XML_STATUS_OK)
xml_failure(parser);
- if (XML_ParseBuffer(parser, strlen(text), XML_TRUE) != XML_STATUS_ERROR)
+ if (XML_ParseBuffer(parser, (int)strlen(text), XML_TRUE) != XML_STATUS_ERROR)
fail("Post-finishing XML_ParseBuffer not faulted");
if (XML_GetErrorCode(parser) != XML_ERROR_FINISHED)
xml_failure(parser);
- if (XML_GetBuffer(parser, strlen(text)) != NULL)
+ if (XML_GetBuffer(parser, (int)strlen(text)) != NULL)
fail("Post-finishing XML_GetBuffer not faulted");
}
END_TEST
@@ -10622,7 +10622,7 @@ START_TEST(test_nsalloc_long_prefix)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -10683,7 +10683,7 @@ START_TEST(test_nsalloc_long_uri)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -10727,7 +10727,7 @@ START_TEST(test_nsalloc_long_attr)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -10814,7 +10814,7 @@ START_TEST(test_nsalloc_long_attr_prefix)
XML_SetElementHandler(parser,
triplet_start_checker,
triplet_end_checker);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -10840,7 +10840,7 @@ START_TEST(test_nsalloc_realloc_attributes)
for (i = 0; i < max_realloc_count; i++) {
reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -10877,7 +10877,7 @@ START_TEST(test_nsalloc_long_element)
XML_SetElementHandler(parser,
triplet_start_checker,
triplet_end_checker);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -10915,7 +10915,7 @@ START_TEST(test_nsalloc_realloc_binding_uri)
const unsigned max_realloc_count = 10;
/* First, do a full parse that will leave bindings around */
- if (_XML_Parse_SINGLE_BYTES(parser, first, strlen(first),
+ if (_XML_Parse_SINGLE_BYTES(parser, first, (int)strlen(first),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
@@ -10923,7 +10923,7 @@ START_TEST(test_nsalloc_realloc_binding_uri)
for (i = 0; i < max_realloc_count; i++) {
XML_ParserReset(parser, NULL);
reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, second, strlen(second),
+ if (_XML_Parse_SINGLE_BYTES(parser, second, (int)strlen(second),
XML_TRUE) != XML_STATUS_ERROR)
break;
}
@@ -10997,7 +10997,7 @@ START_TEST(test_nsalloc_realloc_long_prefix)
for (i = 0; i < max_realloc_count; i++) {
reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -11074,7 +11074,7 @@ START_TEST(test_nsalloc_realloc_longer_prefix)
for (i = 0; i < max_realloc_count; i++) {
reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -11186,9 +11186,9 @@ START_TEST(test_nsalloc_long_namespace)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text1, strlen(text1),
+ if (_XML_Parse_SINGLE_BYTES(parser, text1, (int)strlen(text1),
XML_FALSE) != XML_STATUS_ERROR &&
- _XML_Parse_SINGLE_BYTES(parser, text2, strlen(text2),
+ _XML_Parse_SINGLE_BYTES(parser, text2, (int)strlen(text2),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -11262,7 +11262,7 @@ START_TEST(test_nsalloc_less_long_namespace)
for (i = 0; i < max_alloc_count; i++) {
allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -11317,7 +11317,7 @@ START_TEST(test_nsalloc_long_context)
XML_SetUserData(parser, options);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
@@ -11351,7 +11351,7 @@ context_realloc_test(const char *text)
XML_SetUserData(parser, options);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -11645,7 +11645,7 @@ START_TEST(test_nsalloc_realloc_long_ge_name)
XML_SetUserData(parser, options);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -11753,9 +11753,9 @@ START_TEST(test_nsalloc_realloc_long_context_in_dtd)
XML_SetUserData(parser, options);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(parser, text1, strlen(text1),
+ if (_XML_Parse_SINGLE_BYTES(parser, text1, (int)strlen(text1),
XML_FALSE) != XML_STATUS_ERROR &&
- _XML_Parse_SINGLE_BYTES(parser, text2, strlen(text2),
+ _XML_Parse_SINGLE_BYTES(parser, text2, (int)strlen(text2),
XML_TRUE) != XML_STATUS_ERROR)
break;
/* See comment in test_nsalloc_xmlns() */
@@ -11807,7 +11807,7 @@ START_TEST(test_nsalloc_long_default_in_ext)
XML_SetUserData(parser, options);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
@@ -11878,7 +11878,7 @@ START_TEST(test_nsalloc_long_systemid_in_ext)
XML_SetUserData(parser, options);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
@@ -11919,7 +11919,7 @@ START_TEST(test_nsalloc_prefixed_element)
XML_SetUserData(parser, options);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
break;
diff --git a/expat/tests/structdata.c b/expat/tests/structdata.c
index 22cb0eb2..2ed36fc3 100644
--- a/expat/tests/structdata.c
+++ b/expat/tests/structdata.c
@@ -60,7 +60,7 @@
static XML_Char *
xmlstrdup(const XML_Char *s)
{
- int byte_count = (xcstrlen(s) + 1) * sizeof(XML_Char);
+ size_t byte_count = (xcstrlen(s) + 1) * sizeof(XML_Char);
XML_Char *dup = malloc(byte_count);
assert(dup != NULL);
diff --git a/expat/xmlwf/readfilemap.c b/expat/xmlwf/readfilemap.c
index dd7543d8..4c4780bd 100644
--- a/expat/xmlwf/readfilemap.c
+++ b/expat/xmlwf/readfilemap.c
@@ -47,10 +47,12 @@
/* https://msdn.microsoft.com/en-us/library/wyssk1bs(v=vs.100).aspx */
# define _EXPAT_read _read
# define _EXPAT_read_count_t int
+# define _EXPAT_read_req_t unsigned int
#else /* POSIX */
/* http://pubs.opengroup.org/onlinepubs/009695399/functions/read.html */
# define _EXPAT_read read
# define _EXPAT_read_count_t ssize_t
+# define _EXPAT_read_req_t size_t
#endif
#ifndef S_ISREG
@@ -119,7 +121,7 @@ filemap(const tchar *name,
close(fd);
return 0;
}
- n = _EXPAT_read(fd, p, nbytes);
+ n = _EXPAT_read(fd, p, (_EXPAT_read_req_t)nbytes);
if (n < 0) {
tperror(name);
free(p);