src/compiler: Fix warning C4244 'argument' : conversion from 'type1' to 'type2', possible loss of data

Reviewed-By: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jesse Natalie <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32979>
This commit is contained in:
Sil Vilerino
2025-01-09 08:20:54 -05:00
committed by Marge Bot
parent 4d653c7df9
commit 8ecb7bc2a2
4 changed files with 24 additions and 18 deletions
+3 -3
View File
@@ -329,9 +329,9 @@ nir_const_value_for_raw_uint(uint64_t x, unsigned bit_size)
/* clang-format off */
switch (bit_size) {
case 1: v.b = x; break;
case 8: v.u8 = x; break;
case 16: v.u16 = x; break;
case 32: v.u32 = x; break;
case 8: v.u8 = (uint8_t)x; break;
case 16: v.u16 = (uint16_t)x; break;
case 32: v.u32 = (uint32_t)x; break;
case 64: v.u64 = x; break;
default:
unreachable("Invalid bit size");