Skip to content

Commit

Permalink
Rename struct that conflicts, perhaps with MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
rickprice committed Dec 14, 2024
1 parent 2a5975c commit e8a15ed
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions Modules/expat/xmlparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ typedef struct binding {
typedef struct prefix {
const XML_Char *name;
BINDING *binding;
} PREFIX;
} PPREFIX;

typedef struct {
const XML_Char *str;
Expand Down Expand Up @@ -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;
Expand All @@ -379,7 +379,7 @@ typedef struct {

typedef struct {
const XML_Char *name;
PREFIX *prefix;
PPREFIX *prefix;
const ATTRIBUTE_ID *idAtt;
int nDefaultAtts;
int allocDefaultAtts;
Expand All @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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[]
Expand Down Expand Up @@ -6586,16 +6586,16 @@ 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))
return 0;
}
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))
Expand Down Expand Up @@ -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;
Expand All @@ -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))
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit e8a15ed

Please sign in to comment.