summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2019-10-15 13:40:01 -0400
committerAdam Jackson <ajax@redhat.com>2019-10-15 14:06:56 -0400
commit55482c1caf4dbe7f4735b75366bd4acd81937fc1 (patch)
tree85b926fc5794266476511965c72b9f9c7b930114 /render
parent592525386ad81cf9c8816f42f01a5bea01034e98 (diff)
render: Fix undefined shift in xRenderColorToCard32
Delightfully this is undefined even though CARD16 is an "unsigned" type, because it's an unsigned short, which C promotes to signed int because everything is stupid.
Diffstat (limited to 'render')
-rw-r--r--render/picture.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/render/picture.c b/render/picture.c
index c8f24f7f4..876316dc1 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -793,8 +793,10 @@ static CARD32
xRenderColorToCard32(xRenderColor c)
{
return
- (c.alpha >> 8 << 24) |
- (c.red >> 8 << 16) | (c.green & 0xff00) | (c.blue >> 8);
+ ((unsigned)c.alpha >> 8 << 24) |
+ ((unsigned)c.red >> 8 << 16) |
+ ((unsigned)c.green & 0xff00) |
+ ((unsigned)c.blue >> 8);
}
static void