From: Peter Krempa Date: Wed, 21 Apr 2021 06:41:00 +0000 (+0200) Subject: util: xml: Remove VIR_XML_PROP_WRAPNEGATIVE X-Git-Tag: v7.3.0-rc1~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=497c3ecd7801a6521f621c9e154ac731de65e0b3;p=thirdparty%2Flibvirt.git util: xml: Remove VIR_XML_PROP_WRAPNEGATIVE 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 Reviewed-by: Michal Privoznik --- diff --git a/src/util/virxml.c b/src/util/virxml.c index 418be2a898..5ceef73814 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 c0405a39f0..f7ec4ef957 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;