[libxml2] Fix -Wenum-compare warnings



commit b21895717debfc513640463371e76d2d16051491
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Mon Nov 13 21:23:17 2017 +0100

    Fix -Wenum-compare warnings
    
    Also fixes a serious bug in xmlXPtrNewRangeNodePoint.

 xpath.c    |    2 +-
 xpointer.c |    2 --
 2 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/xpath.c b/xpath.c
index a9f2968..5211b12 100644
--- a/xpath.c
+++ b/xpath.c
@@ -12386,7 +12386,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
                            default:
                                break;
                        }
-                   } else if (cur->type == type) {
+                   } else if (cur->type == (xmlElementType) type) {
                        if (cur->type == XML_NAMESPACE_DECL)
                            XP_TEST_HIT_NS
                        else
diff --git a/xpointer.c b/xpointer.c
index c8ebff3..6a41f07 100644
--- a/xpointer.c
+++ b/xpointer.c
@@ -467,8 +467,6 @@ xmlXPtrNewRangeNodePoint(xmlNodePtr start, xmlXPathObjectPtr end) {
        return(NULL);
     if (end == NULL)
        return(NULL);
-    if (start->type != XPATH_POINT)
-       return(NULL);
     if (end->type != XPATH_POINT)
        return(NULL);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]