tests: Fix undefined left shift in internal-screenshot-test

../tests/internal-screenshot-test.c:60:18: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
dev
Adam Jackson 5 years ago
parent ad0fe6b6f9
commit 3cfd297f2c
  1. 4
      tests/internal-screenshot-test.c

@ -38,7 +38,7 @@ draw_stuff(pixman_image_t *image)
int w, h; int w, h;
int stride; /* bytes */ int stride; /* bytes */
int x, y; int x, y;
uint8_t r, g, b; uint32_t r, g, b;
uint32_t *pixels; uint32_t *pixels;
uint32_t *pixel; uint32_t *pixel;
pixman_format_code_t fmt; pixman_format_code_t fmt;
@ -57,7 +57,7 @@ draw_stuff(pixman_image_t *image)
g = x + y; g = x + y;
r = y; r = y;
pixel = pixels + (y * stride / 4) + x; pixel = pixels + (y * stride / 4) + x;
*pixel = (255 << 24) | (r << 16) | (g << 8) | b; *pixel = (255U << 24) | (r << 16) | (g << 8) | b;
} }
} }

Loading…
Cancel
Save