aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-01-09 23:06:08 +0100
committerUlrich Sibiller <uli42@gmx.de>2020-01-10 00:25:46 +0100
commit4b8194e1eafb9fd788b814921f9e2518a2079344 (patch)
tree75377cbeef2555fcb49719787494d2f136dfb9ae /nx-X11
parent1a1ace774f49bccbb4760b4a0c58e56bf46548db (diff)
downloadnx-libs-4b8194e1eafb9fd788b814921f9e2518a2079344.tar.gz
nx-libs-4b8194e1eafb9fd788b814921f9e2518a2079344.tar.bz2
nx-libs-4b8194e1eafb9fd788b814921f9e2518a2079344.zip
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: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Peter 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}; ^~
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/mi/mibitblt.c6
-rw-r--r--nx-X11/programs/Xserver/mi/mispans.c10
2 files changed, 7 insertions, 9 deletions
diff --git a/nx-X11/programs/Xserver/mi/mibitblt.c b/nx-X11/programs/Xserver/mi/mibitblt.c
index 67d36a742..7b1aca794 100644
--- a/nx-X11/programs/Xserver/mi/mibitblt.c
+++ b/nx-X11/programs/Xserver/mi/mibitblt.c
@@ -666,7 +666,7 @@ miGetImage(pDraw, sx, sy, w, h, format, planeMask, pDst)
{
if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
{
- xPoint pt;
+ xPoint xpt;
pGC = GetScratchGC(depth, pDraw->pScreen);
if (!pGC)
@@ -683,9 +683,9 @@ miGetImage(pDraw, sx, sy, w, h, format, planeMask, pDst)
* Clear the pixmap before doing anything else
*/
ValidateGC((DrawablePtr)pPixmap, pGC);
- pt.x = pt.y = 0;
+ xpt.x = xpt.y = 0;
width = w;
- (*pGC->ops->FillSpans)((DrawablePtr)pPixmap, pGC, 1, &pt, &width,
+ (*pGC->ops->FillSpans)((DrawablePtr)pPixmap, pGC, 1, &xpt, &width,
TRUE);
/* alu is already GXCopy */
diff --git a/nx-X11/programs/Xserver/mi/mispans.c b/nx-X11/programs/Xserver/mi/mispans.c
index a8762d323..c731f2a03 100644
--- a/nx-X11/programs/Xserver/mi/mispans.c
+++ b/nx-X11/programs/Xserver/mi/mispans.c
@@ -462,12 +462,12 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
ysizes[index] * sizeof(int));
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[i].widths);
+ free (yspans[k].points);
+ free (yspans[k].widths);
}
free (yspans);
free (ysizes);
@@ -494,8 +494,6 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
widths = (int *) malloc(count * sizeof(int));
if (!points || !widths)
{
- int i;
-
for (i = 0; i < ylength; i++)
{
free (yspans[i].points);