From e8a15edb11ac6dfff595261846025c1b5721b6fe Mon Sep 17 00:00:00 2001 From: Frederick Price Date: Fri, 13 Dec 2024 21:45:47 -0500 Subject: [PATCH] Rename struct that conflicts, perhaps with MSVC --- Modules/expat/xmlparse.c | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Modules/expat/xmlparse.c b/Modules/expat/xmlparse.c index a4e091e7c33c0a..836db6c0b97f14 100644 --- a/Modules/expat/xmlparse.c +++ b/Modules/expat/xmlparse.c @@ -281,7 +281,7 @@ typedef struct binding { typedef struct prefix { const XML_Char *name; BINDING *binding; -} PREFIX; +} PPREFIX; typedef struct { const XML_Char *str; @@ -360,7 +360,7 @@ typedef struct { an attribute has been specified. */ typedef struct attribute_id { XML_Char *name; - PREFIX *prefix; + PPREFIX *prefix; XML_Bool maybeTokenized; XML_Bool xmlns; } ATTRIBUTE_ID; @@ -379,7 +379,7 @@ typedef struct { typedef struct { const XML_Char *name; - PREFIX *prefix; + PPREFIX *prefix; const ATTRIBUTE_ID *idAtt; int nDefaultAtts; int allocDefaultAtts; @@ -404,7 +404,7 @@ typedef struct { XML_Bool paramEntityRead; HASH_TABLE paramEntities; #endif /* XML_DTD */ - PREFIX defaultPrefix; + PPREFIX defaultPrefix; /* === scaffolding for building content model === */ XML_Bool in_eldecl; CONTENT_SCAFFOLD *scaffold; @@ -502,7 +502,7 @@ static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr, TAG_NAME *tagNamePtr, BINDING **bindingsPtr, enum XML_Account account); -static enum XML_Error addBinding(XML_Parser parser, PREFIX *prefix, +static enum XML_Error addBinding(XML_Parser parser, PPREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr); static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, @@ -3915,7 +3915,7 @@ is_rfc3986_uri_char(XML_Char candidate) { Therefore one must keep track of the old value outside of addBinding(). */ static enum XML_Error -addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, +addBinding(XML_Parser parser, PPREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr) { // "http://www.w3.org/XML/1998/namespace" static const XML_Char xmlNamespace[] @@ -6586,7 +6586,7 @@ setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType) { const XML_Char *name; for (name = elementType->name; *name; name++) { if (*name == XML_T(ASCII_COLON)) { - PREFIX *prefix; + PPREFIX *prefix; const XML_Char *s; for (s = elementType->name; s != name; s++) { if (! poolAppendChar(&dtd->pool, *s)) @@ -6594,8 +6594,8 @@ setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType) { } if (! poolAppendChar(&dtd->pool, XML_T('\0'))) return 0; - prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool), - sizeof(PREFIX)); + prefix = (PPREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool), + sizeof(PPREFIX)); if (! prefix) return 0; if (prefix->name == poolStart(&dtd->pool)) @@ -6639,8 +6639,8 @@ getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, if (name[5] == XML_T('\0')) id->prefix = &dtd->defaultPrefix; else - id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, name + 6, - sizeof(PREFIX)); + id->prefix = (PPREFIX *)lookup(parser, &dtd->prefixes, name + 6, + sizeof(PPREFIX)); id->xmlns = XML_TRUE; } else { int i; @@ -6654,8 +6654,8 @@ getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, } if (! poolAppendChar(&dtd->pool, XML_T('\0'))) return NULL; - id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, - poolStart(&dtd->pool), sizeof(PREFIX)); + id->prefix = (PPREFIX *)lookup(parser, &dtd->prefixes, + poolStart(&dtd->pool), sizeof(PPREFIX)); if (! id->prefix) return NULL; if (id->prefix->name == poolStart(&dtd->pool)) @@ -6719,7 +6719,7 @@ getContext(XML_Parser parser) { int i; int len; const XML_Char *s; - PREFIX *prefix = (PREFIX *)hashTableIterNext(&iter); + PPREFIX *prefix = (PPREFIX *)hashTableIterNext(&iter); if (! prefix) break; if (! prefix->binding) { @@ -6791,15 +6791,15 @@ setContext(XML_Parser parser, const XML_Char *context) { context = s; poolDiscard(&parser->m_tempPool); } else if (*s == XML_T(ASCII_EQUALS)) { - PREFIX *prefix; + PPREFIX *prefix; if (poolLength(&parser->m_tempPool) == 0) prefix = &dtd->defaultPrefix; else { if (! poolAppendChar(&parser->m_tempPool, XML_T('\0'))) return XML_FALSE; prefix - = (PREFIX *)lookup(parser, &dtd->prefixes, - poolStart(&parser->m_tempPool), sizeof(PREFIX)); + = (PPREFIX *)lookup(parser, &dtd->prefixes, + poolStart(&parser->m_tempPool), sizeof(PPREFIX)); if (! prefix) return XML_FALSE; if (prefix->name == poolStart(&parser->m_tempPool)) { @@ -6966,13 +6966,13 @@ dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, hashTableIterInit(&iter, &(oldDtd->prefixes)); for (;;) { const XML_Char *name; - const PREFIX *oldP = (PREFIX *)hashTableIterNext(&iter); + const PPREFIX *oldP = (PPREFIX *)hashTableIterNext(&iter); if (! oldP) break; name = poolCopyString(&(newDtd->pool), oldP->name); if (! name) return 0; - if (! lookup(oldParser, &(newDtd->prefixes), name, sizeof(PREFIX))) + if (! lookup(oldParser, &(newDtd->prefixes), name, sizeof(PPREFIX))) return 0; } @@ -7004,7 +7004,7 @@ dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, if (oldA->prefix == &oldDtd->defaultPrefix) newA->prefix = &newDtd->defaultPrefix; else - newA->prefix = (PREFIX *)lookup(oldParser, &(newDtd->prefixes), + newA->prefix = (PPREFIX *)lookup(oldParser, &(newDtd->prefixes), oldA->prefix->name, 0); } } @@ -7049,7 +7049,7 @@ dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, oldE->idAtt->name, 0); newE->allocDefaultAtts = newE->nDefaultAtts = oldE->nDefaultAtts; if (oldE->prefix) - newE->prefix = (PREFIX *)lookup(oldParser, &(newDtd->prefixes), + newE->prefix = (PPREFIX *)lookup(oldParser, &(newDtd->prefixes), oldE->prefix->name, 0); for (i = 0; i < newE->nDefaultAtts; i++) { newE->defaultAtts[i].id = (ATTRIBUTE_ID *)lookup(