aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Pixels.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Pixels.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pixels.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.c b/nx-X11/programs/Xserver/hw/nxagent/Pixels.c
index 93038eab6..8aaa9ecd8 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;
@@ -132,15 +130,14 @@ 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)
{
case 32:
{
- for (i = 0; i < elements; i++)
+ for (int i = 0; i < elements; i++)
{
pixels[i] = Get32(next, image -> byte_order);
@@ -156,7 +153,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);
@@ -174,14 +171,12 @@ 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 (i = 0; i < elements; i++)
+ for (int i = 0; i < elements; i++)
{
pixels[i] = Get16(next, image -> byte_order);
@@ -212,7 +207,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])
{