aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-01-09 23:44:33 +0100
committerUlrich Sibiller <uli42@gmx.de>2020-01-10 00:25:46 +0100
commit870746222abbecd16f113b93a4420846b2d5d510 (patch)
treed37bc95c2ac92525f898e14f22b43a24c173aea9
parenta94e8258f72ab5db4b9a1de7e10140b8d622667b (diff)
downloadnx-libs-870746222abbecd16f113b93a4420846b2d5d510.tar.gz
nx-libs-870746222abbecd16f113b93a4420846b2d5d510.tar.bz2
nx-libs-870746222abbecd16f113b93a4420846b2d5d510.zip
compext/Clean.c: fix shadow warnings / scope
Clean.c: In function ‘CleanZImage’: Clean.c:141:23: warning: declaration of ‘j’ shadows a previous local [-Wshadow=local] register int i, j; ^ Clean.c:88:16: note: shadowed declaration is here unsigned int j; ^ Clean.c: In function ‘CopyAndCleanImage’: Clean.c:239:22: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local] register int i; ^ Clean.c:192:16: note: shadowed declaration is here register int i; ^ Clean.c:324:13: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local] int i; ^ Clean.c:192:16: note: shadowed declaration is here register int i; ^
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/compext/Clean.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Clean.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Clean.c
index 7a6d81b6b..0cc60410d 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/compext/Clean.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Clean.c
@@ -85,7 +85,6 @@ int CleanXYImage(XImage *image)
int CleanZImage(XImage *image)
{
unsigned int bytesToClean;
- unsigned int j;
unsigned int imageLength;
#ifdef TEST
@@ -105,8 +104,6 @@ int CleanZImage(XImage *image)
* as fully transparent.
*/
- register int i;
-
bytesToClean = image -> bytes_per_line * image -> height;
#ifdef DEBUG
@@ -118,14 +115,14 @@ int CleanZImage(XImage *image)
if (image -> byte_order == LSBFirst)
{
- for (i = 3; i < bytesToClean; i += 4)
+ for (int i = 3; i < bytesToClean; i += 4)
{
((unsigned char *) image -> data)[i] = 0x00;
}
}
else
{
- for (i = 0; i < bytesToClean; i += 4)
+ for (int i = 0; i < bytesToClean; i += 4)
{
((unsigned char *) image -> data)[i] = 0x00;
}
@@ -138,14 +135,12 @@ int CleanZImage(XImage *image)
case 16:
case 8:
{
- register int i, j;
-
bytesToClean = image -> bytes_per_line -
((image -> width * image -> bits_per_pixel) >> 3);
- for (i = 1; i <= image -> height; i++)
+ for (int i = 1; i <= image -> height; i++)
{
- for (j = bytesToClean; j > 0; j--)
+ for (int j = bytesToClean; j > 0; j--)
{
((unsigned char *) image -> data)[(i * image -> bytes_per_line) - j] = 0x00;
}
@@ -171,7 +166,7 @@ int CleanZImage(XImage *image)
bytesToClean = imageLength % 4;
- for (j = 0; j < bytesToClean; j++)
+ for (int j = 0; j < bytesToClean; j++)
{
((unsigned char *)image -> data)[(imageLength + j)] = 0x00;
}
@@ -189,7 +184,6 @@ int CleanZImage(XImage *image)
int CopyAndCleanImage(XImage *src_image, XImage *dst_image)
{
register long data_size;
- register int i;
data_size = (src_image -> bytes_per_line * src_image -> height) >> 2;
@@ -212,7 +206,7 @@ int CopyAndCleanImage(XImage *src_image, XImage *dst_image)
{
mask = 0x00ffffff;
}
- for (i = 0; i < data_size; i++)
+ for (int i = 0; i < data_size; i++)
{
((unsigned int *)dst_image -> data)[i] = ((unsigned int *)src_image -> data)[i] & mask;
}
@@ -224,7 +218,7 @@ int CopyAndCleanImage(XImage *src_image, XImage *dst_image)
{
unsigned int bytes_to_clean;
- for (i = 0; i < data_size; i++)
+ for (int i = 0; i < data_size; i++)
{
((unsigned int *)dst_image -> data)[i] = ((unsigned int *)src_image -> data)[i];
}
@@ -236,7 +230,6 @@ int CopyAndCleanImage(XImage *src_image, XImage *dst_image)
{
register unsigned int mask = 0xffffffff;
register int line_size;
- register int i;
line_size = dst_image -> bytes_per_line >> 2;
@@ -249,7 +242,7 @@ int CopyAndCleanImage(XImage *src_image, XImage *dst_image)
mask = mask >> (bytes_to_clean << 3);
}
- for (i = 0; i < dst_image -> height;)
+ for (int i = 0; i < dst_image -> height;)
{
((unsigned char *)dst_image -> data)[(++i * line_size) -1] &= mask;
}
@@ -261,7 +254,7 @@ int CopyAndCleanImage(XImage *src_image, XImage *dst_image)
case 15:
case 16:
{
- for (i = 0; i < data_size; i++)
+ for (int i = 0; i < data_size; i++)
{
((unsigned int *) dst_image -> data)[i] = ((unsigned int *) src_image -> data)[i];
}
@@ -270,7 +263,7 @@ int CopyAndCleanImage(XImage *src_image, XImage *dst_image)
{
int card32_per_line = dst_image -> bytes_per_line >> 2;
- for (i = 0; i < dst_image -> height;)
+ for (int i = 0; i < dst_image -> height;)
{
((unsigned int *) dst_image -> data)[(++i * card32_per_line) -1] &= 0x0000ffff;
}
@@ -313,7 +306,7 @@ int CopyAndCleanImage(XImage *src_image, XImage *dst_image)
}
}
- for (i = 0; i < data_size; i++)
+ for (int i = 0; i < data_size; i++)
{
((unsigned int *) dst_image -> data)[i] = ((unsigned int *) src_image -> data)[i];
}
@@ -321,11 +314,10 @@ int CopyAndCleanImage(XImage *src_image, XImage *dst_image)
if (mask)
{
int card32_per_line;
- int i;
card32_per_line = dst_image -> bytes_per_line >> 2;
- for (i = 0; i < dst_image -> height; i++)
+ for (int i = 0; i < dst_image -> height; i++)
{
((unsigned int *) dst_image -> data)[(++i * card32_per_line) -1] &= mask;
}