From fdrake@users.sourceforge.net Thu Nov 7 21:48:07 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 07 Nov 2002 13:48:07 -0800 Subject: [Expat-checkins] expat Makefile.in,1.40,1.41 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv1037 Modified Files: Makefile.in Log Message: Avoid use of xargs; not available on Windows when using MSYS/MinGW. Index: Makefile.in =================================================================== RCS file: /cvsroot/expat/expat/Makefile.in,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- Makefile.in 5 Sep 2002 01:58:26 -0000 1.40 +++ Makefile.in 7 Nov 2002 21:48:05 -0000 1.41 @@ -57,7 +57,7 @@ cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs cd tests && rm -rf .libs runtests runtests.o chardata.o rm -rf .libs libexpat.la - find . -name core | xargs rm -f + rm -f examples/core tests/core xmlwf/core distclean: clean rm -f expat_config.h config.status config.log config.cache libtool From fdrake@users.sourceforge.net Thu Nov 7 23:02:31 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 07 Nov 2002 15:02:31 -0800 Subject: [Expat-checkins] expat/tests runtests.c,1.36,1.37 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv8252 Modified Files: runtests.c Log Message: Added regression test for SF bug #616863. Cleaned up some indentation. Report the version of the Expat library if not in "silent" mode. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- runtests.c 8 Oct 2002 17:04:55 -0000 1.36 +++ runtests.c 7 Nov 2002 23:02:26 -0000 1.37 @@ -794,7 +794,7 @@ /* Regression test for SF bug #620343. */ static void start_element_fail(void *userData, - const XML_Char *name, const XML_Char **atts) + const XML_Char *name, const XML_Char **atts) { /* We should never get here. */ fail("should never reach start_element_fail()"); @@ -802,8 +802,8 @@ static void start_ns_clearing_start_element(void *userData, - const XML_Char *prefix, - const XML_Char *uri) + const XML_Char *prefix, + const XML_Char *uri) { XML_SetStartElementHandler((XML_Parser) userData, NULL); } @@ -824,6 +824,63 @@ } END_TEST +/* Regression test for SF bug #616863. */ +static int +external_entity_handler(XML_Parser parser, + const XML_Char *context, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId) +{ + int callno = 1 + (int)XML_GetUserData(parser); + char *text; + XML_Parser p2; + + if (callno == 1) + text = ("\n" + "\n" + "\n"); + else + text = ("" + ""); + + XML_SetUserData(parser, (void *) callno); + p2 = XML_ExternalEntityParserCreate(parser, context, NULL); + if (XML_Parse(p2, text, strlen(text), 1) == XML_STATUS_ERROR) { + xml_failure(p2); + return 0; + } + XML_ParserFree(p2); + return 1; +} + +static void +start_element_dummy(void *userData, + const XML_Char *name, const XML_Char **atts) +{ + return; +} + +START_TEST(test_default_ns_from_ext_subset_and_ext_ge) +{ + char *text = + "\n" + "\n" + "]>\n" + "\n" + "&en;\n" + ""; + + XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS); + XML_SetExternalEntityRefHandler(parser, external_entity_handler); + /* We actually need to set this handler to tickle this bug. */ + XML_SetStartElementHandler(parser, start_element_dummy); + XML_SetUserData(parser, NULL); + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) + xml_failure(parser); +} +END_TEST static Suite * make_basic_suite(void) @@ -871,6 +928,7 @@ tcase_add_test(tc_namespace, test_ns_tagname_overwrite); tcase_add_test(tc_namespace, test_ns_tagname_overwrite_triplet); tcase_add_test(tc_namespace, test_start_ns_clears_start_element); + tcase_add_test(tc_namespace, test_default_ns_from_ext_subset_and_ext_ge); return s; } @@ -909,6 +967,8 @@ } if (forking_set) srunner_set_fork_status(sr, forking ? CK_FORK : CK_NOFORK); + if (verbosity != CK_SILENT) + printf("Expat version: %s\n", XML_ExpatVersion()); srunner_run_all(sr, verbosity); nf = srunner_ntests_failed(sr); srunner_free(sr); From fdrake@users.sourceforge.net Tue Nov 12 19:22:51 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 11:22:51 -0800 Subject: [Expat-checkins] expat/tests runtests.c,1.37,1.38 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv9273 Modified Files: runtests.c Log Message: Added regression test for SF bug #620106: XML_SetEncoding() broken for external entities. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- runtests.c 7 Nov 2002 23:02:26 -0000 1.37 +++ runtests.c 12 Nov 2002 19:22:49 -0000 1.38 @@ -546,6 +546,48 @@ } END_TEST +/* Regression test for SF bug #620106. */ +static int +external_entity_loader_set_encoding(XML_Parser parser, + const XML_Char *context, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId) +{ + /* This text says it's an unsupported encoding, but it's really + UTF-8, which we tell Expat using XML_SetEncoding(). + */ + char *text = + "" + "\xC3\xA9"; + XML_Parser extparser; + + extparser = XML_ExternalEntityParserCreate(parser, context, NULL); + if (extparser == NULL) + fail("Could not create external entity parser."); + if (!XML_SetEncoding(extparser, "utf-8")) + fail("XML_SetEncoding() ignored for external entity"); + if (XML_Parse(extparser, text, strlen(text), 1) == XML_STATUS_ERROR) { + xml_failure(parser); + return 0; + } + return 1; +} + +START_TEST(test_ext_entity_set_encoding) +{ + char *text = + "\n" + "]>\n" + "&en;"; + + XML_SetExternalEntityRefHandler(parser, + external_entity_loader_set_encoding); + run_character_check(text, "\xC3\xA9"); +} +END_TEST + /* Test that no error is reported for unknown entities if we don't read an external subset. This was fixed in Expat 1.95.5. */ @@ -920,6 +962,7 @@ tcase_add_test(tc_basic, test_wfc_undeclared_entity_standalone); tcase_add_test(tc_basic, test_wfc_undeclared_entity_with_external_subset); tcase_add_test(tc_basic, test_wfc_no_recursive_entity_refs); + tcase_add_test(tc_basic, test_ext_entity_set_encoding); suite_add_tcase(s, tc_namespace); tcase_add_checked_fixture(tc_namespace, From fdrake@users.sourceforge.net Tue Nov 12 20:26:08 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 12:26:08 -0800 Subject: [Expat-checkins] expat/tests runtests.c,1.38,1.39 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv19141 Modified Files: runtests.c Log Message: Added regression test for SF bug #483514: Default handler reports handled events. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- runtests.c 12 Nov 2002 19:22:49 -0000 1.38 +++ runtests.c 12 Nov 2002 20:26:05 -0000 1.39 @@ -59,6 +59,70 @@ _expect_failure((text), (errorCode), (errorMessage), \ __FILE__, __LINE__) +/* Dummy handlers for when we need to set a handler to tickle a bug, + but it doesn't need to do anything. +*/ + +static void +dummy_start_doctype_handler(void *userData, + const XML_Char *doctypeName, + const XML_Char *sysid, + const XML_Char *pubid, + int has_internal_subset) +{} + +static void +dummy_end_doctype_handler(void *userData) +{} + +static void +dummy_entity_decl_handler(void *userData, + const XML_Char *entityName, + int is_parameter_entity, + const XML_Char *value, + int value_length, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId, + const XML_Char *notationName) +{} + +static void +dummy_notation_decl_handler(void *userData, + const XML_Char *notationName, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId) +{} + +static void +dummy_element_decl_handler(void *userData, + const XML_Char *name, + XML_Content *model) +{} + +static void +dummy_attlist_decl_handler(void *userData, + const XML_Char *elname, + const XML_Char *attname, + const XML_Char *att_type, + const XML_Char *dflt, + int isrequired) +{} + +static void +dummy_comment_handler(void *userData, const XML_Char *data) +{} + +static void +dummy_pi_handler(void *userData, const XML_Char *target, const XML_Char *data) +{} + +static void +dummy_start_element(void *userData, + const XML_Char *name, const XML_Char **atts) +{} + /* * Character & encoding tests. @@ -680,6 +744,33 @@ } END_TEST +/* Regression test for SF bug #483514. */ +START_TEST(test_dtd_default_handling) +{ + char *text = + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "]>"; + + XML_SetDefaultHandler(parser, accumulate_characters); + XML_SetDoctypeDeclHandler(parser, + dummy_start_doctype_handler, + dummy_end_doctype_handler); + XML_SetEntityDeclHandler(parser, dummy_entity_decl_handler); + XML_SetNotationDeclHandler(parser, dummy_notation_decl_handler); + XML_SetElementDeclHandler(parser, dummy_element_decl_handler); + XML_SetAttlistDeclHandler(parser, dummy_attlist_decl_handler); + XML_SetProcessingInstructionHandler(parser, dummy_pi_handler); + XML_SetCommentHandler(parser, dummy_comment_handler); + run_character_check(text, "\n\n\n\n\n\n\n"); +} +END_TEST + /* * Namespaces tests. @@ -896,13 +987,6 @@ return 1; } -static void -start_element_dummy(void *userData, - const XML_Char *name, const XML_Char **atts) -{ - return; -} - START_TEST(test_default_ns_from_ext_subset_and_ext_ge) { char *text = @@ -917,7 +1001,7 @@ XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS); XML_SetExternalEntityRefHandler(parser, external_entity_handler); /* We actually need to set this handler to tickle this bug. */ - XML_SetStartElementHandler(parser, start_element_dummy); + XML_SetStartElementHandler(parser, dummy_start_element); XML_SetUserData(parser, NULL); if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) xml_failure(parser); @@ -963,6 +1047,7 @@ tcase_add_test(tc_basic, test_wfc_undeclared_entity_with_external_subset); tcase_add_test(tc_basic, test_wfc_no_recursive_entity_refs); tcase_add_test(tc_basic, test_ext_entity_set_encoding); + tcase_add_test(tc_basic, test_dtd_default_handling); suite_add_tcase(s, tc_namespace); tcase_add_checked_fixture(tc_namespace, From fdrake@users.sourceforge.net Tue Nov 12 21:43:18 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 13:43:18 -0800 Subject: [Expat-checkins] expat/lib xmlparse.c,1.94,1.95 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv5144 Modified Files: xmlparse.c Log Message: Remove trailing whitespace. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- xmlparse.c 21 Oct 2002 21:19:41 -0000 1.94 +++ xmlparse.c 12 Nov 2002 21:43:15 -0000 1.95 @@ -358,24 +358,24 @@ static DTD * dtdCreate(const XML_Memory_Handling_Suite *ms); /* do not call if parentParser != NULL */ static void dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms); -static void +static void dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms); -static int +static int dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms); -static int +static int copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *); -static NAMED * +static NAMED * lookup(HASH_TABLE *table, KEY name, size_t createSize); static void FASTCALL hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms); static void FASTCALL hashTableClear(HASH_TABLE *); static void FASTCALL hashTableDestroy(HASH_TABLE *); -static void FASTCALL +static void FASTCALL hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *); static NAMED * FASTCALL hashTableIterNext(HASH_TABLE_ITER *); -static void FASTCALL +static void FASTCALL poolInit(STRING_POOL *, const XML_Memory_Handling_Suite *ms); static void FASTCALL poolClear(STRING_POOL *); static void FASTCALL poolDestroy(STRING_POOL *); @@ -845,7 +845,7 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encodingName) { TAG *tStk; - if (parentParser) + if (parentParser) return XML_FALSE; /* move tagStack to freeTagList */ tStk = tagStack; @@ -934,7 +934,7 @@ XML_Bool oldns_triplets = ns_triplets; #ifdef XML_DTD - if (!context) + if (!context) newDtd = oldDtd; #endif /* XML_DTD */ @@ -1050,10 +1050,10 @@ poolDestroy(&tempPool); poolDestroy(&temp2Pool); #ifdef XML_DTD - /* external parameter entity parsers share the DTD structure - parser->m_dtd with the root parser, so we must not destroy it + /* external parameter entity parsers share the DTD structure + parser->m_dtd with the root parser, so we must not destroy it */ - if (!isParamEntity && _dtd) + if (!isParamEntity && _dtd) #else if (_dtd) #endif /* XML_DTD */ @@ -1347,7 +1347,7 @@ enum XML_ParamEntityParsing peParsing) { /* block after XML_Parse()/XML_ParseBuffer() has been called */ - if (parsing) + if (parsing) return 0; #ifdef XML_DTD paramEntityParsing = peParsing; @@ -1705,7 +1705,7 @@ below it in the stack is already been accounted for in a previous call to this function. */ - if (tag->rawName == rawNameBuf) + if (tag->rawName == rawNameBuf) break; /* For re-use purposes we need to ensure that the size of tag->buf is a multiple of sizeof(XML_Char). @@ -1716,7 +1716,7 @@ if (temp == NULL) return XML_FALSE; /* if tag->name.str points to tag->buf (only when namespace - processing is off) then we have to update it + processing is off) then we have to update it */ if (tag->name.str == (XML_Char *)tag->buf) tag->name.str = (XML_Char *)temp; @@ -1743,9 +1743,9 @@ const char *end, const char **endPtr) { - enum XML_Error result = + enum XML_Error result = doContent(parser, 0, encoding, start, end, endPtr); - if (result != XML_ERROR_NONE) + if (result != XML_ERROR_NONE) return result; if (!storeRawNames(parser)) return XML_ERROR_NO_MEMORY; @@ -1848,9 +1848,9 @@ const char *end, const char **endPtr) { - enum XML_Error result = + enum XML_Error result = doContent(parser, 1, encoding, start, end, endPtr); - if (result != XML_ERROR_NONE) + if (result != XML_ERROR_NONE) return result; if (!storeRawNames(parser)) return XML_ERROR_NO_MEMORY; @@ -3327,7 +3327,7 @@ XML_ROLE_DOCTYPE_SYSTEM_ID, even if startDoctypeDeclHandler was not set, indicating an external subset */ -#ifdef XML_DTD +#ifdef XML_DTD if (doctypeSysid || useForeignDTD) { dtd->hasParamEntityRefs = XML_TRUE; /* when docTypeSysid == NULL */ if (paramEntityParsing && externalEntityRefHandler) { @@ -3336,7 +3336,7 @@ sizeof(ENTITY)); if (!entity) return XML_ERROR_NO_MEMORY; - if (useForeignDTD) + if (useForeignDTD) entity->base = curBase; dtd->paramEntityRead = XML_FALSE; if (!externalEntityRefHandler(externalEntityRefHandlerArg, @@ -3362,10 +3362,10 @@ break; case XML_ROLE_INSTANCE_START: #ifdef XML_DTD - /* if there is no DOCTYPE declaration then now is the + /* if there is no DOCTYPE declaration then now is the last chance to read the foreign DTD */ - if (useForeignDTD) { + if (useForeignDTD) { dtd->hasParamEntityRefs = XML_TRUE; if (paramEntityParsing && externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities, @@ -3388,7 +3388,7 @@ return XML_ERROR_NOT_STANDALONE; /* end of DTD - no need to update dtd->keepProcessing */ } - } + } #endif /* XML_DTD */ processor = contentProcessor; return contentProcessor(parser, s, end, nextPtr); @@ -4082,7 +4082,7 @@ break; } /* end of big switch */ - if (handleDefault && defaultHandler) + if (handleDefault && defaultHandler) reportDefault(parser, enc, s, next); s = next; @@ -4105,7 +4105,7 @@ eventEndPtr = next; switch (tok) { /* report partial linebreak - it might be the last token */ - case -XML_TOK_PROLOG_S: + case -XML_TOK_PROLOG_S: if (defaultHandler) { eventEndPtr = next; reportDefault(parser, encoding, s, next); @@ -5578,7 +5578,7 @@ return next; } -static void +static void build_node(XML_Parser parser, int src_node, XML_Content *dest, From fdrake@users.sourceforge.net Tue Nov 12 21:44:20 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 13:44:20 -0800 Subject: [Expat-checkins] expat/lib expat.h,1.44,1.45 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv5784 Modified Files: expat.h Log Message: Remove trailing whitespace. Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- expat.h 21 Oct 2002 21:19:41 -0000 1.44 +++ expat.h 12 Nov 2002 21:44:18 -0000 1.45 @@ -8,10 +8,10 @@ #ifdef __VMS /* 0 1 2 3 0 1 2 3 1234567890123456789012345678901 1234567890123456789012345678901 */ -#define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler -#define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler -#define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler -#define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg +#define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler +#define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler +#define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler +#define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg #endif #include @@ -32,7 +32,7 @@ extern "C" { #endif -#ifdef XML_UNICODE_WCHAR_T +#ifdef XML_UNICODE_WCHAR_T #define XML_UNICODE #endif @@ -225,7 +225,7 @@ /* Prepare a parser object to be re-used. This is particularly valuable when memory allocation overhead is disproportionatly high, such as when a large number of small documnents need to be parsed. - All handlers are cleared from the parser, except for the + All handlers are cleared from the parser, except for the unknownEncodingHandler. The parser's external state is re-initialized except for the values of ns and ns_triplets. @@ -267,7 +267,7 @@ (comments, markup declarations), or characters that are part of a construct which could be reported but for which no handler has been supplied. The characters are passed exactly as they were in the XML - document except that they will be encoded in UTF-8 or UTF-16. + document except that they will be encoded in UTF-8 or UTF-16. Line boundaries are not normalized. Note that a byte order mark character is not passed to the default handler. There are no guarantees about how characters are divided between calls to the @@ -320,7 +320,7 @@ const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); - + XMLPARSEAPI(void) XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler); From fdrake@users.sourceforge.net Tue Nov 12 21:45:22 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 13:45:22 -0800 Subject: [Expat-checkins] expat/lib xmlrole.h,1.10,1.11 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv6413 Modified Files: xmlrole.h Log Message: Remove trailing whitespace. Index: xmlrole.h =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlrole.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- xmlrole.h 20 Sep 2002 03:42:43 -0000 1.10 +++ xmlrole.h 12 Nov 2002 21:45:20 -0000 1.11 @@ -8,7 +8,7 @@ #ifdef __VMS /* 0 1 2 3 0 1 2 3 1234567890123456789012345678901 1234567890123456789012345678901 */ -#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt +#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt #endif #include "xmltok.h" From fdrake@users.sourceforge.net Tue Nov 12 21:45:59 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 13:45:59 -0800 Subject: [Expat-checkins] expat/lib ascii.h,1.3,1.4 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv6775 Modified Files: ascii.h Log Message: Remove trailing whitespace. Index: ascii.h =================================================================== RCS file: /cvsroot/expat/expat/lib/ascii.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ascii.h 1 Jul 2002 20:44:54 -0000 1.3 +++ ascii.h 12 Nov 2002 21:45:57 -0000 1.4 @@ -68,7 +68,7 @@ #define ASCII_9 0x39 #define ASCII_TAB 0x09 -#define ASCII_SPACE 0x20 +#define ASCII_SPACE 0x20 #define ASCII_EXCL 0x21 #define ASCII_QUOT 0x22 #define ASCII_AMP 0x26 From fdrake@users.sourceforge.net Tue Nov 12 21:48:31 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 13:48:31 -0800 Subject: [Expat-checkins] expat/lib xmltok.c,1.25,1.26 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv8366 Modified Files: xmltok.c Log Message: Remove trailing whitespace. Index: xmltok.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmltok.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- xmltok.c 20 Sep 2002 03:42:43 -0000 1.25 +++ xmltok.c 12 Nov 2002 21:48:29 -0000 1.26 @@ -678,7 +678,7 @@ #define MINBPC(enc) 2 /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ #define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p) -#define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p) +#define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p) #define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c) #define IS_NAME_CHAR(enc, p, n) 0 #define IS_NAME_CHAR_MINBPC(enc, p) LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) @@ -701,7 +701,7 @@ #ifdef XML_NS -static const struct normal_encoding little2_encoding_ns = { +static const struct normal_encoding little2_encoding_ns = { { VTABLE, 2, 0, #if BYTEORDER == 1234 1 @@ -718,7 +718,7 @@ #endif -static const struct normal_encoding little2_encoding = { +static const struct normal_encoding little2_encoding = { { VTABLE, 2, 0, #if BYTEORDER == 1234 1 @@ -739,7 +739,7 @@ #ifdef XML_NS -static const struct normal_encoding internal_little2_encoding_ns = { +static const struct normal_encoding internal_little2_encoding_ns = { { VTABLE, 2, 0, 1 }, { #include "iasciitab.h" @@ -750,7 +750,7 @@ #endif -static const struct normal_encoding internal_little2_encoding = { +static const struct normal_encoding internal_little2_encoding = { { VTABLE, 2, 0, 1 }, { #define BT_COLON BT_NMSTRT @@ -817,7 +817,7 @@ #define MINBPC(enc) 2 /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ #define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p) -#define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p) +#define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p) #define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c) #define IS_NAME_CHAR(enc, p, n) 0 #define IS_NAME_CHAR_MINBPC(enc, p) BIG2_IS_NAME_CHAR_MINBPC(enc, p) @@ -948,7 +948,7 @@ case 0x20: case 0xD: case 0xA: - case 0x9: + case 0x9: return 1; } return 0; From fdrake@users.sourceforge.net Tue Nov 12 21:49:38 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 13:49:38 -0800 Subject: [Expat-checkins] expat/lib xmltok.h,1.7,1.8 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv9131 Modified Files: xmltok.h Log Message: Remove trailing whitespace. Index: xmltok.h =================================================================== RCS file: /cvsroot/expat/expat/lib/xmltok.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- xmltok.h 20 Sep 2002 03:42:43 -0000 1.7 +++ xmltok.h 12 Nov 2002 21:49:36 -0000 1.8 @@ -17,7 +17,7 @@ */ #define XML_TOK_NONE -4 /* The string to be scanned is empty */ #define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; - might be part of CRLF sequence */ + might be part of CRLF sequence */ #define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ #define XML_TOK_PARTIAL -1 /* only part of a token */ #define XML_TOK_INVALID 0 From fdrake@users.sourceforge.net Tue Nov 12 19:22:51 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 11:22:51 -0800 Subject: [Expat-checkins] expat/tests runtests.c,1.37,1.38 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv9273 Modified Files: runtests.c Log Message: Added regression test for SF bug #620106: XML_SetEncoding() broken for external entities. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- runtests.c 7 Nov 2002 23:02:26 -0000 1.37 +++ runtests.c 12 Nov 2002 19:22:49 -0000 1.38 @@ -546,6 +546,48 @@ } END_TEST +/* Regression test for SF bug #620106. */ +static int +external_entity_loader_set_encoding(XML_Parser parser, + const XML_Char *context, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId) +{ + /* This text says it's an unsupported encoding, but it's really + UTF-8, which we tell Expat using XML_SetEncoding(). + */ + char *text = + "" + "\xC3\xA9"; + XML_Parser extparser; + + extparser = XML_ExternalEntityParserCreate(parser, context, NULL); + if (extparser == NULL) + fail("Could not create external entity parser."); + if (!XML_SetEncoding(extparser, "utf-8")) + fail("XML_SetEncoding() ignored for external entity"); + if (XML_Parse(extparser, text, strlen(text), 1) == XML_STATUS_ERROR) { + xml_failure(parser); + return 0; + } + return 1; +} + +START_TEST(test_ext_entity_set_encoding) +{ + char *text = + "\n" + "]>\n" + "&en;"; + + XML_SetExternalEntityRefHandler(parser, + external_entity_loader_set_encoding); + run_character_check(text, "\xC3\xA9"); +} +END_TEST + /* Test that no error is reported for unknown entities if we don't read an external subset. This was fixed in Expat 1.95.5. */ @@ -920,6 +962,7 @@ tcase_add_test(tc_basic, test_wfc_undeclared_entity_standalone); tcase_add_test(tc_basic, test_wfc_undeclared_entity_with_external_subset); tcase_add_test(tc_basic, test_wfc_no_recursive_entity_refs); + tcase_add_test(tc_basic, test_ext_entity_set_encoding); suite_add_tcase(s, tc_namespace); tcase_add_checked_fixture(tc_namespace, From fdrake@users.sourceforge.net Tue Nov 12 20:26:08 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 12:26:08 -0800 Subject: [Expat-checkins] expat/tests runtests.c,1.38,1.39 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv19141 Modified Files: runtests.c Log Message: Added regression test for SF bug #483514: Default handler reports handled events. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- runtests.c 12 Nov 2002 19:22:49 -0000 1.38 +++ runtests.c 12 Nov 2002 20:26:05 -0000 1.39 @@ -59,6 +59,70 @@ _expect_failure((text), (errorCode), (errorMessage), \ __FILE__, __LINE__) +/* Dummy handlers for when we need to set a handler to tickle a bug, + but it doesn't need to do anything. +*/ + +static void +dummy_start_doctype_handler(void *userData, + const XML_Char *doctypeName, + const XML_Char *sysid, + const XML_Char *pubid, + int has_internal_subset) +{} + +static void +dummy_end_doctype_handler(void *userData) +{} + +static void +dummy_entity_decl_handler(void *userData, + const XML_Char *entityName, + int is_parameter_entity, + const XML_Char *value, + int value_length, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId, + const XML_Char *notationName) +{} + +static void +dummy_notation_decl_handler(void *userData, + const XML_Char *notationName, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId) +{} + +static void +dummy_element_decl_handler(void *userData, + const XML_Char *name, + XML_Content *model) +{} + +static void +dummy_attlist_decl_handler(void *userData, + const XML_Char *elname, + const XML_Char *attname, + const XML_Char *att_type, + const XML_Char *dflt, + int isrequired) +{} + +static void +dummy_comment_handler(void *userData, const XML_Char *data) +{} + +static void +dummy_pi_handler(void *userData, const XML_Char *target, const XML_Char *data) +{} + +static void +dummy_start_element(void *userData, + const XML_Char *name, const XML_Char **atts) +{} + /* * Character & encoding tests. @@ -680,6 +744,33 @@ } END_TEST +/* Regression test for SF bug #483514. */ +START_TEST(test_dtd_default_handling) +{ + char *text = + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "]>"; + + XML_SetDefaultHandler(parser, accumulate_characters); + XML_SetDoctypeDeclHandler(parser, + dummy_start_doctype_handler, + dummy_end_doctype_handler); + XML_SetEntityDeclHandler(parser, dummy_entity_decl_handler); + XML_SetNotationDeclHandler(parser, dummy_notation_decl_handler); + XML_SetElementDeclHandler(parser, dummy_element_decl_handler); + XML_SetAttlistDeclHandler(parser, dummy_attlist_decl_handler); + XML_SetProcessingInstructionHandler(parser, dummy_pi_handler); + XML_SetCommentHandler(parser, dummy_comment_handler); + run_character_check(text, "\n\n\n\n\n\n\n"); +} +END_TEST + /* * Namespaces tests. @@ -896,13 +987,6 @@ return 1; } -static void -start_element_dummy(void *userData, - const XML_Char *name, const XML_Char **atts) -{ - return; -} - START_TEST(test_default_ns_from_ext_subset_and_ext_ge) { char *text = @@ -917,7 +1001,7 @@ XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS); XML_SetExternalEntityRefHandler(parser, external_entity_handler); /* We actually need to set this handler to tickle this bug. */ - XML_SetStartElementHandler(parser, start_element_dummy); + XML_SetStartElementHandler(parser, dummy_start_element); XML_SetUserData(parser, NULL); if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) xml_failure(parser); @@ -963,6 +1047,7 @@ tcase_add_test(tc_basic, test_wfc_undeclared_entity_with_external_subset); tcase_add_test(tc_basic, test_wfc_no_recursive_entity_refs); tcase_add_test(tc_basic, test_ext_entity_set_encoding); + tcase_add_test(tc_basic, test_dtd_default_handling); suite_add_tcase(s, tc_namespace); tcase_add_checked_fixture(tc_namespace, From fdrake@users.sourceforge.net Tue Nov 12 21:43:18 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 13:43:18 -0800 Subject: [Expat-checkins] expat/lib xmlparse.c,1.94,1.95 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv5144 Modified Files: xmlparse.c Log Message: Remove trailing whitespace. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- xmlparse.c 21 Oct 2002 21:19:41 -0000 1.94 +++ xmlparse.c 12 Nov 2002 21:43:15 -0000 1.95 @@ -358,24 +358,24 @@ static DTD * dtdCreate(const XML_Memory_Handling_Suite *ms); /* do not call if parentParser != NULL */ static void dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms); -static void +static void dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms); -static int +static int dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms); -static int +static int copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *); -static NAMED * +static NAMED * lookup(HASH_TABLE *table, KEY name, size_t createSize); static void FASTCALL hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms); static void FASTCALL hashTableClear(HASH_TABLE *); static void FASTCALL hashTableDestroy(HASH_TABLE *); -static void FASTCALL +static void FASTCALL hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *); static NAMED * FASTCALL hashTableIterNext(HASH_TABLE_ITER *); -static void FASTCALL +static void FASTCALL poolInit(STRING_POOL *, const XML_Memory_Handling_Suite *ms); static void FASTCALL poolClear(STRING_POOL *); static void FASTCALL poolDestroy(STRING_POOL *); @@ -845,7 +845,7 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encodingName) { TAG *tStk; - if (parentParser) + if (parentParser) return XML_FALSE; /* move tagStack to freeTagList */ tStk = tagStack; @@ -934,7 +934,7 @@ XML_Bool oldns_triplets = ns_triplets; #ifdef XML_DTD - if (!context) + if (!context) newDtd = oldDtd; #endif /* XML_DTD */ @@ -1050,10 +1050,10 @@ poolDestroy(&tempPool); poolDestroy(&temp2Pool); #ifdef XML_DTD - /* external parameter entity parsers share the DTD structure - parser->m_dtd with the root parser, so we must not destroy it + /* external parameter entity parsers share the DTD structure + parser->m_dtd with the root parser, so we must not destroy it */ - if (!isParamEntity && _dtd) + if (!isParamEntity && _dtd) #else if (_dtd) #endif /* XML_DTD */ @@ -1347,7 +1347,7 @@ enum XML_ParamEntityParsing peParsing) { /* block after XML_Parse()/XML_ParseBuffer() has been called */ - if (parsing) + if (parsing) return 0; #ifdef XML_DTD paramEntityParsing = peParsing; @@ -1705,7 +1705,7 @@ below it in the stack is already been accounted for in a previous call to this function. */ - if (tag->rawName == rawNameBuf) + if (tag->rawName == rawNameBuf) break; /* For re-use purposes we need to ensure that the size of tag->buf is a multiple of sizeof(XML_Char). @@ -1716,7 +1716,7 @@ if (temp == NULL) return XML_FALSE; /* if tag->name.str points to tag->buf (only when namespace - processing is off) then we have to update it + processing is off) then we have to update it */ if (tag->name.str == (XML_Char *)tag->buf) tag->name.str = (XML_Char *)temp; @@ -1743,9 +1743,9 @@ const char *end, const char **endPtr) { - enum XML_Error result = + enum XML_Error result = doContent(parser, 0, encoding, start, end, endPtr); - if (result != XML_ERROR_NONE) + if (result != XML_ERROR_NONE) return result; if (!storeRawNames(parser)) return XML_ERROR_NO_MEMORY; @@ -1848,9 +1848,9 @@ const char *end, const char **endPtr) { - enum XML_Error result = + enum XML_Error result = doContent(parser, 1, encoding, start, end, endPtr); - if (result != XML_ERROR_NONE) + if (result != XML_ERROR_NONE) return result; if (!storeRawNames(parser)) return XML_ERROR_NO_MEMORY; @@ -3327,7 +3327,7 @@ XML_ROLE_DOCTYPE_SYSTEM_ID, even if startDoctypeDeclHandler was not set, indicating an external subset */ -#ifdef XML_DTD +#ifdef XML_DTD if (doctypeSysid || useForeignDTD) { dtd->hasParamEntityRefs = XML_TRUE; /* when docTypeSysid == NULL */ if (paramEntityParsing && externalEntityRefHandler) { @@ -3336,7 +3336,7 @@ sizeof(ENTITY)); if (!entity) return XML_ERROR_NO_MEMORY; - if (useForeignDTD) + if (useForeignDTD) entity->base = curBase; dtd->paramEntityRead = XML_FALSE; if (!externalEntityRefHandler(externalEntityRefHandlerArg, @@ -3362,10 +3362,10 @@ break; case XML_ROLE_INSTANCE_START: #ifdef XML_DTD - /* if there is no DOCTYPE declaration then now is the + /* if there is no DOCTYPE declaration then now is the last chance to read the foreign DTD */ - if (useForeignDTD) { + if (useForeignDTD) { dtd->hasParamEntityRefs = XML_TRUE; if (paramEntityParsing && externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities, @@ -3388,7 +3388,7 @@ return XML_ERROR_NOT_STANDALONE; /* end of DTD - no need to update dtd->keepProcessing */ } - } + } #endif /* XML_DTD */ processor = contentProcessor; return contentProcessor(parser, s, end, nextPtr); @@ -4082,7 +4082,7 @@ break; } /* end of big switch */ - if (handleDefault && defaultHandler) + if (handleDefault && defaultHandler) reportDefault(parser, enc, s, next); s = next; @@ -4105,7 +4105,7 @@ eventEndPtr = next; switch (tok) { /* report partial linebreak - it might be the last token */ - case -XML_TOK_PROLOG_S: + case -XML_TOK_PROLOG_S: if (defaultHandler) { eventEndPtr = next; reportDefault(parser, encoding, s, next); @@ -5578,7 +5578,7 @@ return next; } -static void +static void build_node(XML_Parser parser, int src_node, XML_Content *dest, From fdrake@users.sourceforge.net Tue Nov 12 21:44:20 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 13:44:20 -0800 Subject: [Expat-checkins] expat/lib expat.h,1.44,1.45 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv5784 Modified Files: expat.h Log Message: Remove trailing whitespace. Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- expat.h 21 Oct 2002 21:19:41 -0000 1.44 +++ expat.h 12 Nov 2002 21:44:18 -0000 1.45 @@ -8,10 +8,10 @@ #ifdef __VMS /* 0 1 2 3 0 1 2 3 1234567890123456789012345678901 1234567890123456789012345678901 */ -#define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler -#define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler -#define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler -#define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg +#define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler +#define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler +#define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler +#define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg #endif #include @@ -32,7 +32,7 @@ extern "C" { #endif -#ifdef XML_UNICODE_WCHAR_T +#ifdef XML_UNICODE_WCHAR_T #define XML_UNICODE #endif @@ -225,7 +225,7 @@ /* Prepare a parser object to be re-used. This is particularly valuable when memory allocation overhead is disproportionatly high, such as when a large number of small documnents need to be parsed. - All handlers are cleared from the parser, except for the + All handlers are cleared from the parser, except for the unknownEncodingHandler. The parser's external state is re-initialized except for the values of ns and ns_triplets. @@ -267,7 +267,7 @@ (comments, markup declarations), or characters that are part of a construct which could be reported but for which no handler has been supplied. The characters are passed exactly as they were in the XML - document except that they will be encoded in UTF-8 or UTF-16. + document except that they will be encoded in UTF-8 or UTF-16. Line boundaries are not normalized. Note that a byte order mark character is not passed to the default handler. There are no guarantees about how characters are divided between calls to the @@ -320,7 +320,7 @@ const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); - + XMLPARSEAPI(void) XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler); From fdrake@users.sourceforge.net Tue Nov 12 21:45:22 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 13:45:22 -0800 Subject: [Expat-checkins] expat/lib xmlrole.h,1.10,1.11 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv6413 Modified Files: xmlrole.h Log Message: Remove trailing whitespace. Index: xmlrole.h =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlrole.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- xmlrole.h 20 Sep 2002 03:42:43 -0000 1.10 +++ xmlrole.h 12 Nov 2002 21:45:20 -0000 1.11 @@ -8,7 +8,7 @@ #ifdef __VMS /* 0 1 2 3 0 1 2 3 1234567890123456789012345678901 1234567890123456789012345678901 */ -#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt +#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt #endif #include "xmltok.h" From fdrake@users.sourceforge.net Tue Nov 12 21:45:59 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 13:45:59 -0800 Subject: [Expat-checkins] expat/lib ascii.h,1.3,1.4 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv6775 Modified Files: ascii.h Log Message: Remove trailing whitespace. Index: ascii.h =================================================================== RCS file: /cvsroot/expat/expat/lib/ascii.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ascii.h 1 Jul 2002 20:44:54 -0000 1.3 +++ ascii.h 12 Nov 2002 21:45:57 -0000 1.4 @@ -68,7 +68,7 @@ #define ASCII_9 0x39 #define ASCII_TAB 0x09 -#define ASCII_SPACE 0x20 +#define ASCII_SPACE 0x20 #define ASCII_EXCL 0x21 #define ASCII_QUOT 0x22 #define ASCII_AMP 0x26 From fdrake@users.sourceforge.net Tue Nov 12 21:48:31 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 13:48:31 -0800 Subject: [Expat-checkins] expat/lib xmltok.c,1.25,1.26 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv8366 Modified Files: xmltok.c Log Message: Remove trailing whitespace. Index: xmltok.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmltok.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- xmltok.c 20 Sep 2002 03:42:43 -0000 1.25 +++ xmltok.c 12 Nov 2002 21:48:29 -0000 1.26 @@ -678,7 +678,7 @@ #define MINBPC(enc) 2 /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ #define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p) -#define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p) +#define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p) #define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c) #define IS_NAME_CHAR(enc, p, n) 0 #define IS_NAME_CHAR_MINBPC(enc, p) LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) @@ -701,7 +701,7 @@ #ifdef XML_NS -static const struct normal_encoding little2_encoding_ns = { +static const struct normal_encoding little2_encoding_ns = { { VTABLE, 2, 0, #if BYTEORDER == 1234 1 @@ -718,7 +718,7 @@ #endif -static const struct normal_encoding little2_encoding = { +static const struct normal_encoding little2_encoding = { { VTABLE, 2, 0, #if BYTEORDER == 1234 1 @@ -739,7 +739,7 @@ #ifdef XML_NS -static const struct normal_encoding internal_little2_encoding_ns = { +static const struct normal_encoding internal_little2_encoding_ns = { { VTABLE, 2, 0, 1 }, { #include "iasciitab.h" @@ -750,7 +750,7 @@ #endif -static const struct normal_encoding internal_little2_encoding = { +static const struct normal_encoding internal_little2_encoding = { { VTABLE, 2, 0, 1 }, { #define BT_COLON BT_NMSTRT @@ -817,7 +817,7 @@ #define MINBPC(enc) 2 /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ #define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p) -#define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p) +#define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p) #define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c) #define IS_NAME_CHAR(enc, p, n) 0 #define IS_NAME_CHAR_MINBPC(enc, p) BIG2_IS_NAME_CHAR_MINBPC(enc, p) @@ -948,7 +948,7 @@ case 0x20: case 0xD: case 0xA: - case 0x9: + case 0x9: return 1; } return 0; From fdrake@users.sourceforge.net Tue Nov 12 21:49:38 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 12 Nov 2002 13:49:38 -0800 Subject: [Expat-checkins] expat/lib xmltok.h,1.7,1.8 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv9131 Modified Files: xmltok.h Log Message: Remove trailing whitespace. Index: xmltok.h =================================================================== RCS file: /cvsroot/expat/expat/lib/xmltok.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- xmltok.h 20 Sep 2002 03:42:43 -0000 1.7 +++ xmltok.h 12 Nov 2002 21:49:36 -0000 1.8 @@ -17,7 +17,7 @@ */ #define XML_TOK_NONE -4 /* The string to be scanned is empty */ #define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; - might be part of CRLF sequence */ + might be part of CRLF sequence */ #define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ #define XML_TOK_PARTIAL -1 /* only part of a token */ #define XML_TOK_INVALID 0 From fdrake@users.sourceforge.net Wed Nov 20 04:27:34 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 19 Nov 2002 20:27:34 -0800 Subject: [Expat-checkins] expat/lib libexpat.def,1.1,1.2 libexpatw.def,1.1,1.2 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1:/tmp/cvs-serv32124 Modified Files: libexpat.def libexpatw.def Log Message: Make sure all lines end with a newline. Index: libexpat.def =================================================================== RCS file: /cvsroot/expat/expat/lib/libexpat.def,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- libexpat.def 21 Oct 2002 21:19:41 -0000 1.1 +++ libexpat.def 20 Nov 2002 04:27:32 -0000 1.2 @@ -58,4 +58,4 @@ XML_ParserReset @55 XML_SetSkippedEntityHandler @56 XML_GetFeatureList @57 - XML_UseForeignDTD @58 \ No newline at end of file + XML_UseForeignDTD @58 Index: libexpatw.def =================================================================== RCS file: /cvsroot/expat/expat/lib/libexpatw.def,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- libexpatw.def 21 Oct 2002 21:19:41 -0000 1.1 +++ libexpatw.def 20 Nov 2002 04:27:32 -0000 1.2 @@ -58,4 +58,4 @@ XML_ParserReset @55 XML_SetSkippedEntityHandler @56 XML_GetFeatureList @57 - XML_UseForeignDTD @58 \ No newline at end of file + XML_UseForeignDTD @58 From kwaclaw@users.sourceforge.net Wed Nov 20 16:20:12 2002 From: kwaclaw@users.sourceforge.net (Karl Waclawek) Date: Wed, 20 Nov 2002 08:20:12 -0800 Subject: [Expat-checkins] expat/xmlwf readfilemap.c,1.9,1.10 Message-ID: Update of /cvsroot/expat/expat/xmlwf In directory sc8-pr-cvs1:/tmp/cvs-serv28223 Modified Files: readfilemap.c Log Message: Fixed memory leak. Index: readfilemap.c =================================================================== RCS file: /cvsroot/expat/expat/xmlwf/readfilemap.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- readfilemap.c 1 Jul 2002 15:13:01 -0000 1.9 +++ readfilemap.c 20 Nov 2002 16:20:10 -0000 1.10 @@ -61,11 +61,13 @@ n = read(fd, p, nbytes); if (n < 0) { perror(name); + free(p); close(fd); return 0; } if (n != nbytes) { fprintf(stderr, "%s: read unexpected number of bytes\n", name); + free(p); close(fd); return 0; } From fdrake@users.sourceforge.net Wed Nov 27 03:31:25 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 26 Nov 2002 19:31:25 -0800 Subject: [Expat-checkins] expat/lib expat.h,1.45,1.46 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1:/tmp/cvs-serv28201 Modified Files: expat.h Log Message: The feature name pointers should be marked const. This reportedly avoids some warnings on HP-UX using the aCC compiler. Closes SF bug #644461. Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- expat.h 12 Nov 2002 21:44:18 -0000 1.45 +++ expat.h 27 Nov 2002 03:31:23 -0000 1.46 @@ -886,7 +886,7 @@ typedef struct { enum XML_FeatureEnum feature; - XML_LChar *name; + const XML_LChar *name; long int value; } XML_Feature; From fdrake@users.sourceforge.net Wed Nov 27 04:03:35 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 26 Nov 2002 20:03:35 -0800 Subject: [Expat-checkins] expat/lib xmlparse.c,1.95,1.96 xmltok.c,1.26,1.27 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1:/tmp/cvs-serv4039/lib Modified Files: xmlparse.c xmltok.c Log Message: Add some type casts to deal with MALLOC signature checking for some platforms. Closes SF bug #644334. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- xmlparse.c 12 Nov 2002 21:43:15 -0000 1.95 +++ xmlparse.c 27 Nov 2002 04:03:31 -0000 1.96 @@ -673,7 +673,8 @@ if (memsuite) { XML_Memory_Handling_Suite *mtemp; - parser = memsuite->malloc_fcn(sizeof(struct XML_ParserStruct)); + parser = (struct XML_ParserStruct*) + memsuite->malloc_fcn(sizeof(struct XML_ParserStruct)); if (parser != NULL) { mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem); mtemp->malloc_fcn = memsuite->malloc_fcn; @@ -683,7 +684,7 @@ } else { XML_Memory_Handling_Suite *mtemp; - parser = malloc(sizeof(struct XML_ParserStruct)); + parser = (struct XML_ParserStruct*)malloc(sizeof(struct XML_ParserStruct)); if (parser != NULL) { mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem); mtemp->malloc_fcn = malloc; @@ -699,12 +700,12 @@ bufferLim = NULL; attsSize = INIT_ATTS_SIZE; - atts = MALLOC(attsSize * sizeof(ATTRIBUTE)); + atts = (ATTRIBUTE*)MALLOC(attsSize * sizeof(ATTRIBUTE)); if (atts == NULL) { FREE(parser); return NULL; } - dataBuf = MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); + dataBuf = (XML_Char*)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); if (dataBuf == NULL) { FREE(atts); FREE(parser); @@ -1397,7 +1398,9 @@ if (buffer == NULL || nLeftOver > bufferLim - buffer) { /* FIXME avoid integer overflow */ char *temp; - temp = buffer == NULL ? MALLOC(len * 2) : REALLOC(buffer, len * 2); + temp = (buffer == NULL + ? (char*)MALLOC(len * 2) + : (char*)REALLOC(buffer, len * 2)); if (temp == NULL) { errorCode = XML_ERROR_NO_MEMORY; return XML_STATUS_ERROR; @@ -1485,7 +1488,7 @@ do { bufferSize *= 2; } while (bufferSize < neededSize); - newBuf = MALLOC(bufferSize); + newBuf = (char*)MALLOC(bufferSize); if (newBuf == 0) { errorCode = XML_ERROR_NO_MEMORY; return NULL; @@ -1712,7 +1715,7 @@ */ bufSize = nameLen + ROUND_UP(tag->rawNameLength, sizeof(XML_Char)); if (bufSize > tag->bufEnd - tag->buf) { - char *temp = REALLOC(tag->buf, bufSize); + char *temp = (char*)REALLOC(tag->buf, bufSize); if (temp == NULL) return XML_FALSE; /* if tag->name.str points to tag->buf (only when namespace @@ -2001,7 +2004,7 @@ entity->open = XML_FALSE; if (!context) return XML_ERROR_NO_MEMORY; - if (!externalEntityRefHandler(externalEntityRefHandlerArg, + if (!externalEntityRefHandler((XML_Parser)externalEntityRefHandlerArg, context, entity->base, entity->systemId, @@ -2030,10 +2033,10 @@ freeTagList = freeTagList->parent; } else { - tag = MALLOC(sizeof(TAG)); + tag = (TAG*)MALLOC(sizeof(TAG)); if (!tag) return XML_ERROR_NO_MEMORY; - tag->buf = MALLOC(INIT_TAG_BUF_SIZE); + tag->buf = (char*)MALLOC(INIT_TAG_BUF_SIZE); if (!tag->buf) { FREE(tag); return XML_ERROR_NO_MEMORY; @@ -2065,7 +2068,7 @@ } bufSize = (tag->bufEnd - tag->buf) << 1; { - char *temp = REALLOC(tag->buf, bufSize); + char *temp = (char*)REALLOC(tag->buf, bufSize); if (temp == NULL) return XML_ERROR_NO_MEMORY; tag->buf = temp; @@ -2353,7 +2356,7 @@ int oldAttsSize = attsSize; ATTRIBUTE *temp; attsSize = n + nDefaultAtts + INIT_ATTS_SIZE; - temp = REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE)); + temp = (ATTRIBUTE *)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE)); if (temp == NULL) return XML_ERROR_NO_MEMORY; atts = temp; @@ -2546,7 +2549,7 @@ n = i + binding->uriLen + prefixLen; if (n > binding->uriAlloc) { TAG *p; - uri = MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char)); + uri = (XML_Char *)MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char)); if (!uri) return XML_ERROR_NO_MEMORY; binding->uriAlloc = n + EXPAND_SPARE; @@ -2584,7 +2587,7 @@ if (freeBindingList) { b = freeBindingList; if (len > b->uriAlloc) { - XML_Char *temp = REALLOC(b->uri, + XML_Char *temp = (XML_Char*)REALLOC(b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE)); if (temp == NULL) return 0; @@ -2594,10 +2597,10 @@ freeBindingList = b->nextTagBinding; } else { - b = MALLOC(sizeof(BINDING)); + b = (BINDING*)MALLOC(sizeof(BINDING)); if (!b) return 0; - b->uri = MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE)); + b->uri = (XML_Char*)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE)); if (!b->uri) { FREE(b); return 0; @@ -3795,19 +3798,20 @@ case XML_ROLE_GROUP_OPEN: if (prologState.level >= groupSize) { if (groupSize) { - char *temp = REALLOC(groupConnector, groupSize *= 2); + char *temp = (char*)REALLOC(groupConnector, groupSize *= 2); if (temp == NULL) return XML_ERROR_NO_MEMORY; groupConnector = temp; if (dtd->scaffIndex) { - int *temp = REALLOC(dtd->scaffIndex, groupSize * sizeof(int)); + int *temp = (int*)REALLOC(dtd->scaffIndex, + groupSize * sizeof(int)); if (temp == NULL) return XML_ERROR_NO_MEMORY; dtd->scaffIndex = temp; } } else { - groupConnector = MALLOC(groupSize = 32); + groupConnector = (char*)MALLOC(groupSize = 32); if (!groupConnector) return XML_ERROR_NO_MEMORY; } @@ -4636,7 +4640,7 @@ if (type->nDefaultAtts == type->allocDefaultAtts) { if (type->allocDefaultAtts == 0) { type->allocDefaultAtts = 8; - type->defaultAtts = MALLOC(type->allocDefaultAtts + type->defaultAtts = (DEFAULT_ATTRIBUTE*)MALLOC(type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); if (!type->defaultAtts) return 0; @@ -4644,7 +4648,8 @@ else { DEFAULT_ATTRIBUTE *temp; int count = type->allocDefaultAtts * 2; - temp = REALLOC(type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE))); + temp = (DEFAULT_ATTRIBUTE*) + REALLOC(type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE))); if (temp == NULL) return 0; type->allocDefaultAtts = count; @@ -5246,7 +5251,7 @@ if (!createSize) return NULL; tsize = INIT_SIZE * sizeof(NAMED *); - table->v = table->mem->malloc_fcn(tsize); + table->v = (NAMED**)table->mem->malloc_fcn(tsize); if (!table->v) return NULL; memset(table->v, 0, tsize); @@ -5268,7 +5273,7 @@ /* check for overflow */ size_t newSize = table->size * 2; size_t tsize = newSize * sizeof(NAMED *); - NAMED **newV = table->mem->malloc_fcn(tsize); + NAMED **newV = (NAMED**)table->mem->malloc_fcn(tsize); if (!newV) return NULL; memset(newV, 0, tsize); @@ -5291,7 +5296,7 @@ ; } } - table->v[i] = table->mem->malloc_fcn(createSize); + table->v[i] = (NAMED*)table->mem->malloc_fcn(createSize); if (!table->v[i]) return NULL; memset(table->v[i], 0, createSize); @@ -5497,9 +5502,10 @@ } if (pool->blocks && pool->start == pool->blocks->s) { int blockSize = (pool->end - pool->start)*2; - pool->blocks = pool->mem->realloc_fcn(pool->blocks, - offsetof(BLOCK, s) - + blockSize * sizeof(XML_Char)); + pool->blocks = (BLOCK*) + pool->mem->realloc_fcn(pool->blocks, + (offsetof(BLOCK, s) + + blockSize * sizeof(XML_Char))); if (pool->blocks == NULL) return XML_FALSE; pool->blocks->size = blockSize; @@ -5514,8 +5520,8 @@ blockSize = INIT_BLOCK_SIZE; else blockSize *= 2; - tem = pool->mem->malloc_fcn(offsetof(BLOCK, s) - + blockSize * sizeof(XML_Char)); + tem = (BLOCK*)pool->mem->malloc_fcn(offsetof(BLOCK, s) + + blockSize * sizeof(XML_Char)); if (!tem) return XML_FALSE; tem->size = blockSize; @@ -5539,7 +5545,7 @@ int next; if (!dtd->scaffIndex) { - dtd->scaffIndex = MALLOC(groupSize * sizeof(int)); + dtd->scaffIndex = (int*)MALLOC(groupSize * sizeof(int)); if (!dtd->scaffIndex) return -1; dtd->scaffIndex[0] = 0; @@ -5555,7 +5561,8 @@ dtd->scaffSize *= 2; } else { - temp = MALLOC(INIT_SCAFFOLD_ELEMENTS * sizeof(CONTENT_SCAFFOLD)); + temp = (CONTENT_SCAFFOLD *)MALLOC(INIT_SCAFFOLD_ELEMENTS + * sizeof(CONTENT_SCAFFOLD)); if (temp == NULL) return -1; dtd->scaffSize = INIT_SCAFFOLD_ELEMENTS; @@ -5626,7 +5633,7 @@ int allocsize = (dtd->scaffCount * sizeof(XML_Content) + (dtd->contentStringLen * sizeof(XML_Char))); - ret = MALLOC(allocsize); + ret = (XML_Content *)MALLOC(allocsize); if (!ret) return NULL; Index: xmltok.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmltok.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- xmltok.c 12 Nov 2002 21:48:29 -0000 1.26 +++ xmltok.c 27 Nov 2002 04:03:33 -0000 1.27 @@ -1334,7 +1334,7 @@ void *userData) { int i; - struct unknown_encoding *e = mem; + struct unknown_encoding *e = (struct unknown_encoding *)mem; for (i = 0; i < (int)sizeof(struct normal_encoding); i++) ((char *)mem)[i] = ((char *)&latin1_encoding)[i]; for (i = 0; i < 128; i++) From kwaclaw@users.sourceforge.net Wed Nov 27 17:11:45 2002 From: kwaclaw@users.sourceforge.net (Karl Waclawek) Date: Wed, 27 Nov 2002 09:11:45 -0800 Subject: [Expat-checkins] expat/lib xmlparse.c,1.96,1.97 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1:/tmp/cvs-serv5318 Modified Files: xmlparse.c Log Message: Added additional patch for bug #644334. Includes workaround for bad API typedef of externalEntityRefHandler. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- xmlparse.c 27 Nov 2002 04:03:31 -0000 1.96 +++ xmlparse.c 27 Nov 2002 17:11:32 -0000 1.97 @@ -452,7 +452,7 @@ XML_EndNamespaceDeclHandler m_endNamespaceDeclHandler; XML_NotStandaloneHandler m_notStandaloneHandler; XML_ExternalEntityRefHandler m_externalEntityRefHandler; - void *m_externalEntityRefHandlerArg; + XML_Parser m_externalEntityRefHandlerArg; XML_SkippedEntityHandler m_skippedEntityHandler; XML_UnknownEncodingHandler m_unknownEncodingHandler; XML_ElementDeclHandler m_elementDeclHandler; @@ -673,7 +673,7 @@ if (memsuite) { XML_Memory_Handling_Suite *mtemp; - parser = (struct XML_ParserStruct*) + parser = (XML_Parser) memsuite->malloc_fcn(sizeof(struct XML_ParserStruct)); if (parser != NULL) { mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem); @@ -684,7 +684,7 @@ } else { XML_Memory_Handling_Suite *mtemp; - parser = (struct XML_ParserStruct*)malloc(sizeof(struct XML_ParserStruct)); + parser = (XML_Parser)malloc(sizeof(struct XML_ParserStruct)); if (parser != NULL) { mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem); mtemp->malloc_fcn = malloc; @@ -700,12 +700,12 @@ bufferLim = NULL; attsSize = INIT_ATTS_SIZE; - atts = (ATTRIBUTE*)MALLOC(attsSize * sizeof(ATTRIBUTE)); + atts = (ATTRIBUTE *)MALLOC(attsSize * sizeof(ATTRIBUTE)); if (atts == NULL) { FREE(parser); return NULL; } - dataBuf = (XML_Char*)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); + dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); if (dataBuf == NULL) { FREE(atts); FREE(parser); @@ -927,9 +927,9 @@ void *oldUserData = userData; void *oldHandlerArg = handlerArg; XML_Bool oldDefaultExpandInternalEntities = defaultExpandInternalEntities; - void *oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg; + XML_Parser oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg; #ifdef XML_DTD - int oldParamEntityParsing = paramEntityParsing; + enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing; int oldInEntityValue = prologState.inEntityValue; #endif XML_Bool oldns_triplets = ns_triplets; @@ -1295,7 +1295,7 @@ XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg) { if (arg) - externalEntityRefHandlerArg = arg; + externalEntityRefHandlerArg = (XML_Parser)arg; else externalEntityRefHandlerArg = parser; } @@ -1399,8 +1399,8 @@ /* FIXME avoid integer overflow */ char *temp; temp = (buffer == NULL - ? (char*)MALLOC(len * 2) - : (char*)REALLOC(buffer, len * 2)); + ? (char *)MALLOC(len * 2) + : (char *)REALLOC(buffer, len * 2)); if (temp == NULL) { errorCode = XML_ERROR_NO_MEMORY; return XML_STATUS_ERROR; @@ -1488,7 +1488,7 @@ do { bufferSize *= 2; } while (bufferSize < neededSize); - newBuf = (char*)MALLOC(bufferSize); + newBuf = (char *)MALLOC(bufferSize); if (newBuf == 0) { errorCode = XML_ERROR_NO_MEMORY; return NULL; @@ -1715,7 +1715,7 @@ */ bufSize = nameLen + ROUND_UP(tag->rawNameLength, sizeof(XML_Char)); if (bufSize > tag->bufEnd - tag->buf) { - char *temp = (char*)REALLOC(tag->buf, bufSize); + char *temp = (char *)REALLOC(tag->buf, bufSize); if (temp == NULL) return XML_FALSE; /* if tag->name.str points to tag->buf (only when namespace @@ -2033,10 +2033,10 @@ freeTagList = freeTagList->parent; } else { - tag = (TAG*)MALLOC(sizeof(TAG)); + tag = (TAG *)MALLOC(sizeof(TAG)); if (!tag) return XML_ERROR_NO_MEMORY; - tag->buf = (char*)MALLOC(INIT_TAG_BUF_SIZE); + tag->buf = (char *)MALLOC(INIT_TAG_BUF_SIZE); if (!tag->buf) { FREE(tag); return XML_ERROR_NO_MEMORY; @@ -2068,7 +2068,7 @@ } bufSize = (tag->bufEnd - tag->buf) << 1; { - char *temp = (char*)REALLOC(tag->buf, bufSize); + char *temp = (char *)REALLOC(tag->buf, bufSize); if (temp == NULL) return XML_ERROR_NO_MEMORY; tag->buf = temp; @@ -2587,8 +2587,8 @@ if (freeBindingList) { b = freeBindingList; if (len > b->uriAlloc) { - XML_Char *temp = (XML_Char*)REALLOC(b->uri, - sizeof(XML_Char) * (len + EXPAND_SPARE)); + XML_Char *temp = (XML_Char *)REALLOC(b->uri, + sizeof(XML_Char) * (len + EXPAND_SPARE)); if (temp == NULL) return 0; b->uri = temp; @@ -2597,10 +2597,10 @@ freeBindingList = b->nextTagBinding; } else { - b = (BINDING*)MALLOC(sizeof(BINDING)); + b = (BINDING *)MALLOC(sizeof(BINDING)); if (!b) return 0; - b->uri = (XML_Char*)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE)); + b->uri = (XML_Char *)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE)); if (!b->uri) { FREE(b); return 0; @@ -3798,20 +3798,20 @@ case XML_ROLE_GROUP_OPEN: if (prologState.level >= groupSize) { if (groupSize) { - char *temp = (char*)REALLOC(groupConnector, groupSize *= 2); + char *temp = (char *)REALLOC(groupConnector, groupSize *= 2); if (temp == NULL) return XML_ERROR_NO_MEMORY; groupConnector = temp; if (dtd->scaffIndex) { - int *temp = (int*)REALLOC(dtd->scaffIndex, - groupSize * sizeof(int)); + int *temp = (int *)REALLOC(dtd->scaffIndex, + groupSize * sizeof(int)); if (temp == NULL) return XML_ERROR_NO_MEMORY; dtd->scaffIndex = temp; } } else { - groupConnector = (char*)MALLOC(groupSize = 32); + groupConnector = (char *)MALLOC(groupSize = 32); if (!groupConnector) return XML_ERROR_NO_MEMORY; } @@ -4640,16 +4640,16 @@ if (type->nDefaultAtts == type->allocDefaultAtts) { if (type->allocDefaultAtts == 0) { type->allocDefaultAtts = 8; - type->defaultAtts = (DEFAULT_ATTRIBUTE*)MALLOC(type->allocDefaultAtts - * sizeof(DEFAULT_ATTRIBUTE)); + type->defaultAtts = (DEFAULT_ATTRIBUTE *)MALLOC(type->allocDefaultAtts + * sizeof(DEFAULT_ATTRIBUTE)); if (!type->defaultAtts) return 0; } else { DEFAULT_ATTRIBUTE *temp; int count = type->allocDefaultAtts * 2; - temp = (DEFAULT_ATTRIBUTE*) - REALLOC(type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE))); + temp = (DEFAULT_ATTRIBUTE *) + REALLOC(type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE))); if (temp == NULL) return 0; type->allocDefaultAtts = count; @@ -4912,7 +4912,7 @@ static DTD * dtdCreate(const XML_Memory_Handling_Suite *ms) { - DTD *p = ms->malloc_fcn(sizeof(DTD)); + DTD *p = (DTD *)ms->malloc_fcn(sizeof(DTD)); if (p == NULL) return p; poolInit(&(p->pool), ms); @@ -5251,7 +5251,7 @@ if (!createSize) return NULL; tsize = INIT_SIZE * sizeof(NAMED *); - table->v = (NAMED**)table->mem->malloc_fcn(tsize); + table->v = (NAMED **)table->mem->malloc_fcn(tsize); if (!table->v) return NULL; memset(table->v, 0, tsize); @@ -5273,7 +5273,7 @@ /* check for overflow */ size_t newSize = table->size * 2; size_t tsize = newSize * sizeof(NAMED *); - NAMED **newV = (NAMED**)table->mem->malloc_fcn(tsize); + NAMED **newV = (NAMED **)table->mem->malloc_fcn(tsize); if (!newV) return NULL; memset(newV, 0, tsize); @@ -5296,7 +5296,7 @@ ; } } - table->v[i] = (NAMED*)table->mem->malloc_fcn(createSize); + table->v[i] = (NAMED *)table->mem->malloc_fcn(createSize); if (!table->v[i]) return NULL; memset(table->v[i], 0, createSize); @@ -5502,7 +5502,7 @@ } if (pool->blocks && pool->start == pool->blocks->s) { int blockSize = (pool->end - pool->start)*2; - pool->blocks = (BLOCK*) + pool->blocks = (BLOCK *) pool->mem->realloc_fcn(pool->blocks, (offsetof(BLOCK, s) + blockSize * sizeof(XML_Char))); @@ -5520,7 +5520,7 @@ blockSize = INIT_BLOCK_SIZE; else blockSize *= 2; - tem = (BLOCK*)pool->mem->malloc_fcn(offsetof(BLOCK, s) + tem = (BLOCK *)pool->mem->malloc_fcn(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); if (!tem) return XML_FALSE; @@ -5545,7 +5545,7 @@ int next; if (!dtd->scaffIndex) { - dtd->scaffIndex = (int*)MALLOC(groupSize * sizeof(int)); + dtd->scaffIndex = (int *)MALLOC(groupSize * sizeof(int)); if (!dtd->scaffIndex) return -1; dtd->scaffIndex[0] = 0;