From kwaclaw at users.sourceforge.net Fri Mar 7 07:54:14 2003 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Fri Mar 7 10:54:19 2003 Subject: [Expat-checkins] expat/lib expat.h,1.51,1.52 xmlparse.c,1.108,1.109 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1:/tmp/cvs-serv22062 Modified Files: expat.h xmlparse.c Log Message: Apply patch NSAttFix3.diff for bug #692964 (with one minor modification). This also fixes bug #695401. Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- expat.h 29 Jan 2003 02:43:08 -0000 1.51 +++ expat.h 7 Mar 2003 15:54:06 -0000 1.52 @@ -104,7 +104,8 @@ XML_ERROR_UNEXPECTED_STATE, XML_ERROR_ENTITY_DECLARED_IN_PE, XML_ERROR_FEATURE_REQUIRES_XML_DTD, - XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING + XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING, + XML_ERROR_UNBOUND_PREFIX }; enum XML_Content_Type { Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.108 retrieving revision 1.109 diff -u -d -r1.108 -r1.109 --- xmlparse.c 3 Feb 2003 20:32:45 -0000 1.108 +++ xmlparse.c 7 Mar 2003 15:54:08 -0000 1.109 @@ -224,6 +224,11 @@ } DEFAULT_ATTRIBUTE; typedef struct { + unsigned long hash; + const XML_Char *uriName; +} NS_ATT; + +typedef struct { const XML_Char *name; PREFIX *prefix; const ATTRIBUTE_ID *idAtt; @@ -499,6 +504,8 @@ int m_nSpecifiedAtts; int m_idAttIndex; ATTRIBUTE *m_atts; + NS_ATT *m_nsAtts; + int m_nsAttsSize; POSITION m_position; STRING_POOL m_tempPool; STRING_POOL m_temp2Pool; @@ -601,6 +608,8 @@ #define attsSize (parser->m_attsSize) #define nSpecifiedAtts (parser->m_nSpecifiedAtts) #define idAttIndex (parser->m_idAttIndex) +#define nsAtts (parser->m_nsAtts) +#define nsAttsSize (parser->m_nsAttsSize) #define tempPool (parser->m_tempPool) #define temp2Pool (parser->m_temp2Pool) #define groupConnector (parser->m_groupConnector) @@ -747,6 +756,9 @@ ns = XML_FALSE; ns_triplets = XML_FALSE; + nsAtts = NULL; + nsAttsSize = 0; + poolInit(&tempPool, &(parser->m_mem)); poolInit(&temp2Pool, &(parser->m_mem)); parserInit(parser, encodingName); @@ -868,8 +880,7 @@ freeTagList = tag; } moveToFreeBindingList(parser, inheritedBindings); - if (unknownEncodingMem) - FREE(unknownEncodingMem); + FREE(unknownEncodingMem); if (unknownEncodingRelease) unknownEncodingRelease(unknownEncodingData); poolClear(&tempPool); @@ -1072,13 +1083,11 @@ #endif /* XML_DTD */ dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem); FREE((void *)atts); - if (groupConnector) - FREE(groupConnector); - if (buffer) - FREE(buffer); + FREE(groupConnector); + FREE(buffer); FREE(dataBuf); - if (unknownEncodingMem) - FREE(unknownEncodingMem); + FREE(nsAtts); + FREE(unknownEncodingMem); if (unknownEncodingRelease) unknownEncodingRelease(unknownEncodingData); FREE(parser); @@ -1660,7 +1669,8 @@ XML_L("unexpected parser state - please send a bug report"), XML_L("entity declared in parameter entity"), XML_L("requested feature requires XML_DTD support in Expat"), - XML_L("cannot change setting once parsing has begun") + XML_L("cannot change setting once parsing has begun"), + XML_L("unbound prefix") }; if (code > 0 && code < sizeof(message)/sizeof(message[0])) return message[code]; @@ -2409,7 +2419,7 @@ + XmlNameLength(enc, atts[i].name)); if (!attId) return XML_ERROR_NO_MEMORY; - /* detect duplicate attributes */ + /* detect duplicate attributes by their QNames */ if ((attId->name)[-1]) { if (enc == encoding) eventPtr = atts[i].name; @@ -2509,48 +2519,88 @@ } appAtts[attIndex] = 0; + /* expand prefixed attribute names and + clear flags that say whether attributes were specified */ i = 0; if (nPrefixes) { - /* expand prefixed attribute names */ + int j; + if ((nPrefixes * 2) > nsAttsSize) { + NS_ATT *temp = (NS_ATT *)REALLOC(nsAtts, nPrefixes * 2 * sizeof(NS_ATT)); + if (!temp) + return XML_ERROR_NO_MEMORY; + nsAtts = temp; + nsAttsSize = nPrefixes * 2; + } + /* clear nsAtts hash table */ + for (j = 0; j < nsAttsSize; j++) + nsAtts[j].uriName = NULL; + for (; i < attIndex; i += 2) { - if (appAtts[i][-1] == 2) { + const XML_Char *s = appAtts[i]; + if (s[-1] == 2) { ATTRIBUTE_ID *id; - ((XML_Char *)(appAtts[i]))[-1] = 0; - id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, appAtts[i], 0); - if (id->prefix->binding) { - int j; - const BINDING *b = id->prefix->binding; - const XML_Char *s = appAtts[i]; - for (j = 0; j < b->uriLen; j++) { - if (!poolAppendChar(&tempPool, b->uri[j])) - return XML_ERROR_NO_MEMORY; + const BINDING *b; + unsigned long uriHash = 0; + ((XML_Char *)s)[-1] = 0; + id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, s, 0); + b = id->prefix->binding; + if (!b) + return XML_ERROR_UNBOUND_PREFIX; + + /* b->uri includes namespace separator */ + for (j = 0; j < b->uriLen; j++) { + const XML_Char c = b->uri[j]; + if (!poolAppendChar(&tempPool, c)) + return XML_ERROR_NO_MEMORY; + uriHash = (uriHash << 5) + uriHash + (unsigned char)c; + } + while (*s++ != XML_T(':')) + ; + do { + const XML_Char c = *s; + if (!poolAppendChar(&tempPool, *s)) + return XML_ERROR_NO_MEMORY; + uriHash = (uriHash << 5) + uriHash + (unsigned char)c; + } while (*s++); + + /* detect duplicate attributes based on uriName = uri + local name */ + for (j = uriHash & (nsAttsSize - 1); + nsAtts[j].uriName; + j == 0 ? j = nsAttsSize - 1 : --j) { + if (uriHash == nsAtts[j].hash) { + const XML_Char *s1 = poolStart(&tempPool); /* null-terminated */ + const XML_Char *s2 = nsAtts[j].uriName; + for (; *s1 == *s2 && *s1 != 0; s1++, s2++); + if (*s1 == 0) + return XML_ERROR_DUPLICATE_ATTRIBUTE; } - while (*s++ != XML_T(':')) - ; + } + + if (ns_triplets) { + tempPool.ptr[-1] = namespaceSeparator; + s = b->prefix->name; do { if (!poolAppendChar(&tempPool, *s)) return XML_ERROR_NO_MEMORY; } while (*s++); - if (ns_triplets) { - tempPool.ptr[-1] = namespaceSeparator; - s = b->prefix->name; - do { - if (!poolAppendChar(&tempPool, *s)) - return XML_ERROR_NO_MEMORY; - } while (*s++); - } - - appAtts[i] = poolStart(&tempPool); - poolFinish(&tempPool); } + + s = poolStart(&tempPool); + appAtts[i] = s; + poolFinish(&tempPool); + + /* fill empty slot with new attribute */ + nsAtts[j].hash = uriHash; + nsAtts[j].uriName = s; + if (!--nPrefixes) break; } else - ((XML_Char *)(appAtts[i]))[-1] = 0; + ((XML_Char *)s)[-1] = 0; } } - /* clear the flags that say whether attributes were specified */ + /* clear flags for the remaining attributes */ for (; i < attIndex; i += 2) ((XML_Char *)(appAtts[i]))[-1] = 0; for (binding = *bindingsPtr; binding; binding = binding->nextTagBinding) @@ -2560,7 +2610,7 @@ if (elementType->prefix) { binding = elementType->prefix->binding; if (!binding) - return XML_ERROR_NONE; + return XML_ERROR_UNBOUND_PREFIX; localPart = tagNamePtr->str; while (*localPart++ != XML_T(':')) ; @@ -2599,8 +2649,9 @@ uri = binding->uri + binding->uriLen; memcpy(uri, localPart, i * sizeof(XML_Char)); if (prefixLen) { - uri = uri + (i - 1); - if (namespaceSeparator) { *(uri) = namespaceSeparator; } + uri = uri + (i - 1); + if (namespaceSeparator) + *uri = namespaceSeparator; memcpy(uri + 1, binding->prefix->name, prefixLen * sizeof(XML_Char)); } tagNamePtr->str = binding->uri; @@ -2655,6 +2706,7 @@ b->prefix = prefix; b->attId = attId; b->prevPrefixBinding = prefix->binding; + /* NULL binding when default namespace undeclared */ if (*uri == XML_T('\0') && prefix == &_dtd->defaultPrefix) prefix->binding = NULL; else @@ -3502,8 +3554,8 @@ case XML_ROLE_REQUIRED_ATTRIBUTE_VALUE: if (dtd->keepProcessing) { if (!defineAttribute(declElementType, declAttributeId, - declAttributeIsCdata, declAttributeIsId, 0, - parser)) + declAttributeIsCdata, declAttributeIsId, + 0, parser)) return XML_ERROR_NO_MEMORY; if (attlistDeclHandler && declAttributeType) { if (*declAttributeType == XML_T('(') @@ -3529,11 +3581,11 @@ case XML_ROLE_FIXED_ATTRIBUTE_VALUE: if (dtd->keepProcessing) { const XML_Char *attVal; - enum XML_Error result - = storeAttributeValue(parser, enc, declAttributeIsCdata, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar, - &dtd->pool); + enum XML_Error result = + storeAttributeValue(parser, enc, declAttributeIsCdata, + s + enc->minBytesPerChar, + next - enc->minBytesPerChar, + &dtd->pool); if (result) return result; attVal = poolStart(&dtd->pool); @@ -4749,6 +4801,7 @@ name = poolStoreString(&dtd->pool, enc, start, end); if (!name) return NULL; + /* skip quotation mark - its storage will be re-used (like in name[-1]) */ ++name; id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, name, sizeof(ATTRIBUTE_ID)); if (!id) @@ -4774,6 +4827,7 @@ else { int i; for (i = 0; name[i]; i++) { + /* attributes without prefix are *not* in the default namespace */ if (name[i] == XML_T(':')) { int j; for (j = 0; j < i; j++) { @@ -5013,14 +5067,12 @@ p->defaultPrefix.binding = NULL; p->in_eldecl = XML_FALSE; - if (p->scaffIndex) { - ms->free_fcn(p->scaffIndex); - p->scaffIndex = NULL; - } - if (p->scaffold) { - ms->free_fcn(p->scaffold); - p->scaffold = NULL; - } + + ms->free_fcn(p->scaffIndex); + p->scaffIndex = NULL; + ms->free_fcn(p->scaffold); + p->scaffold = NULL; + p->scaffLevel = 0; p->scaffSize = 0; p->scaffCount = 0; @@ -5055,10 +5107,8 @@ poolDestroy(&(p->entityValuePool)); #endif /* XML_DTD */ if (isDocEntity) { - if (p->scaffIndex) - ms->free_fcn(p->scaffIndex); - if (p->scaffold) - ms->free_fcn(p->scaffold); + ms->free_fcn(p->scaffIndex); + ms->free_fcn(p->scaffold); } ms->free_fcn(p); } @@ -5264,13 +5314,13 @@ #define INIT_SIZE 64 -static int FASTCALL +static XML_Bool FASTCALL keyeq(KEY s1, KEY s2) { for (; *s1 == *s2; s1++, s2++) if (*s1 == 0) - return 1; - return 0; + return XML_TRUE; + return XML_FALSE; } static unsigned long FASTCALL @@ -5351,11 +5401,8 @@ { size_t i; for (i = 0; i < table->size; i++) { - NAMED *p = table->v[i]; - if (p) { - table->mem->free_fcn(p); - table->v[i] = NULL; - } + table->mem->free_fcn(table->v[i]); + table->v[i] = NULL; } table->usedLim = table->size / 2; table->used = 0; @@ -5365,13 +5412,9 @@ hashTableDestroy(HASH_TABLE *table) { size_t i; - for (i = 0; i < table->size; i++) { - NAMED *p = table->v[i]; - if (p) - table->mem->free_fcn(p); - } - if (table->v) - table->mem->free_fcn(table->v); + for (i = 0; i < table->size; i++) + table->mem->free_fcn(table->v[i]); + table->mem->free_fcn(table->v); } static void FASTCALL @@ -5709,3 +5752,4 @@ } return ret; } + From fdrake at users.sourceforge.net Wed Mar 12 11:17:21 2003 From: fdrake at users.sourceforge.net (Fred L. Drake) Date: Wed Mar 12 14:17:25 2003 Subject: [Expat-checkins] expat/tests runtests.c,1.48,1.49 Message-ID: Update of /cvsroot/expat/expat/tests In directory sc8-pr-cvs1:/tmp/cvs-serv30236 Modified Files: runtests.c Log Message: Add regression tests for SF bugs: #692964 - Case where expat 1.95.6 doesn't report duplicate attributes #695401 - Unbound prefixes not rejected Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- runtests.c 28 Jan 2003 05:33:37 -0000 1.48 +++ runtests.c 12 Mar 2003 19:17:18 -0000 1.49 @@ -1254,6 +1254,36 @@ } END_TEST +/* Regression test for SF bug #692964: two prefixes for one namespace. */ +START_TEST(test_ns_duplicate_attrs_diff_prefixes) +{ + char *text = + ""; + if (XML_Parse(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR) + fail("did not report multiple attributes with same URI+name"); +} +END_TEST + +/* Regression test for SF bug #695401: unbound prefix. */ +START_TEST(test_ns_unbound_prefix_on_attribute) +{ + char *text = ""; + if (XML_Parse(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR) + fail("did not report unbound prefix on attribute"); +} +END_TEST + +/* Regression test for SF bug #695401: unbound prefix. */ +START_TEST(test_ns_unbound_prefix_on_element) +{ + char *text = ""; + if (XML_Parse(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR) + fail("did not report unbound prefix on element"); +} +END_TEST + static Suite * make_basic_suite(void) { @@ -1315,6 +1345,9 @@ tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_3); tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_4); tcase_add_test(tc_namespace, test_ns_default_with_empty_uri); + tcase_add_test(tc_namespace, test_ns_duplicate_attrs_diff_prefixes); + tcase_add_test(tc_namespace, test_ns_unbound_prefix_on_attribute); + tcase_add_test(tc_namespace, test_ns_unbound_prefix_on_element); return s; } From fdrake at users.sourceforge.net Wed Mar 12 11:25:11 2003 From: fdrake at users.sourceforge.net (Fred L. Drake) Date: Wed Mar 12 14:25:14 2003 Subject: [Expat-checkins] expat/tests runtests.c,1.49,1.50 Message-ID: Update of /cvsroot/expat/expat/tests In directory sc8-pr-cvs1:/tmp/cvs-serv1303 Modified Files: runtests.c Log Message: - be more specific about the errors we expect to see reported - change the name of make_basic_suite() to make_suite(), since there's only one make_*_suite() function Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- runtests.c 12 Mar 2003 19:17:18 -0000 1.49 +++ runtests.c 12 Mar 2003 19:25:03 -0000 1.50 @@ -1261,8 +1261,9 @@ ""; - if (XML_Parse(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR) - fail("did not report multiple attributes with same URI+name"); + expect_failure(text, + XML_ERROR_DUPLICATE_ATTRIBUTE, + "did not report multiple attributes with same URI+name"); } END_TEST @@ -1270,8 +1271,9 @@ START_TEST(test_ns_unbound_prefix_on_attribute) { char *text = ""; - if (XML_Parse(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR) - fail("did not report unbound prefix on attribute"); + expect_failure(text, + XML_ERROR_UNBOUND_PREFIX, + "did not report unbound prefix on attribute"); } END_TEST @@ -1279,13 +1281,14 @@ START_TEST(test_ns_unbound_prefix_on_element) { char *text = ""; - if (XML_Parse(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR) - fail("did not report unbound prefix on element"); + expect_failure(text, + XML_ERROR_UNBOUND_PREFIX, + "did not report unbound prefix on element"); } END_TEST static Suite * -make_basic_suite(void) +make_suite(void) { Suite *s = suite_create("basic"); TCase *tc_basic = tcase_create("basic tests"); @@ -1359,7 +1362,7 @@ int i, nf; int forking = 0, forking_set = 0; int verbosity = CK_NORMAL; - Suite *s = make_basic_suite(); + Suite *s = make_suite(); SRunner *sr = srunner_create(s); /* run the tests for internal helper functions */ From fdrake at users.sourceforge.net Wed Mar 12 14:42:56 2003 From: fdrake at users.sourceforge.net (Fred L. Drake) Date: Wed Mar 12 17:42:59 2003 Subject: [Expat-checkins] expat/doc reference.html,1.42,1.43 Message-ID: Update of /cvsroot/expat/expat/doc In directory sc8-pr-cvs1:/tmp/cvs-serv32424 Modified Files: reference.html Log Message: Removed documentation of limitations that no longer exist in the implementation. See SF bug #620343. Index: reference.html =================================================================== RCS file: /cvsroot/expat/expat/doc/reference.html,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- reference.html 28 Jan 2003 15:23:39 -0000 1.42 +++ reference.html 12 Mar 2003 22:42:53 -0000 1.43 @@ -1154,12 +1154,6 @@ declarations occur inside start tags. But the namespace declaration start handler is called before the start tag handler for each namespace declared in that start tag.

- -

Note: -Due to limitations of the implementation, the -StartNamespaceDeclHandler is not called unless the StartElementHandler -is also set. The specific value of the StartElementHandler is allowed -to change freely, so long as it is not NULL.

@@ -1176,12 +1170,6 @@ declaration. This will be called, for each namespace declaration, after the handler for the end tag of the element in which the namespace was declared.

- -

Note: -Due to limitations of the implementation, the EndNamespaceDeclHandler -is not called unless the StartElementHandler is also set. The -specific value of the StartElementHandler is allowed to change freely, -so long as it is not NULL.

@@ -1191,13 +1179,6 @@ XML_EndNamespaceDeclHandler end)

Sets both namespace declaration handlers with a single call.

- -

Note: -Due to limitations of the implementation, the -StartNamespaceDeclHandler and EndNamespaceDeclHandler are not called -unless the StartElementHandler is also set. The specific value of the -StartElementHandler is allowed to change freely, so long as it is not -NULL.

From fdrake at users.sourceforge.net Wed Mar 12 15:02:15 2003 From: fdrake at users.sourceforge.net (Fred L. Drake) Date: Wed Mar 12 18:02:18 2003 Subject: [Expat-checkins] expat/lib internal.h,1.4,1.5 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1:/tmp/cvs-serv7906/lib Modified Files: internal.h Log Message: Fix FASTCALL for GCC on Solaris (SF bug #692878). This file is becoming a liability. Index: internal.h =================================================================== RCS file: /cvsroot/expat/expat/lib/internal.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- internal.h 20 Sep 2002 03:42:43 -0000 1.4 +++ internal.h 12 Mar 2003 23:02:11 -0000 1.5 @@ -20,8 +20,10 @@ and therefore subject to change. */ -#if defined(__GNUC__) -/* Instability reported with egcs on a RedHat Linux 7.3. +#if defined(__GNUC__) && !defined(sun) +/* regparm() generates warnings on Solaris boxes. See SF bug #692878. + + Instability reported with egcs on a RedHat Linux 7.3. Let's comment it out: #define FASTCALL __attribute__((stdcall, regparm(3))) and let's try this: From fdrake at users.sourceforge.net Wed Mar 12 17:30:50 2003 From: fdrake at users.sourceforge.net (Fred L. Drake) Date: Wed Mar 12 20:30:53 2003 Subject: [Expat-checkins] expat/doc reference.html,1.43,1.44 Message-ID: Update of /cvsroot/expat/expat/doc In directory sc8-pr-cvs1:/tmp/cvs-serv27122 Modified Files: reference.html Log Message: Fix function signature. Closes SF bug #679468. Index: reference.html =================================================================== RCS file: /cvsroot/expat/expat/doc/reference.html,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- reference.html 12 Mar 2003 22:42:53 -0000 1.43 +++ reference.html 13 Mar 2003 01:30:48 -0000 1.44 @@ -1462,7 +1462,7 @@
 const XML_LChar *
-XML_ErrorString(int code);
+XML_ErrorString(enum XML_Error code);
 
Return a string describing the error corresponding to code. From fdrake at users.sourceforge.net Wed Mar 12 18:13:09 2003 From: fdrake at users.sourceforge.net (Fred L. Drake) Date: Wed Mar 12 21:13:12 2003 Subject: [Expat-checkins] expat/doc reference.html,1.44,1.45 Message-ID: Update of /cvsroot/expat/expat/doc In directory sc8-pr-cvs1:/tmp/cvs-serv7619 Modified Files: reference.html Log Message: - better explain the XML_GetCurrent*() functions (SF bug #683681) - fix spelling Index: reference.html =================================================================== RCS file: /cvsroot/expat/expat/doc/reference.html,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- reference.html 13 Mar 2003 01:30:48 -0000 1.44 +++ reference.html 13 Mar 2003 02:13:06 -0000 1.45 @@ -1442,11 +1442,15 @@

These are the functions you'll want to call when the parse functions return XML_STATUS_ERROR (a parse error has -ocurred), although the position reporting functions are useful outside +occurred), although the position reporting functions are useful outside of errors. The position reported is the byte position (in the original document or entity encoding) of the first of the sequence of characters that generated the current event (or the error that caused -the parse functions to return XML_STATUS_ERROR.)

+the parse functions to return XML_STATUS_ERROR.) The +exceptions are callbacks trigged by declarations in the document +prologue, in which case they exact position reported is somewhere in the +relevant markup, but not necessarily as meaningful as for other +events.

The position reporting functions are accurate only outside of the DTD. In other words, they usually return bogus information when @@ -1475,7 +1479,10 @@ XML_GetCurrentByteIndex(XML_Parser p);

-Return the byte offset of the position. +Return the byte offset of the position. This always corresponds to +the values returned by XML_GetCurrentLineNumber and XML_GetCurrentColumnNumber.
@@ -1483,7 +1490,8 @@
 XML_GetCurrentLineNumber(XML_Parser p);
 
-Return the line number of the position. +Return the line number of the position. The first line is reported as +1.



From fdrake at users.sourceforge.net  Wed Mar 12 18:17:50 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Wed Mar 12 21:17:53 2003
Subject: [Expat-checkins] expat/lib expat.h,1.52,1.53
Message-ID: 

Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv8909

Modified Files:
	expat.h 
Log Message:
- better explain the XML_GetCurrent*() functions (SF bug #683681)


Index: expat.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- expat.h	7 Mar 2003 15:54:06 -0000	1.52
+++ expat.h	13 Mar 2003 02:17:48 -0000	1.53
@@ -814,8 +814,13 @@
 
 /* These functions return information about the current parse
    location.  They may be called from any callback called to report
-   some parse event; in this case the location is the location of
-   the first of the sequence of characters that generated the event. 
+   some parse event; in this case the location is the location of the
+   first of the sequence of characters that generated the event.  When
+   called from callbacks generated by declarations in the document
+   prologue, the location identified isn't as neatly defined, but will
+   be within the relevant markup.  When called outside of the callback
+   functions, the position indicated will be just past the last parse
+   event (regardless of whether there was an associated callback).
    
    They may also be called after returning from a call to XML_Parse
    or XML_ParseBuffer.  If the return value is XML_STATUS_ERROR then



From fdrake at users.sourceforge.net  Fri Mar 14 09:25:14 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Fri Mar 14 12:25:18 2003
Subject: [Expat-checkins] expat/lib internal.h,1.5,1.6
Message-ID: 

Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv23965

Modified Files:
	internal.h 
Log Message:
Be more defensive: only enable the *CALL macros when using GCC on
Linux, since we know the current definitions work there and have a
positive effect.
This closes SF bug #692878.


Index: internal.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/internal.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- internal.h	12 Mar 2003 23:02:11 -0000	1.5
+++ internal.h	14 Mar 2003 17:25:12 -0000	1.6
@@ -20,19 +20,20 @@
          and therefore subject to change.
 */
 
-#if defined(__GNUC__) && !defined(sun)
-/* regparm() generates warnings on Solaris boxes.   See SF bug #692878.
+#if defined(__GNUC__) && defined(linux)
+/* We'll use this version by default only where we know it helps.
+
+   regparm() generates warnings on Solaris boxes.   See SF bug #692878.
 
    Instability reported with egcs on a RedHat Linux 7.3.
-   Let's comment it out:
+   Let's comment out:
    #define FASTCALL __attribute__((stdcall, regparm(3)))
    and let's try this:
 */
 #define FASTCALL __attribute__((regparm(3)))
-#define PTRCALL
 #define PTRFASTCALL __attribute__((regparm(3)))
+#endif
 
-#elif defined(WIN32)
 /* Using __fastcall seems to have an unexpected negative effect under
    MS VC++, especially for function pointers, so we won't use it for
    now on that platform. It may be reconsidered for a future release
@@ -40,11 +41,8 @@
    Likely reason: __fastcall on Windows is like stdcall, therefore
    the compiler cannot perform stack optimizations for call clusters.
 */
-#define FASTCALL
-#define PTRCALL
-#define PTRFASTCALL
 
-#endif
+/* Make sure all of these are defined if they aren't already. */
 
 #ifndef FASTCALL
 #define FASTCALL