mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
include: Use intptr_t to cast between pointers and ints
This commit is contained in:
@ -4916,7 +4916,7 @@ static int
|
|||||||
htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
|
htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
htmlParserInputPtr in;
|
htmlParserInputPtr in;
|
||||||
ptrdiff_t avail = 0;
|
size_t avail = 0;
|
||||||
int cur;
|
int cur;
|
||||||
|
|
||||||
htmlParserNodeInfo node_info;
|
htmlParserNodeInfo node_info;
|
||||||
|
2
SAX2.c
2
SAX2.c
@ -2566,7 +2566,7 @@ xmlSAX2Text(xmlParserCtxtPtr ctxt, const xmlChar *ch, int len,
|
|||||||
else {
|
else {
|
||||||
lastChild->line = USHRT_MAX;
|
lastChild->line = USHRT_MAX;
|
||||||
if (ctxt->options & XML_PARSE_BIG_LINES)
|
if (ctxt->options & XML_PARSE_BIG_LINES)
|
||||||
lastChild->psvi = (void *) (ptrdiff_t) ctxt->input->line;
|
lastChild->psvi = XML_INT_TO_PTR(ctxt->input->line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
11
libxml.h
11
libxml.h
@ -41,6 +41,17 @@
|
|||||||
#define XML_INLINE
|
#define XML_INLINE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if __STDC_VERSION__ >= 199901L || (defined(_MSC_VER) && _MSC_VER >= 1900)
|
||||||
|
#include <stdint.h>
|
||||||
|
#define XML_INTPTR_T intptr_t
|
||||||
|
#else
|
||||||
|
#include <stddef.h>
|
||||||
|
#define XML_INTPTR_T ptrdiff_t
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
|
||||||
|
#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
|
||||||
|
|
||||||
#if !defined(_WIN32) && \
|
#if !defined(_WIN32) && \
|
||||||
!defined(__CYGWIN__) && \
|
!defined(__CYGWIN__) && \
|
||||||
(defined(__clang__) || \
|
(defined(__clang__) || \
|
||||||
|
23
parser.c
23
parser.c
@ -1199,7 +1199,7 @@ xmlAddSpecialAttr(xmlParserCtxtPtr ctxt,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (xmlHashAdd2(ctxt->attsSpecial, fullname, fullattr,
|
if (xmlHashAdd2(ctxt->attsSpecial, fullname, fullattr,
|
||||||
(void *) (ptrdiff_t) type) < 0)
|
XML_INT_TO_PTR(type)) < 0)
|
||||||
goto mem_error;
|
goto mem_error;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1218,7 +1218,7 @@ xmlCleanSpecialAttrCallback(void *payload, void *data,
|
|||||||
const xmlChar *unused ATTRIBUTE_UNUSED) {
|
const xmlChar *unused ATTRIBUTE_UNUSED) {
|
||||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) data;
|
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) data;
|
||||||
|
|
||||||
if (((ptrdiff_t) payload) == XML_ATTRIBUTE_CDATA) {
|
if (XML_PTR_TO_INT(payload) == XML_ATTRIBUTE_CDATA) {
|
||||||
xmlHashRemoveEntry2(ctxt->attsSpecial, fullname, fullattr, NULL);
|
xmlHashRemoveEntry2(ctxt->attsSpecial, fullname, fullattr, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8908,9 +8908,8 @@ xmlParseAttribute2(xmlParserCtxtPtr ctxt,
|
|||||||
if (ctxt->attsSpecial != NULL) {
|
if (ctxt->attsSpecial != NULL) {
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
type = (int) (ptrdiff_t) xmlHashQLookup2(ctxt->attsSpecial,
|
type = XML_PTR_TO_INT(xmlHashQLookup2(ctxt->attsSpecial, pref, elem,
|
||||||
pref, elem,
|
prefix, name));
|
||||||
prefix, name);
|
|
||||||
if (type != 0)
|
if (type != 0)
|
||||||
normalize = 1;
|
normalize = 1;
|
||||||
}
|
}
|
||||||
@ -9013,7 +9012,7 @@ xmlAttrHashInsert(xmlParserCtxtPtr ctxt, unsigned size, const xmlChar *name,
|
|||||||
const xmlChar **atts = &ctxt->atts[bucket->index];
|
const xmlChar **atts = &ctxt->atts[bucket->index];
|
||||||
|
|
||||||
if (name == atts[0]) {
|
if (name == atts[0]) {
|
||||||
int nsIndex = (int) (ptrdiff_t) atts[2];
|
int nsIndex = XML_PTR_TO_INT(atts[2]);
|
||||||
|
|
||||||
if ((nsIndex == NS_INDEX_EMPTY) ? (uri == NULL) :
|
if ((nsIndex == NS_INDEX_EMPTY) ? (uri == NULL) :
|
||||||
(nsIndex == NS_INDEX_XML) ? (uri == ctxt->str_xml_ns) :
|
(nsIndex == NS_INDEX_XML) ? (uri == ctxt->str_xml_ns) :
|
||||||
@ -9424,7 +9423,7 @@ next_attr:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
atts[i+2] = (const xmlChar *) (ptrdiff_t) nsIndex;
|
atts[i+2] = XML_INT_TO_PTR(nsIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -9462,7 +9461,7 @@ next_attr:
|
|||||||
|
|
||||||
attname = atts[i];
|
attname = atts[i];
|
||||||
aprefix = atts[i+1];
|
aprefix = atts[i+1];
|
||||||
nsIndex = (ptrdiff_t) atts[i+2];
|
nsIndex = XML_PTR_TO_INT(atts[i+2]);
|
||||||
/* Hash values always have bit 31 set, see dict.c */
|
/* Hash values always have bit 31 set, see dict.c */
|
||||||
nameHashValue = ctxt->attallocs[j] | 0x80000000;
|
nameHashValue = ctxt->attallocs[j] | 0x80000000;
|
||||||
|
|
||||||
@ -9591,7 +9590,7 @@ next_attr:
|
|||||||
|
|
||||||
atts[nbatts++] = attname;
|
atts[nbatts++] = attname;
|
||||||
atts[nbatts++] = aprefix;
|
atts[nbatts++] = aprefix;
|
||||||
atts[nbatts++] = (const xmlChar *) (ptrdiff_t) nsIndex;
|
atts[nbatts++] = XML_INT_TO_PTR(nsIndex);
|
||||||
atts[nbatts++] = attr->value.name;
|
atts[nbatts++] = attr->value.name;
|
||||||
atts[nbatts++] = attr->valueEnd;
|
atts[nbatts++] = attr->valueEnd;
|
||||||
if ((ctxt->standalone == 1) && (attr->external != 0)) {
|
if ((ctxt->standalone == 1) && (attr->external != 0)) {
|
||||||
@ -9647,7 +9646,7 @@ next_attr:
|
|||||||
*/
|
*/
|
||||||
for (i = 0, j = 0; i < nbatts; i += 5, j++) {
|
for (i = 0, j = 0; i < nbatts; i += 5, j++) {
|
||||||
/* namespace URI */
|
/* namespace URI */
|
||||||
nsIndex = (ptrdiff_t) atts[i+2];
|
nsIndex = XML_PTR_TO_INT(atts[i+2]);
|
||||||
if (nsIndex == INT_MAX)
|
if (nsIndex == INT_MAX)
|
||||||
atts[i+2] = NULL;
|
atts[i+2] = NULL;
|
||||||
else if (nsIndex == INT_MAX - 1)
|
else if (nsIndex == INT_MAX - 1)
|
||||||
@ -9656,8 +9655,8 @@ next_attr:
|
|||||||
atts[i+2] = ctxt->nsTab[nsIndex * 2 + 1];
|
atts[i+2] = ctxt->nsTab[nsIndex * 2 + 1];
|
||||||
|
|
||||||
if ((j < nratts) && (ctxt->attallocs[j] & 0x80000000) == 0) {
|
if ((j < nratts) && (ctxt->attallocs[j] & 0x80000000) == 0) {
|
||||||
atts[i+3] = BASE_PTR + (ptrdiff_t) atts[i+3]; /* value */
|
atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]); /* value */
|
||||||
atts[i+4] = BASE_PTR + (ptrdiff_t) atts[i+4]; /* valuend */
|
atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]); /* valuend */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
relaxng.c
12
relaxng.c
@ -4326,7 +4326,7 @@ xmlRelaxNGComputeInterleaves(void *payload, void *data,
|
|||||||
if ((*tmp)->type == XML_RELAXNG_TEXT) {
|
if ((*tmp)->type == XML_RELAXNG_TEXT) {
|
||||||
res = xmlHashAddEntry2(partitions->triage,
|
res = xmlHashAddEntry2(partitions->triage,
|
||||||
BAD_CAST "#text", NULL,
|
BAD_CAST "#text", NULL,
|
||||||
(void *) (ptrdiff_t) (i + 1));
|
XML_INT_TO_PTR(i + 1));
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
is_determinist = -1;
|
is_determinist = -1;
|
||||||
} else if (((*tmp)->type == XML_RELAXNG_ELEMENT) &&
|
} else if (((*tmp)->type == XML_RELAXNG_ELEMENT) &&
|
||||||
@ -4334,22 +4334,22 @@ xmlRelaxNGComputeInterleaves(void *payload, void *data,
|
|||||||
if (((*tmp)->ns == NULL) || ((*tmp)->ns[0] == 0))
|
if (((*tmp)->ns == NULL) || ((*tmp)->ns[0] == 0))
|
||||||
res = xmlHashAddEntry2(partitions->triage,
|
res = xmlHashAddEntry2(partitions->triage,
|
||||||
(*tmp)->name, NULL,
|
(*tmp)->name, NULL,
|
||||||
(void *) (ptrdiff_t) (i + 1));
|
XML_INT_TO_PTR(i + 1));
|
||||||
else
|
else
|
||||||
res = xmlHashAddEntry2(partitions->triage,
|
res = xmlHashAddEntry2(partitions->triage,
|
||||||
(*tmp)->name, (*tmp)->ns,
|
(*tmp)->name, (*tmp)->ns,
|
||||||
(void *) (ptrdiff_t) (i + 1));
|
XML_INT_TO_PTR(i + 1));
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
is_determinist = -1;
|
is_determinist = -1;
|
||||||
} else if ((*tmp)->type == XML_RELAXNG_ELEMENT) {
|
} else if ((*tmp)->type == XML_RELAXNG_ELEMENT) {
|
||||||
if (((*tmp)->ns == NULL) || ((*tmp)->ns[0] == 0))
|
if (((*tmp)->ns == NULL) || ((*tmp)->ns[0] == 0))
|
||||||
res = xmlHashAddEntry2(partitions->triage,
|
res = xmlHashAddEntry2(partitions->triage,
|
||||||
BAD_CAST "#any", NULL,
|
BAD_CAST "#any", NULL,
|
||||||
(void *) (ptrdiff_t) (i + 1));
|
XML_INT_TO_PTR(i + 1));
|
||||||
else
|
else
|
||||||
res = xmlHashAddEntry2(partitions->triage,
|
res = xmlHashAddEntry2(partitions->triage,
|
||||||
BAD_CAST "#any", (*tmp)->ns,
|
BAD_CAST "#any", (*tmp)->ns,
|
||||||
(void *) (ptrdiff_t) (i + 1));
|
XML_INT_TO_PTR(i + 1));
|
||||||
if ((*tmp)->nameClass != NULL)
|
if ((*tmp)->nameClass != NULL)
|
||||||
is_determinist = 2;
|
is_determinist = 2;
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
@ -9232,7 +9232,7 @@ xmlRelaxNGValidateInterleave(xmlRelaxNGValidCtxtPtr ctxt,
|
|||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
i = nbgroups;
|
i = nbgroups;
|
||||||
} else {
|
} else {
|
||||||
i = ((ptrdiff_t) tmp) - 1;
|
i = XML_PTR_TO_INT(tmp) - 1;
|
||||||
if (partitions->flags & IS_NEEDCHECK) {
|
if (partitions->flags & IS_NEEDCHECK) {
|
||||||
group = partitions->groups[i];
|
group = partitions->groups[i];
|
||||||
if (!xmlRelaxNGNodeMatchesList(cur, group->defs))
|
if (!xmlRelaxNGNodeMatchesList(cur, group->defs))
|
||||||
|
4
tree.c
4
tree.c
@ -4681,7 +4681,7 @@ xmlGetLineNoInternal(const xmlNode *node, int depth)
|
|||||||
(node->type == XML_PI_NODE)) {
|
(node->type == XML_PI_NODE)) {
|
||||||
if (node->line == 65535) {
|
if (node->line == 65535) {
|
||||||
if ((node->type == XML_TEXT_NODE) && (node->psvi != NULL))
|
if ((node->type == XML_TEXT_NODE) && (node->psvi != NULL))
|
||||||
result = (long) (ptrdiff_t) node->psvi;
|
result = XML_PTR_TO_INT(node->psvi);
|
||||||
else if ((node->type == XML_ELEMENT_NODE) &&
|
else if ((node->type == XML_ELEMENT_NODE) &&
|
||||||
(node->children != NULL))
|
(node->children != NULL))
|
||||||
result = xmlGetLineNoInternal(node->children, depth + 1);
|
result = xmlGetLineNoInternal(node->children, depth + 1);
|
||||||
@ -4691,7 +4691,7 @@ xmlGetLineNoInternal(const xmlNode *node, int depth)
|
|||||||
result = xmlGetLineNoInternal(node->prev, depth + 1);
|
result = xmlGetLineNoInternal(node->prev, depth + 1);
|
||||||
}
|
}
|
||||||
if ((result == -1) || (result == 65535))
|
if ((result == -1) || (result == 65535))
|
||||||
result = (long) node->line;
|
result = node->line;
|
||||||
} else if ((node->prev != NULL) &&
|
} else if ((node->prev != NULL) &&
|
||||||
((node->prev->type == XML_ELEMENT_NODE) ||
|
((node->prev->type == XML_ELEMENT_NODE) ||
|
||||||
(node->prev->type == XML_TEXT_NODE) ||
|
(node->prev->type == XML_TEXT_NODE) ||
|
||||||
|
58
xpath.c
58
xpath.c
@ -309,7 +309,10 @@ static const xmlNs *const xmlXPathXMLNamespace = &xmlXPathXMLNamespaceStruct;
|
|||||||
static void
|
static void
|
||||||
xmlXPathNodeSetClear(xmlNodeSetPtr set, int hasNsNodes);
|
xmlXPathNodeSetClear(xmlNodeSetPtr set, int hasNsNodes);
|
||||||
|
|
||||||
|
#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
|
||||||
|
|
||||||
#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
|
#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlXPathCmpNodesExt:
|
* xmlXPathCmpNodesExt:
|
||||||
* @node1: the first node
|
* @node1: the first node
|
||||||
@ -327,7 +330,7 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
|
|||||||
int misc = 0, precedence1 = 0, precedence2 = 0;
|
int misc = 0, precedence1 = 0, precedence2 = 0;
|
||||||
xmlNodePtr miscNode1 = NULL, miscNode2 = NULL;
|
xmlNodePtr miscNode1 = NULL, miscNode2 = NULL;
|
||||||
xmlNodePtr cur, root;
|
xmlNodePtr cur, root;
|
||||||
ptrdiff_t l1, l2;
|
XML_INTPTR_T l1, l2;
|
||||||
|
|
||||||
if ((node1 == NULL) || (node2 == NULL))
|
if ((node1 == NULL) || (node2 == NULL))
|
||||||
return(-2);
|
return(-2);
|
||||||
@ -341,12 +344,12 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
|
|||||||
switch (node1->type) {
|
switch (node1->type) {
|
||||||
case XML_ELEMENT_NODE:
|
case XML_ELEMENT_NODE:
|
||||||
if (node2->type == XML_ELEMENT_NODE) {
|
if (node2->type == XML_ELEMENT_NODE) {
|
||||||
if ((0 > (ptrdiff_t) node1->content) &&
|
if ((0 > XML_NODE_SORT_VALUE(node1)) &&
|
||||||
(0 > (ptrdiff_t) node2->content) &&
|
(0 > XML_NODE_SORT_VALUE(node2)) &&
|
||||||
(node1->doc == node2->doc))
|
(node1->doc == node2->doc))
|
||||||
{
|
{
|
||||||
l1 = -((ptrdiff_t) node1->content);
|
l1 = -XML_NODE_SORT_VALUE(node1);
|
||||||
l2 = -((ptrdiff_t) node2->content);
|
l2 = -XML_NODE_SORT_VALUE(node2);
|
||||||
if (l1 < l2)
|
if (l1 < l2)
|
||||||
return(1);
|
return(1);
|
||||||
if (l1 > l2)
|
if (l1 > l2)
|
||||||
@ -391,7 +394,7 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
|
|||||||
node1 = node1->parent;
|
node1 = node1->parent;
|
||||||
}
|
}
|
||||||
if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
|
if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
|
||||||
(0 <= (ptrdiff_t) node1->content)) {
|
(0 <= XML_NODE_SORT_VALUE(node1))) {
|
||||||
/*
|
/*
|
||||||
* Fallback for whatever case.
|
* Fallback for whatever case.
|
||||||
*/
|
*/
|
||||||
@ -441,7 +444,7 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
|
|||||||
node2 = node2->parent;
|
node2 = node2->parent;
|
||||||
}
|
}
|
||||||
if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
|
if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
|
||||||
(0 <= (ptrdiff_t) node2->content))
|
(0 <= XML_NODE_SORT_VALUE(node2)))
|
||||||
{
|
{
|
||||||
node2 = miscNode2;
|
node2 = miscNode2;
|
||||||
precedence2 = 0;
|
precedence2 = 0;
|
||||||
@ -514,12 +517,12 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
|
|||||||
*/
|
*/
|
||||||
if ((node1->type == XML_ELEMENT_NODE) &&
|
if ((node1->type == XML_ELEMENT_NODE) &&
|
||||||
(node2->type == XML_ELEMENT_NODE) &&
|
(node2->type == XML_ELEMENT_NODE) &&
|
||||||
(0 > (ptrdiff_t) node1->content) &&
|
(0 > XML_NODE_SORT_VALUE(node1)) &&
|
||||||
(0 > (ptrdiff_t) node2->content) &&
|
(0 > XML_NODE_SORT_VALUE(node2)) &&
|
||||||
(node1->doc == node2->doc)) {
|
(node1->doc == node2->doc)) {
|
||||||
|
|
||||||
l1 = -((ptrdiff_t) node1->content);
|
l1 = -XML_NODE_SORT_VALUE(node1);
|
||||||
l2 = -((ptrdiff_t) node2->content);
|
l2 = -XML_NODE_SORT_VALUE(node2);
|
||||||
if (l1 < l2)
|
if (l1 < l2)
|
||||||
return(1);
|
return(1);
|
||||||
if (l1 > l2)
|
if (l1 > l2)
|
||||||
@ -582,12 +585,12 @@ turtle_comparison:
|
|||||||
*/
|
*/
|
||||||
if ((node1->type == XML_ELEMENT_NODE) &&
|
if ((node1->type == XML_ELEMENT_NODE) &&
|
||||||
(node2->type == XML_ELEMENT_NODE) &&
|
(node2->type == XML_ELEMENT_NODE) &&
|
||||||
(0 > (ptrdiff_t) node1->content) &&
|
(0 > XML_NODE_SORT_VALUE(node1)) &&
|
||||||
(0 > (ptrdiff_t) node2->content) &&
|
(0 > XML_NODE_SORT_VALUE(node2)) &&
|
||||||
(node1->doc == node2->doc)) {
|
(node1->doc == node2->doc)) {
|
||||||
|
|
||||||
l1 = -((ptrdiff_t) node1->content);
|
l1 = -XML_NODE_SORT_VALUE(node1);
|
||||||
l2 = -((ptrdiff_t) node2->content);
|
l2 = -XML_NODE_SORT_VALUE(node2);
|
||||||
if (l1 < l2)
|
if (l1 < l2)
|
||||||
return(1);
|
return(1);
|
||||||
if (l1 > l2)
|
if (l1 > l2)
|
||||||
@ -2417,7 +2420,7 @@ xmlXPathFormatNumber(double number, char buffer[], int buffersize)
|
|||||||
*/
|
*/
|
||||||
long
|
long
|
||||||
xmlXPathOrderDocElems(xmlDocPtr doc) {
|
xmlXPathOrderDocElems(xmlDocPtr doc) {
|
||||||
ptrdiff_t count = 0;
|
XML_INTPTR_T count = 0;
|
||||||
xmlNodePtr cur;
|
xmlNodePtr cur;
|
||||||
|
|
||||||
if (doc == NULL)
|
if (doc == NULL)
|
||||||
@ -2425,7 +2428,8 @@ xmlXPathOrderDocElems(xmlDocPtr doc) {
|
|||||||
cur = doc->children;
|
cur = doc->children;
|
||||||
while (cur != NULL) {
|
while (cur != NULL) {
|
||||||
if (cur->type == XML_ELEMENT_NODE) {
|
if (cur->type == XML_ELEMENT_NODE) {
|
||||||
cur->content = (void *) (-(++count));
|
count += 1;
|
||||||
|
cur->content = XML_INT_TO_PTR(-count);
|
||||||
if (cur->children != NULL) {
|
if (cur->children != NULL) {
|
||||||
cur = cur->children;
|
cur = cur->children;
|
||||||
continue;
|
continue;
|
||||||
@ -2517,13 +2521,13 @@ xmlXPathCmpNodes(xmlNodePtr node1, xmlNodePtr node2) {
|
|||||||
*/
|
*/
|
||||||
if ((node1->type == XML_ELEMENT_NODE) &&
|
if ((node1->type == XML_ELEMENT_NODE) &&
|
||||||
(node2->type == XML_ELEMENT_NODE) &&
|
(node2->type == XML_ELEMENT_NODE) &&
|
||||||
(0 > (ptrdiff_t) node1->content) &&
|
(0 > XML_NODE_SORT_VALUE(node1)) &&
|
||||||
(0 > (ptrdiff_t) node2->content) &&
|
(0 > XML_NODE_SORT_VALUE(node2)) &&
|
||||||
(node1->doc == node2->doc)) {
|
(node1->doc == node2->doc)) {
|
||||||
ptrdiff_t l1, l2;
|
XML_INTPTR_T l1, l2;
|
||||||
|
|
||||||
l1 = -((ptrdiff_t) node1->content);
|
l1 = -XML_NODE_SORT_VALUE(node1);
|
||||||
l2 = -((ptrdiff_t) node2->content);
|
l2 = -XML_NODE_SORT_VALUE(node2);
|
||||||
if (l1 < l2)
|
if (l1 < l2)
|
||||||
return(1);
|
return(1);
|
||||||
if (l1 > l2)
|
if (l1 > l2)
|
||||||
@ -2580,13 +2584,13 @@ xmlXPathCmpNodes(xmlNodePtr node1, xmlNodePtr node2) {
|
|||||||
*/
|
*/
|
||||||
if ((node1->type == XML_ELEMENT_NODE) &&
|
if ((node1->type == XML_ELEMENT_NODE) &&
|
||||||
(node2->type == XML_ELEMENT_NODE) &&
|
(node2->type == XML_ELEMENT_NODE) &&
|
||||||
(0 > (ptrdiff_t) node1->content) &&
|
(0 > XML_NODE_SORT_VALUE(node1)) &&
|
||||||
(0 > (ptrdiff_t) node2->content) &&
|
(0 > XML_NODE_SORT_VALUE(node2)) &&
|
||||||
(node1->doc == node2->doc)) {
|
(node1->doc == node2->doc)) {
|
||||||
ptrdiff_t l1, l2;
|
XML_INTPTR_T l1, l2;
|
||||||
|
|
||||||
l1 = -((ptrdiff_t) node1->content);
|
l1 = -XML_NODE_SORT_VALUE(node1);
|
||||||
l2 = -((ptrdiff_t) node2->content);
|
l2 = -XML_NODE_SORT_VALUE(node2);
|
||||||
if (l1 < l2)
|
if (l1 < l2)
|
||||||
return(1);
|
return(1);
|
||||||
if (l1 > l2)
|
if (l1 > l2)
|
||||||
|
Reference in New Issue
Block a user