From 47fa97a7998531a82313c3d529a373cfd5358860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 11 Feb 2014 16:35:33 +0100 Subject: [PATCH] Rename 'index' in virCapabilitiesGetCpusForNode This shadows the index function on some systems (RHEL-6.4, FreeBSD 9): ../../src/conf/capabilities.c: In function 'virCapabilitiesGetCpusForNode': ../../src/conf/capabilities.c:1005: warning: declaration of'index' shadows a global declaration [-Wshadow] /usr/include/strings.h:57: warning: shadowed declaration is here [-Wshadow] --- src/conf/capabilities.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 78f65cbf66..c1c4ab8280 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -1002,11 +1002,11 @@ virCapabilitiesGetCpusForNode(virCapsPtr caps, { virCapsHostNUMACellPtr cell = NULL; size_t cpu; - size_t index; + size_t i; /* The numa node numbers can be non-contiguous. Ex: 0,1,16,17. */ - for (index = 0; index < caps->host.nnumaCell; index++) { - if (caps->host.numaCell[index]->num == node) { - cell = caps->host.numaCell[index]; + for (i = 0; i < caps->host.nnumaCell; i++) { + if (caps->host.numaCell[i]->num == node) { + cell = caps->host.numaCell[i]; break; } } -- GitLab