[PATCH 1/2] util: xml: Remove VIR_XML_PROP_WRAPNEGATIVE

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

 



As I've pointed out in my review, the negative number wrapping for
unsigned variables is an anti-feature which should not be promoted in
any way.

Remove VIR_XML_PROP_WRAPNEGATIVE which would make it more accessible.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/util/virxml.c | 6 +-----
 src/util/virxml.h | 1 -
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/util/virxml.c b/src/util/virxml.c
index d0d9494009..bfb4005e62 100644
--- a/src/util/virxml.c
+++ b/src/util/virxml.c
@@ -734,11 +734,7 @@ virXMLPropUInt(xmlNodePtr node,
         return -1;
     }

-    if (flags & VIR_XML_PROP_WRAPNEGATIVE) {
-        ret = virStrToLong_ui(tmp, NULL, base, &val);
-    } else {
-        ret = virStrToLong_uip(tmp, NULL, base, &val);
-    }
+    ret = virStrToLong_uip(tmp, NULL, base, &val);

     if (ret < 0) {
         virReportError(VIR_ERR_XML_ERROR,
diff --git a/src/util/virxml.h b/src/util/virxml.h
index 2b40398eee..a8f088fb43 100644
--- a/src/util/virxml.h
+++ b/src/util/virxml.h
@@ -38,7 +38,6 @@ typedef enum {
     VIR_XML_PROP_OPTIONAL = 0, /* Attribute may be absent */
     VIR_XML_PROP_REQUIRED = 1 << 0, /* Attribute may not be absent */
     VIR_XML_PROP_NONZERO = 1 << 1, /* Attribute may not be zero */
-    VIR_XML_PROP_WRAPNEGATIVE = 1 << 2, /* Wrap around negative values */
 } virXMLPropFlags;


-- 
2.30.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux