From 0d0ae3fd54746ed9bed8ca96269e182187176dc8 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 7 Jan 2024 10:09:13 -0800 Subject: =?UTF-8?q?Fix=20warning:=20declaration=20of=20=E2=80=98ulIndex?= =?UTF-8?q?=E2=80=99=20shadows=20a=20previous=20local=20[-Wshadow]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mga_g450pll.c: In function ‘MGAG450SetPLLFreq’: mga_g450pll.c:326:11: warning: declaration of ‘ulIndex’ shadows a previous local [-Wshadow] 326 | int ulIndex; | ^~~~~~~ mga_g450pll.c:312:11: note: shadowed declaration is here 312 | CARD32 ulIndex; | ^~~~~~~ Signed-off-by: Alan Coopersmith --- src/mga_g450pll.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mga_g450pll.c b/src/mga_g450pll.c index ae6e1a1..c94d0c5 100644 --- a/src/mga_g450pll.c +++ b/src/mga_g450pll.c @@ -309,7 +309,6 @@ double MGAG450SetPLLFreq(ScrnInfoPtr pScrn, long f_out) CARD32 ulMaxIndex; CARD32 ulMNP; CARD32 ulMNPTable[MNP_TABLE_SIZE]; - CARD32 ulIndex; CARD32 ulTryMNP; long lCompareResult; MGAPtr pMga = MGAPTR(pScrn); @@ -323,7 +322,6 @@ double MGAG450SetPLLFreq(ScrnInfoPtr pScrn, long f_out) ulMaxIndex = 1; while(ulMNP != 0xffffffff) { - int ulIndex; Bool bSkipValue; bSkipValue = FALSE; @@ -344,6 +342,7 @@ double MGAG450SetPLLFreq(ScrnInfoPtr pScrn, long f_out) if(!bSkipValue) { + int ulIndex; for(ulIndex = ulMaxIndex; !bSkipValue && (ulIndex > 0); ulIndex--) { G450CompareMNP(pScrn, f_out, ulMNP, ulMNPTable[ulIndex - 1], @@ -374,7 +373,7 @@ double MGAG450SetPLLFreq(ScrnInfoPtr pScrn, long f_out) OUTREG8(0x1fc2, (CARD8)(ucMisc | CLKSEL_MGA)); } - for(ulIndex = 0; !bFoundValidPLL && (ulIndex < ulMaxIndex); ulIndex++) + for(CARD32 ulIndex = 0; !bFoundValidPLL && (ulIndex < ulMaxIndex); ulIndex++) { ulTryMNP = ulMNPTable[ulIndex]; -- cgit v1.2.3