summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2012-09-11 14:02:08 +0800
committerDaniel Veillard <veillard@redhat.com>2012-09-11 14:02:08 +0800
commit7651606f316c366a6d66358b72b3527a829fb7fe (patch)
tree8d459de7f3a59379a990c5eba648ff5e39a4aa20
parent742a0bbbcc3fc285833a406d53c5df96aceb51b3 (diff)
downloadlibxml2-7651606f316c366a6d66358b72b3527a829fb7fe.tar.gz
Various cleanups to avoid compiler warnings
-rw-r--r--SAX2.c2
-rw-r--r--entities.c5
-rw-r--r--timsort.h15
-rw-r--r--xpath.c5
4 files changed, 15 insertions, 12 deletions
diff --git a/SAX2.c b/SAX2.c
index 90ba5daa..a24abc88 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -1889,7 +1889,7 @@ skip:
else {
ret->line = 65535;
if (ctxt->options & XML_PARSE_BIG_LINES)
- ret->psvi = (void *) ctxt->input->line;
+ ret->psvi = (void *) (long) ctxt->input->line;
}
}
}
diff --git a/entities.c b/entities.c
index ffaa1d7f..5e786a17 100644
--- a/entities.c
+++ b/entities.c
@@ -22,6 +22,8 @@
#include <libxml/globals.h>
#include <libxml/dict.h>
+#include "save.h"
+
/*
* The XML predefined entities.
*/
@@ -620,7 +622,8 @@ xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input, int attr) {
* Special handling of &{...} construct from HTML 4, see
* http://www.w3.org/TR/html401/appendix/notes.html#h-B.7.1
*/
- if (html && attr && (cur[1] == '{') && (strchr(cur, '}'))) {
+ if (html && attr && (cur[1] == '{') &&
+ (strchr((const char *) cur, '}'))) {
while (*cur != '}') {
*out++ = *cur++;
indx = out - buffer;
diff --git a/timsort.h b/timsort.h
index 26ebe864..95f412b6 100644
--- a/timsort.h
+++ b/timsort.h
@@ -172,7 +172,7 @@ static int64_t BINARY_INSERTION_FIND(SORT_TYPE *dst, const SORT_TYPE x, const si
static void BINARY_INSERTION_SORT_START(SORT_TYPE *dst, const size_t start, const size_t size)
{
int64_t i;
- for (i = start; i < size; i++)
+ for (i = start; i < (int64_t) size; i++)
{
int64_t j;
SORT_TYPE x;
@@ -214,7 +214,7 @@ static int64_t COUNT_RUN(SORT_TYPE *dst, const int64_t start, const size_t size)
{
int64_t curr;
if (size - start == 1) return 1;
- if (start >= size - 2)
+ if (start >= (int64_t) size - 2)
{
if (SORT_CMP(dst[size - 2], dst[size - 1]) > 0)
SORT_SWAP(dst[size - 2], dst[size - 1]);
@@ -228,7 +228,7 @@ static int64_t COUNT_RUN(SORT_TYPE *dst, const int64_t start, const size_t size)
/* increasing run */
while (1)
{
- if (curr == size - 1) break;
+ if (curr == (int64_t) size - 1) break;
if (SORT_CMP(dst[curr - 1], dst[curr]) > 0) break;
curr++;
}
@@ -239,7 +239,7 @@ static int64_t COUNT_RUN(SORT_TYPE *dst, const int64_t start, const size_t size)
/* decreasing run */
while (1)
{
- if (curr == size - 1) break;
+ if (curr == (int64_t) size - 1) break;
if (SORT_CMP(dst[curr - 1], dst[curr]) <= 0) break;
curr++;
}
@@ -253,7 +253,7 @@ static int64_t COUNT_RUN(SORT_TYPE *dst, const int64_t start, const size_t size)
len = COUNT_RUN(dst, curr, size);\
run = minrun;\
if (run < minrun) run = minrun;\
-if (run > size - curr) run = size - curr;\
+if (run > (int64_t) size - curr) run = size - curr;\
if (run > len)\
{\
BINARY_INSERTION_SORT_START(&dst[curr], len, run);\
@@ -265,7 +265,7 @@ run_stack[stack_curr].length = len;\
stack_curr++;\
}\
curr += len;\
-if (curr == size)\
+if (curr == (int64_t) size)\
{\
/* finish up */ \
while (stack_curr > 1) \
@@ -390,7 +390,8 @@ static int TIM_SORT_COLLAPSE(SORT_TYPE *dst, TIM_SORT_RUN_T *stack, int stack_cu
/* if the stack only has one thing on it, we are done with the collapse */
if (stack_curr <= 1) break;
/* if this is the last merge, just do it */
- if ((stack_curr == 2) && (stack[0].length + stack[1].length == size))
+ if ((stack_curr == 2) &&
+ (stack[0].length + stack[1].length == (int64_t) size))
{
TIM_SORT_MERGE(dst, stack, stack_curr, store);
stack[0].length += stack[1].length;
diff --git a/xpath.c b/xpath.c
index c3236ed3..9a82e909 100644
--- a/xpath.c
+++ b/xpath.c
@@ -7771,6 +7771,7 @@ xmlXPathNextChildElement(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
return(NULL);
}
+#if 0
/**
* xmlXPathNextDescendantOrSelfElemParent:
* @ctxt: the XPath Parser context
@@ -7846,6 +7847,7 @@ next_sibling:
}
return(NULL);
}
+#endif
/**
* xmlXPathNextDescendant:
@@ -12111,8 +12113,6 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
xmlNodeSetPtr contextSeq;
int contextIdx;
xmlNodePtr contextNode;
- /* The context node for a compound traversal */
- xmlNodePtr outerContextNode;
/* The final resulting node set wrt to all context nodes */
xmlNodeSetPtr outSeq;
/*
@@ -12306,7 +12306,6 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
addNode = xmlXPathNodeSetAddUnique;
outSeq = NULL;
seq = NULL;
- outerContextNode = NULL;
contextNode = NULL;
contextIdx = 0;