aboutsummaryrefslogtreecommitdiff
path: root/pixman/test
diff options
context:
space:
mode:
Diffstat (limited to 'pixman/test')
-rw-r--r--pixman/test/blitters-test.c3
-rw-r--r--pixman/test/utils.c19
2 files changed, 11 insertions, 11 deletions
diff --git a/pixman/test/blitters-test.c b/pixman/test/blitters-test.c
index af948350b..920cbbbd7 100644
--- a/pixman/test/blitters-test.c
+++ b/pixman/test/blitters-test.c
@@ -244,7 +244,7 @@ test_composite (int testnum, int verbose)
int w, h;
pixman_op_t op;
pixman_format_code_t src_fmt, dst_fmt, mask_fmt;
- uint32_t *dstbuf, *srcbuf, *maskbuf;
+ uint32_t *srcbuf, *maskbuf;
uint32_t crc32;
int max_width, max_height, max_extra_stride;
FLOAT_REGS_CORRUPTION_DETECTOR_START ();
@@ -291,7 +291,6 @@ test_composite (int testnum, int verbose)
dst_height = pixman_image_get_height (dst_img);
dst_stride = pixman_image_get_stride (dst_img);
- dstbuf = pixman_image_get_data (dst_img);
srcbuf = pixman_image_get_data (src_img);
src_x = prng_rand_n (src_width);
diff --git a/pixman/test/utils.c b/pixman/test/utils.c
index 34007476b..0cd982e73 100644
--- a/pixman/test/utils.c
+++ b/pixman/test/utils.c
@@ -251,6 +251,7 @@ print_image (pixman_image_t *image)
int width, height, stride;
pixman_format_code_t format;
uint8_t *buffer;
+ int s;
width = pixman_image_get_width (image);
height = pixman_image_get_height (image);
@@ -258,13 +259,12 @@ print_image (pixman_image_t *image)
format = pixman_image_get_format (image);
buffer = (uint8_t *)pixman_image_get_data (image);
- if (stride < 0)
- stride = - stride;
+ s = (stride >= 0)? stride : - stride;
printf ("---\n");
for (i = 0; i < height; i++)
{
- for (j = 0; j < stride; j++)
+ for (j = 0; j < s; j++)
{
if (j == (width * PIXMAN_FORMAT_BPP (format) + 7) / 8)
printf ("| ");
@@ -297,11 +297,12 @@ image_endian_swap (pixman_image_t *img)
for (i = 0; i < height; i++)
{
uint8_t *line_data = (uint8_t *)data + stride * i;
-
+ int s = (stride >= 0)? stride : - stride;
+
switch (bpp)
{
case 1:
- for (j = 0; j < stride; j++)
+ for (j = 0; j < s; j++)
{
line_data[j] =
((line_data[j] & 0x80) >> 7) |
@@ -315,13 +316,13 @@ image_endian_swap (pixman_image_t *img)
}
break;
case 4:
- for (j = 0; j < stride; j++)
+ for (j = 0; j < s; j++)
{
line_data[j] = (line_data[j] >> 4) | (line_data[j] << 4);
}
break;
case 16:
- for (j = 0; j + 2 <= stride; j += 2)
+ for (j = 0; j + 2 <= s; j += 2)
{
char t1 = line_data[j + 0];
char t2 = line_data[j + 1];
@@ -331,7 +332,7 @@ image_endian_swap (pixman_image_t *img)
}
break;
case 24:
- for (j = 0; j + 3 <= stride; j += 3)
+ for (j = 0; j + 3 <= s; j += 3)
{
char t1 = line_data[j + 0];
char t2 = line_data[j + 1];
@@ -343,7 +344,7 @@ image_endian_swap (pixman_image_t *img)
}
break;
case 32:
- for (j = 0; j + 4 <= stride; j += 4)
+ for (j = 0; j + 4 <= s; j += 4)
{
char t1 = line_data[j + 0];
char t2 = line_data[j + 1];