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 <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Nicolai Hähnle
2016-04-29 21:56:25 -05:00
parent 945c6887ab
commit 62b7958cd0
6 changed files with 8 additions and 8 deletions

View File

@@ -1121,7 +1121,7 @@ st_translate_program_common(struct st_context *st,
/* Also add patch inputs. */
for (attr = 0; attr < 32; attr++) {
if (prog->PatchInputsRead & (1 << attr)) {
if (prog->PatchInputsRead & (1u << attr)) {
GLuint slot = num_inputs++;
GLuint patch_attr = VARYING_SLOT_PATCH0 + attr;
@@ -1240,7 +1240,7 @@ st_translate_program_common(struct st_context *st,
/* Also add patch outputs. */
for (attr = 0; attr < 32; attr++) {
if (prog->PatchOutputsWritten & (1 << attr)) {
if (prog->PatchOutputsWritten & (1u << attr)) {
GLuint slot = num_outputs++;
GLuint patch_attr = VARYING_SLOT_PATCH0 + attr;