mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
Fixing #74186, made sure all boolean expressions get fully parenthesized,
* c14n.c: Fixing #74186, made sure all boolean expressions get fully parenthesized, ran indent on the output * configure.in HTMLtree.c SAX.c c14n.c debugXML.c tree.c xpointer.c include/libxml/tree.h: also #74186 related, removed the --with-buffers option, and all the preprocessor conditional sections that were resulting from it. Daniel
This commit is contained in:
45
xpointer.c
45
xpointer.c
@ -1628,11 +1628,7 @@ xmlXPtrNbLocChildren(xmlNodePtr node) {
|
||||
case XML_TEXT_NODE:
|
||||
case XML_CDATA_SECTION_NODE:
|
||||
case XML_ENTITY_REF_NODE:
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
ret = xmlStrlen(node->content);
|
||||
#else
|
||||
ret = xmlBufferLength(node->content);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
return(-1);
|
||||
@ -2007,13 +2003,8 @@ xmlXPtrInsideRange(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr loc) {
|
||||
if (node->content == NULL) {
|
||||
return(xmlXPtrNewRange(node, 0, node, 0));
|
||||
} else {
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
return(xmlXPtrNewRange(node, 0, node,
|
||||
xmlStrlen(node->content)));
|
||||
#else
|
||||
return(xmlXPtrNewRange(node, 0, node,
|
||||
xmlBufferLength(node->content)));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
case XML_ATTRIBUTE_NODE:
|
||||
@ -2044,13 +2035,8 @@ xmlXPtrInsideRange(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr loc) {
|
||||
if (node->content == NULL) {
|
||||
return(xmlXPtrNewRange(node, 0, node, 0));
|
||||
} else {
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
return(xmlXPtrNewRange(node, 0, node,
|
||||
xmlStrlen(node->content)));
|
||||
#else
|
||||
return(xmlXPtrNewRange(node, 0, node,
|
||||
xmlBufferLength(node->content)));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
case XML_ATTRIBUTE_NODE:
|
||||
@ -2319,11 +2305,7 @@ xmlXPtrAdvanceChar(xmlNodePtr *node, int *indx, int bytes) {
|
||||
len = 0;
|
||||
if ((cur->type != XML_ELEMENT_NODE) &&
|
||||
(cur->content != NULL)) {
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
len = xmlStrlen(cur->content);
|
||||
#else
|
||||
len = xmlBufferLength(cur->content);
|
||||
#endif
|
||||
}
|
||||
if (pos > len) {
|
||||
/* Strange, the indx in the text node is greater than it's len */
|
||||
@ -2386,18 +2368,9 @@ xmlXPtrMatchString(const xmlChar *string, xmlNodePtr start, int startindex,
|
||||
return(0);
|
||||
|
||||
if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
len = xmlStrlen(cur->content);
|
||||
#else
|
||||
len = xmlBufferLength(cur->content);
|
||||
#endif
|
||||
if (len >= pos + stringlen) {
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
match = (!xmlStrncmp(&cur->content[pos], string, stringlen));
|
||||
#else
|
||||
len = (!xmlStrncmp(&xmlBufferContent(cur->content)[pos],
|
||||
string, stringlen));
|
||||
#endif
|
||||
if (match) {
|
||||
#ifdef DEBUG_RANGES
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
@ -2414,12 +2387,7 @@ xmlXPtrMatchString(const xmlChar *string, xmlNodePtr start, int startindex,
|
||||
}
|
||||
} else {
|
||||
int sub = len - pos;
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
match = (!xmlStrncmp(&cur->content[pos], string, sub));
|
||||
#else
|
||||
len = (!xmlStrncmp(&xmlBufferContent(cur->content)[pos],
|
||||
string, sub));
|
||||
#endif
|
||||
if (match) {
|
||||
#ifdef DEBUG_RANGES
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
@ -2482,19 +2450,10 @@ xmlXPtrSearchString(const xmlChar *string, xmlNodePtr *start, int *startindex,
|
||||
|
||||
while (cur != NULL) {
|
||||
if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
len = xmlStrlen(cur->content);
|
||||
#else
|
||||
len = xmlBufferLength(cur->content);
|
||||
#endif
|
||||
while (pos <= len) {
|
||||
if (first != 0) {
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
str = xmlStrchr(&cur->content[pos], first);
|
||||
#else
|
||||
str = xmlStrchr(&xmlBufferContent(cur->content)[pos],
|
||||
first);
|
||||
#endif
|
||||
if (str != NULL) {
|
||||
pos = (str - (xmlChar *)(cur->content));
|
||||
#ifdef DEBUG_RANGES
|
||||
@ -2580,11 +2539,7 @@ xmlXPtrGetLastChar(xmlNodePtr *node, int *indx) {
|
||||
cur = cur->last;
|
||||
else if ((cur->type != XML_ELEMENT_NODE) &&
|
||||
(cur->content != NULL)) {
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
len = xmlStrlen(cur->content);
|
||||
#else
|
||||
len = xmlBufferLength(cur->content);
|
||||
#endif
|
||||
break;
|
||||
} else {
|
||||
return(-1);
|
||||
|
Reference in New Issue
Block a user