From fc991b93a9f8c4ea53a8d53ab24f3906f3ca3004 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 31 Oct 2019 01:48:18 +0100 Subject: Pixels.c: scope improvements --- nx-X11/programs/Xserver/hw/nxagent/Pixels.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Pixels.c') 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]) { -- cgit v1.2.3 From adca0cc92abed6f7f6184b91d807a4befb80e856 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 31 Oct 2019 01:49:12 +0100 Subject: Pixels.c: reformat comments --- nx-X11/programs/Xserver/hw/nxagent/Pixels.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Pixels.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.c b/nx-X11/programs/Xserver/hw/nxagent/Pixels.c index 5e5573ada..8aaa9ecd8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.c @@ -130,8 +130,7 @@ int nxagentUniquePixels(XImage *image) #endif /* - * Take one pixel every n from the image and - * add it to the array. + * Take one pixel every n from the image and add it to the array. */ switch (image -> bits_per_pixel) @@ -172,11 +171,9 @@ int nxagentUniquePixels(XImage *image) case 15: { /* - * Note that the padding bytes at the end - * of the scanline are included in the set. - * This is not a big problem. What we want - * to find out is just how compressible is - * the image data. + * Note that the padding bytes at the end of the scanline are + * included in the set. This is not a big problem. What we want + * to find out is just how compressible is the image data. */ for (int i = 0; i < elements; i++) -- cgit v1.2.3