[libvirt] [PATCH] util: Avoid shadow of 'ulong' in virMemoryMaxValue

Peter Krempa pkrempa at redhat.com
Thu May 21 14:57:20 UTC 2015


Old compilers whine:
src/util/virutil.c: In function 'virMemoryMaxValue':
src/util/virutil.c:2612: error: declaration of 'ulong' shadows a global declaration [-Wshadow]
/usr/include/sys/types.h:151: error: shadowed declaration is here [-Wshadow]

s/ulong/capped/ to work around the problem
---1
Pushed under the trivial && build-breaker rules.

 src/util/virutil.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/util/virutil.c b/src/util/virutil.c
index 638d6e2..e479cce 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -2603,17 +2603,17 @@ virMemoryLimitIsSet(unsigned long long value)
 /**
  * virMemoryMaxValue
  *
- * @ulong: whether the value must fit into unsigned long
+ * @capped: whether the value must fit into unsigned long
  *   (long long is assumed otherwise)
  *
  * Returns the maximum possible memory value in bytes.
  */
 unsigned long long
-virMemoryMaxValue(bool ulong)
+virMemoryMaxValue(bool capped)
 {
     /* On 32-bit machines, our bound is 0xffffffff * KiB. On 64-bit
      * machines, our bound is off_t (2^63).  */
-    if (ulong && sizeof(unsigned long) < sizeof(long long))
+    if (capped && sizeof(unsigned long) < sizeof(long long))
         return 1024ull * ULONG_MAX;
     else
         return LLONG_MAX;
-- 
2.3.5




More information about the libvir-list mailing list