diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2016-01-08 14:03:38 +0000 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2016-01-08 20:06:59 +0000 |
commit | 208bfc493debe0344d0b9cb93975981f14412628 (patch) | |
tree | 65367a25f4068e0b85832ac3b64c553702a41370 /src/glsl/link_varyings.cpp | |
parent | e378184d9c31a4b8f67cf1b75f401f2d5c54782a (diff) | |
download | external_mesa3d-208bfc493debe0344d0b9cb93975981f14412628.zip external_mesa3d-208bfc493debe0344d0b9cb93975981f14412628.tar.gz external_mesa3d-208bfc493debe0344d0b9cb93975981f14412628.tar.bz2 |
glsl: Ensure 64bits shift is used.
I believe that `1u << x`, where x >= 32 yields undefined results
according to the C standard.
Particularly MSVC says `warning C4334: '<<' : result of 32-bit shift
implicitly converted to 64 bits (was 64-bit shift intended?)`.
Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/glsl/link_varyings.cpp')
-rw-r--r-- | src/glsl/link_varyings.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp index 8763cc5..3853abd 100644 --- a/src/glsl/link_varyings.cpp +++ b/src/glsl/link_varyings.cpp @@ -1110,8 +1110,8 @@ varying_matches::assign_locations(struct gl_shader_program *prog, */ for (unsigned j = 0; j < num_elements; j++) { while ((slot_end < MAX_VARYING * 4u) && - ((reserved_slots & (1u << *location / 4u) || - (reserved_slots & (1u << slot_end / 4u))))) { + ((reserved_slots & (UINT64_C(1) << *location / 4u) || + (reserved_slots & (UINT64_C(1) << slot_end / 4u))))) { *location = ALIGN(*location + 1, 4); slot_end = *location; @@ -1529,7 +1529,7 @@ reserved_varying_slot(struct gl_shader *stage, ir_variable_mode io_mode) ->count_attribute_slots(stage->Stage == MESA_SHADER_VERTEX); for (unsigned i = 0; i < num_elements; i++) { if (var_slot >= 0 && var_slot < MAX_VARYING) - slots |= 1u << var_slot; + slots |= UINT64_C(1) << var_slot; var_slot += 1; } } |