]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
util: Avoid shadow of 'ulong' in virMemoryMaxValue
authorPeter Krempa <pkrempa@redhat.com>
Thu, 21 May 2015 14:50:19 +0000 (16:50 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 21 May 2015 14:52:01 +0000 (16:52 +0200)
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

src/util/virutil.c

index 638d6e2166e64ae7815fc840bcd94bfa3e9cd465..e479cce9be9dca54749fb1afd1f5ed111949468a 100644 (file)
@@ -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;