projects
/
platform
/
upstream
/
pixman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85467ec
)
Promote unsigned short to unsigned int explicitly
author
Behdad Esfahbod
<behdad@behdad.org>
Tue, 9 Jan 2018 09:26:29 +0000
(10:26 +0100)
committer
Behdad Esfahbod
<behdad@behdad.org>
Tue, 9 Jan 2018 09:26:29 +0000
(10:26 +0100)
...to avoid default promotion to signed int, which causes undefined
behaviour in the shift expression.
pixman/pixman-solid-fill.c
patch
|
blob
|
history
diff --git
a/pixman/pixman-solid-fill.c
b/pixman/pixman-solid-fill.c
index 5f9fef630648c4d96fa1f60acd94d0f1dd4cecba..4694ebc7004f7875a34cd23db1ee97af0f56e589 100644
(file)
--- 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