diff options
author | Nicolai Hähnle <[email protected]> | 2016-04-29 21:56:25 -0500 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2016-05-07 16:46:59 -0500 |
commit | 62b7958cd0ec03ff1e15144f0104728458621d1d (patch) | |
tree | d330bc5025886e1cfdd7bccd252e45fe2b98a6d7 /src/gallium/auxiliary/util | |
parent | 945c6887ab43a98a6e042841b2fb547aaef250e2 (diff) |
gallium: fix various undefined left shifts into sign bit
Funnily enough, some of these were turned into a compile-time error by gcc
with -fsanitize=undefined ("initializer is not a constant").
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Michel Dänzer <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_pack_color.h | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_pstipple.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_pack_color.h b/src/gallium/auxiliary/util/u_pack_color.h index b882502b7ba..f9f41609b44 100644 --- a/src/gallium/auxiliary/util/u_pack_color.h +++ b/src/gallium/auxiliary/util/u_pack_color.h @@ -367,7 +367,7 @@ util_pack_color(const float rgba[4], enum pipe_format format, union util_color * return; case PIPE_FORMAT_BGRX8888_UNORM: { - uc->ui[0] = (0xff << 24) | (r << 16) | (g << 8) | b; + uc->ui[0] = (0xffu << 24) | (r << 16) | (g << 8) | b; } return; case PIPE_FORMAT_ARGB8888_UNORM: diff --git a/src/gallium/auxiliary/util/u_pstipple.c b/src/gallium/auxiliary/util/u_pstipple.c index 3ae8923f953..f6ea535c413 100644 --- a/src/gallium/auxiliary/util/u_pstipple.c +++ b/src/gallium/auxiliary/util/u_pstipple.c @@ -63,7 +63,7 @@ util_pstipple_update_stipple_texture(struct pipe_context *pipe, struct pipe_resource *tex, const uint32_t pattern[32]) { - static const uint bit31 = 1 << 31; + static const uint bit31 = 1u << 31; struct pipe_transfer *transfer; ubyte *data; int i, j; |