aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-10-31 01:48:18 +0100
committerUlrich Sibiller <uli42@gmx.de>2020-01-05 22:40:32 +0100
commitfc991b93a9f8c4ea53a8d53ab24f3906f3ca3004 (patch)
treee06c98af678ef21de22b6926d56e58bee467bfc4
parent6a02a67957bbe600d508b316e6c6115a050b3e90 (diff)
downloadnx-libs-fc991b93a9f8c4ea53a8d53ab24f3906f3ca3004.tar.gz
nx-libs-fc991b93a9f8c4ea53a8d53ab24f3906f3ca3004.tar.bz2
nx-libs-fc991b93a9f8c4ea53a8d53ab24f3906f3ca3004.zip
Pixels.c: scope improvements
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pixels.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.c b/nx-X11/programs/Xserver/hw/nxagent/Pixels.c
index 93038eab6..5e5573ada 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.c
@@ -56,8 +56,6 @@ static int nxagentComparePixels(const void *p1, const void *p2)
int nxagentUniquePixels(XImage *image)
{
- int i = 0;
-
int pixels[PIXEL_ELEMENTS];
int elements = PIXEL_ELEMENTS;
@@ -140,7 +138,7 @@ int nxagentUniquePixels(XImage *image)
{
case 32:
{
- for (i = 0; i < elements; i++)
+ for (int i = 0; i < elements; i++)
{
pixels[i] = Get32(next, image -> byte_order);
@@ -156,7 +154,7 @@ int nxagentUniquePixels(XImage *image)
}
case 24:
{
- for (i = 0; i < elements; i++)
+ for (int i = 0; i < elements; i++)
{
pixels[i] = Get24(next, image -> byte_order);
@@ -181,7 +179,7 @@ int nxagentUniquePixels(XImage *image)
* the image data.
*/
- for (i = 0; i < elements; i++)
+ for (int i = 0; i < elements; i++)
{
pixels[i] = Get16(next, image -> byte_order);
@@ -212,7 +210,7 @@ int nxagentUniquePixels(XImage *image)
qsort(pixels, elements, sizeof(int), nxagentComparePixels);
- for (i = 0; i < elements; i++)
+ for (int i = 0; i < elements; i++)
{
if (last != pixels[i])
{