]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
build: avoid 'index' as variable name
authorEric Blake <eblake@redhat.com>
Thu, 24 Apr 2014 21:41:47 +0000 (15:41 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 24 Apr 2014 21:46:56 +0000 (15:46 -0600)
Once again, gcc 4.4.7 (hello RHEL) rears its ugly head:

conf/domain_conf.c: In function 'virDomainDiskBackingStoreFormat':
conf/domain_conf.c:14940: error: declaration of 'index' shadows a global declaration [-Wshadow]
/usr/include/string.h:489: error: shadowed declaration is here [-Wshadow]

* src/conf/domain_conf.c (virDomainDiskBackingStoreFormat): Pacify
older gcc.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/conf/domain_conf.c

index a558b1bad7079981f12254d708e2386b5bd84ff6..c655bcf2bc41cd8dfacf00e47f90cbc4ee288b38 100644 (file)
@@ -14937,7 +14937,7 @@ static int
 virDomainDiskBackingStoreFormat(virBufferPtr buf,
                                 virStorageSourcePtr backingStore,
                                 const char *backingStoreRaw,
-                                unsigned int index)
+                                unsigned int idx)
 {
     const char *type;
     const char *format;
@@ -14965,7 +14965,7 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf,
     }
 
     virBufferAsprintf(buf, "<backingStore type='%s' index='%u'>\n",
-                      type, index);
+                      type, idx);
     virBufferAdjustIndent(buf, 2);
 
     virBufferAsprintf(buf, "<format type='%s'/>\n", format);
@@ -14973,7 +14973,7 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf,
         virDomainDiskBackingStoreFormat(buf,
                                         backingStore->backingStore,
                                         backingStore->backingStoreRaw,
-                                        index + 1) < 0)
+                                        idx + 1) < 0)
         return -1;
 
     virBufferAdjustIndent(buf, -2);