From 21faee4b383a12bef58f300b4ad1a3bd34d6de2d Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 25 Jan 2012 19:05:42 +0000 Subject: [PATCH] hw/xwin: Fix using index as a local variable shadows index() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using index as a local variable shadows index() from strings.h winprefs.c: In function ‘LoadImageComma’: winprefs.c:574:7: error: declaration of ‘index’ shadows a global declaration Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winprefs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c index 52d1bc11c..5d2512e22 100644 --- a/hw/xwin/winprefs.c +++ b/hw/xwin/winprefs.c @@ -535,21 +535,21 @@ static HICON LoadImageComma(char *fname, int sx, int sy, int flags) { HICON hicon; - int index; + int i; char file[PATH_MAX + NAME_MAX + 2]; /* Some input error checking */ if (!fname || !fname[0]) return NULL; - index = 0; + i = 0; hicon = NULL; if (fname[0] == ',') { /* It's the XWIN.EXE resource they want */ - index = atoi(fname + 1); + i = atoi(fname + 1); hicon = LoadImage(g_hInstance, - MAKEINTRESOURCE(index), IMAGE_ICON, sx, sy, flags); + MAKEINTRESOURCE(i), IMAGE_ICON, sx, sy, flags); } else { file[0] = 0; @@ -566,8 +566,8 @@ LoadImageComma(char *fname, int sx, int sy, int flags) /* Specified as , */ *(strrchr(file, ',')) = 0; /* End string at comma */ - index = atoi(strrchr(fname, ',') + 1); - hicon = ExtractIcon(g_hInstance, file, index); + i = atoi(strrchr(fname, ',') + 1); + hicon = ExtractIcon(g_hInstance, file, i); } else { /* Just an .ico file... */