1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-25 23:21:26 +03:00

Silenced intel compiler warnings (reported by Kjartan Maraas, bug

* tree.c pattern.c: Silenced intel compiler warnings (reported
  by Kjartan Maraas, bug #318517).
* xmlschemas.c: The above changes in pattern.c revealed an
  inconsistency wrt IDCs: we now _only_ pop XPath states, if
  we really pushed them beforehand; this was previously not
  checked for the case when we discover an element node to be
  invalid wrt the content model.
  Fixed segfault in xmlSchemaGetEffectiveValueConstraint().
This commit is contained in:
Kasimier T. Buchcik 2005-10-17 12:39:58 +00:00
parent 95c3adf57a
commit 65c2f1d78a
4 changed files with 29 additions and 16 deletions

View File

@ -1,3 +1,14 @@
Mon Oct 17 14:29:08 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* tree.c pattern.c: Silenced intel compiler warnings (reported
by Kjartan Maraas, bug #318517).
* xmlschemas.c: The above changes in pattern.c revealed an
inconsistency wrt IDCs: we now _only_ pop XPath states, if
we really pushed them beforehand; this was previously not
checked for the case when we discover an element node to be
invalid wrt the content model.
Fixed segfault in xmlSchemaGetEffectiveValueConstraint().
Fri Oct 14 16:40:18 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* result/schemas/*.err: Adapted regression test results.

View File

@ -1931,11 +1931,9 @@ xmlStreamPushAttr(xmlStreamCtxtPtr stream,
int
xmlStreamPop(xmlStreamCtxtPtr stream) {
int i, lev;
int ret;
if (stream == NULL)
return(-1);
ret = 0;
while (stream != NULL) {
/*
* Reset block-level.
@ -1945,7 +1943,7 @@ xmlStreamPop(xmlStreamCtxtPtr stream) {
stream->level--;
if (stream->level < 0)
ret = -1;
return(-1);
/*
* Check evolution of existing states
*/

6
tree.c
View File

@ -6258,7 +6258,7 @@ xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
*/
int
xmlUnsetProp(xmlNodePtr node, const xmlChar *name) {
xmlAttrPtr prop, prev = NULL;;
xmlAttrPtr prop;
if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL))
return(-1);
@ -6270,7 +6270,6 @@ xmlUnsetProp(xmlNodePtr node, const xmlChar *name) {
xmlFreeProp(prop);
return(0);
}
prev = prop;
prop = prop->next;
}
return(-1);
@ -6287,7 +6286,7 @@ xmlUnsetProp(xmlNodePtr node, const xmlChar *name) {
*/
int
xmlUnsetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name) {
xmlAttrPtr prop, prev = NULL;;
xmlAttrPtr prop;
if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL))
return(-1);
@ -6303,7 +6302,6 @@ xmlUnsetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name) {
xmlFreeProp(prop);
return(0);
}
prev = prop;
prop = prop->next;
}
return(-1);

View File

@ -896,6 +896,7 @@ struct _xmlSchemaNodeInfo {
int sizeNsBindings;
int hasKeyrefs;
int appliedXPath; /* Indicates that an XPath has been applied. */
};
#define XML_SCHEMAS_ATTR_UNKNOWN 1
@ -13867,15 +13868,17 @@ xmlSchemaGetEffectiveValueConstraint(xmlSchemaAttributeUsePtr attruse,
if (attruse->defValue != NULL) {
*value = attruse->defValue;
*val = attruse->defVal;
if (val != NULL)
*val = attruse->defVal;
if (attruse->flags & XML_SCHEMA_ATTR_USE_FIXED)
*fixed = 1;
return(1);
} else if ((WXS_ATTRUSE_DECL(attruse) != NULL) &&
(WXS_ATTRUSE_DECL(attruse)->defValue != NULL)) {
*value = (WXS_ATTRUSE_DECL(attruse))->defValue;
*val = (WXS_ATTRUSE_DECL(attruse))->defVal;
if ((WXS_ATTRUSE_DECL(attruse))->flags & XML_SCHEMAS_ATTR_FIXED)
} else if ((attruse->attrDecl != NULL) &&
(attruse->attrDecl->defValue != NULL)) {
*value = attruse->attrDecl->defValue;
if (val != NULL)
*val = attruse->attrDecl->defVal;
if (attruse->attrDecl->flags & XML_SCHEMAS_ATTR_FIXED)
*fixed = 1;
return(1);
}
@ -20965,7 +20968,7 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt)
if (res == -1)
goto exit_failure;
if (res != 0)
goto exit;
goto exit;
if (bucket == NULL) {
/* TODO: Error code, actually we failed to *locate* the schema. */
@ -23510,6 +23513,7 @@ static void
xmlSchemaClearElemInfo(xmlSchemaNodeInfoPtr ielem)
{
ielem->hasKeyrefs = 0;
ielem->appliedXPath = 0;
if (ielem->flags & XML_SCHEMA_NODE_INFO_FLAG_OWNED_NAMES) {
FREE_AND_NULL(ielem->localName);
FREE_AND_NULL(ielem->nsName);
@ -25811,7 +25815,8 @@ end_elem:
/*
* Evaluate the history of XPath state objects.
*/
if (xmlSchemaXPathProcessHistory(vctxt, vctxt->depth) == -1)
if (inode->appliedXPath &&
(xmlSchemaXPathProcessHistory(vctxt, vctxt->depth) == -1))
goto internal_error;
/*
* MAYBE TODO:
@ -26390,6 +26395,7 @@ type_validation:
*/
if (vctxt->xpathStates != NULL) {
ret = xmlSchemaXPathEvaluate(vctxt, XML_ELEMENT_NODE);
vctxt->inode->appliedXPath = 1;
if (ret == -1) {
VERROR_INT("xmlSchemaValidateElem",
"calling xmlSchemaXPathEvaluate()");