aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2010-07-28 17:28:44 -0600
committerEric Blake <eblake@redhat.com>2010-07-29 14:36:43 -0600
commit2c216d95e88fa6855913eb2158f7819dafe0a03e (patch)
treec0cb8f8490454d1ba1069b4de748540d7afa1b37
parentbuild: distribute libvirt_qemu.syms (diff)
downloadlibvirt-2c216d95e88fa6855913eb2158f7819dafe0a03e.tar.gz
libvirt-2c216d95e88fa6855913eb2158f7819dafe0a03e.tar.bz2
libvirt-2c216d95e88fa6855913eb2158f7819dafe0a03e.zip
esx: silence spurious compiler warning
* src/esx/esx_vi_types.c (_DESERIALIZE_NUMBER) (ESX_VI__TEMPLATE__DESERIALIZE_NUMBER): Add range check to shut up gcc 4.5.0 regarding long long.
-rw-r--r--src/esx/esx_vi_types.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c
index 6e759950a..5cf30b1cc 100644
--- a/src/esx/esx_vi_types.c
+++ b/src/esx/esx_vi_types.c
@@ -333,7 +333,8 @@
goto cleanup; \
} \
\
- if (value < (_min) || value > (_max)) { \
+ if (((_min) != INT64_MIN && value < (_min)) \
+ || ((_max) != INT64_MAX && value > (_max))) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
"Value '%s' is not representable as "_xsdType, \
(const char *)string); \
@@ -922,7 +923,8 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
goto failure; \
} \
\
- if (number < (_min) || number > (_max)) { \
+ if (((_min) != INT64_MIN && number < (_min)) \
+ || ((_max) != INT64_MAX && number > (_max))) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
_("Value '%s' is out of %s range"), \
(*anyType)->value, _xsdType); \