pixman: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Jan 9 09:26:53 UTC 2018


 pixman/pixman-solid-fill.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 8b95e0e460baa499e54c19d29bf761d34c25badc
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Jan 9 10:26:29 2018 +0100

    Promote unsigned short to unsigned int explicitly
    
    ...to avoid default promotion to signed int, which causes undefined
    behaviour in the shift expression.

diff --git a/pixman/pixman-solid-fill.c b/pixman/pixman-solid-fill.c
index 5f9fef6..4694ebc 100644
--- a/pixman/pixman-solid-fill.c
+++ b/pixman/pixman-solid-fill.c
@@ -30,10 +30,10 @@ static uint32_t
 color_to_uint32 (const pixman_color_t *color)
 {
     return
-        (color->alpha >> 8 << 24) |
-        (color->red >> 8 << 16) |
-        (color->green & 0xff00) |
-        (color->blue >> 8);
+        ((unsigned int) color->alpha >> 8 << 24) |
+        ((unsigned int) color->red >> 8 << 16) |
+        ((unsigned int) color->green & 0xff00) |
+        ((unsigned int) color->blue >> 8);
 }
 
 static argb_t


More information about the xorg-commit mailing list