From: Adam Jackson Date: Wed, 16 Oct 2019 20:07:47 +0000 (-0400) Subject: tests: Fix undefined left shift in internal-screenshot-test X-Git-Tag: upstream/9.0.0~352 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cfd297f2cce0acd7873e54f1a56892bcc29432f;p=platform%2Fupstream%2Fweston.git 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' --- diff --git a/tests/internal-screenshot-test.c b/tests/internal-screenshot-test.c index 2a7424b8..1963e77e 100644 --- a/tests/internal-screenshot-test.c +++ b/tests/internal-screenshot-test.c @@ -38,7 +38,7 @@ draw_stuff(pixman_image_t *image) int w, h; int stride; /* bytes */ int x, y; - uint8_t r, g, b; + uint32_t r, g, b; uint32_t *pixels; uint32_t *pixel; pixman_format_code_t fmt; @@ -57,7 +57,7 @@ draw_stuff(pixman_image_t *image) g = x + y; r = y; pixel = pixels + (y * stride / 4) + x; - *pixel = (255 << 24) | (r << 16) | (g << 8) | b; + *pixel = (255U << 24) | (r << 16) | (g << 8) | b; } }