[libxml2] Remove various unused value assignments



commit 579410427fa11725ca411e45d3ac57db92586ac2
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Oct 26 18:08:04 2014 +0000

    Remove various unused value assignments
    
    As detected by Coverity (CIDs 60467–60472).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739220

 relaxng.c  |    2 +-
 testdict.c |    4 ++--
 tree.c     |    8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/relaxng.c b/relaxng.c
index 8d88e95..5357b56 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -9859,7 +9859,7 @@ xmlRelaxNGValidateState(xmlRelaxNGValidCtxtPtr ctxt,
     ctxt->depth++;
     switch (define->type) {
         case XML_RELAXNG_EMPTY:
-            node = xmlRelaxNGSkipIgnored(ctxt, node);
+            xmlRelaxNGSkipIgnored(ctxt, node);
             ret = 0;
             break;
         case XML_RELAXNG_NOT_ALLOWED:
diff --git a/testdict.c b/testdict.c
index 4e8581f..40bebd0 100644
--- a/testdict.c
+++ b/testdict.c
@@ -277,7 +277,7 @@ static int run_test2(xmlDictPtr parent) {
        cur++;
        *pref = 0;
        tmp = xmlDictQLookup(dict, &prefix[0], cur);
-       if (xmlDictQLookup(dict, &prefix[0], cur) != test2[i]) {
+       if (tmp != test2[i]) {
            fprintf(stderr, "Failed lookup check for '%s':'%s'\n",
                    &prefix[0], cur);
             ret = 1;
@@ -408,7 +408,7 @@ static int run_test1(void) {
        cur++;
        *pref = 0;
        tmp = xmlDictQLookup(dict, &prefix[0], cur);
-       if (xmlDictQLookup(dict, &prefix[0], cur) != test1[i]) {
+       if (tmp != test1[i]) {
            fprintf(stderr, "Failed lookup check for '%s':'%s'\n",
                    &prefix[0], cur);
             ret = 1;
diff --git a/tree.c b/tree.c
index 307782c..6ec9223 100644
--- a/tree.c
+++ b/tree.c
@@ -1451,9 +1451,9 @@ xmlStringLenGetNodeList(const xmlDoc *doc, const xmlChar *value, int len) {
        node->content = xmlBufDetach(buf);
 
        if (last == NULL) {
-           last = ret = node;
+           ret = node;
        } else {
-           last = xmlAddNextSibling(last, node);
+           xmlAddNextSibling(last, node);
        }
     } else if (ret == NULL) {
         ret = xmlNewDocText(doc, BAD_CAST "");
@@ -1639,9 +1639,9 @@ xmlStringGetNodeList(const xmlDoc *doc, const xmlChar *value) {
        node->content = xmlBufDetach(buf);
 
        if (last == NULL) {
-           last = ret = node;
+           ret = node;
        } else {
-           last = xmlAddNextSibling(last, node);
+           xmlAddNextSibling(last, node);
        }
     }
 


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