Commit 4b8194e1 authored by Ulrich Sibiller's avatar Ulrich Sibiller

mi: fix shadow warnings

Based on the following commit. But for mispans.c I think the first contained fix is wrong (nested loop with variable i) so I took another approach. commit f02e27e4fcc34413b2051e5a01edc92172fa8612 Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Date: Tue Oct 16 02:16:17 2012 -0500 mi: fix shadow warnings mibitblt.c: In function 'miGetImage': mibitblt.c:617:20: warning: declaration of 'pt' shadows a previous local mibitblt.c:609:17: warning: shadowed declaration is here mispans.c: In function 'miFillUniqueSpanGroup': mispans.c:456:33: warning: declaration of 'i' shadows a previous local mispans.c:382:9: warning: shadowed declaration is here mispans.c:488:17: warning: declaration of 'i' shadows a previous local mispans.c:382:9: warning: shadowed declaration is here Signed-off-by: 's avatarYaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net> Fixes these warnings: mi/mispans.c: fix shadowed vars mispans.c: In function ‘miFillUniqueSpanGroup’: mispans.c:465:12: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local] int i; ^ mispans.c:387:21: note: shadowed declaration is here register int i; ^ mispans.c:497:10: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local] int i; ^ mispans.c:387:21: note: shadowed declaration is here register int i; ^ mibitblt.c: In function ‘miGetImage’: mibitblt.c:669:13: warning: declaration of ‘pt’ shadows a previous local [-Wshadow=compatible-local] xPoint pt; ^~ mibitblt.c:659:18: note: shadowed declaration is here DDXPointRec pt = {0, 0}; ^~
parent 1a1ace77
...@@ -666,7 +666,7 @@ miGetImage(pDraw, sx, sy, w, h, format, planeMask, pDst) ...@@ -666,7 +666,7 @@ miGetImage(pDraw, sx, sy, w, h, format, planeMask, pDst)
{ {
if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 ) if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
{ {
xPoint pt; xPoint xpt;
pGC = GetScratchGC(depth, pDraw->pScreen); pGC = GetScratchGC(depth, pDraw->pScreen);
if (!pGC) if (!pGC)
...@@ -683,9 +683,9 @@ miGetImage(pDraw, sx, sy, w, h, format, planeMask, pDst) ...@@ -683,9 +683,9 @@ miGetImage(pDraw, sx, sy, w, h, format, planeMask, pDst)
* Clear the pixmap before doing anything else * Clear the pixmap before doing anything else
*/ */
ValidateGC((DrawablePtr)pPixmap, pGC); ValidateGC((DrawablePtr)pPixmap, pGC);
pt.x = pt.y = 0; xpt.x = xpt.y = 0;
width = w; width = w;
(*pGC->ops->FillSpans)((DrawablePtr)pPixmap, pGC, 1, &pt, &width, (*pGC->ops->FillSpans)((DrawablePtr)pPixmap, pGC, 1, &xpt, &width,
TRUE); TRUE);
/* alu is already GXCopy */ /* alu is already GXCopy */
......
...@@ -462,12 +462,12 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) ...@@ -462,12 +462,12 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
ysizes[index] * sizeof(int)); ysizes[index] * sizeof(int));
if (!newpoints || !newwidths) if (!newpoints || !newwidths)
{ {
int i; int k;
for (i = 0; i < ylength; i++) for (k = 0; k < ylength; k++)
{ {
free (yspans[i].points); free (yspans[k].points);
free (yspans[i].widths); free (yspans[k].widths);
} }
free (yspans); free (yspans);
free (ysizes); free (ysizes);
...@@ -494,8 +494,6 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) ...@@ -494,8 +494,6 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
widths = (int *) malloc(count * sizeof(int)); widths = (int *) malloc(count * sizeof(int));
if (!points || !widths) if (!points || !widths)
{ {
int i;
for (i = 0; i < ylength; i++) for (i = 0; i < ylength; i++)
{ {
free (yspans[i].points); free (yspans[i].points);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment