From ae3c495de1779e83d9fa0440568f9f91930ae219 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Thu, 29 May 2025 16:54:41 -0700 Subject: [PATCH] formats: Cast enum to int before shifting Reviewed-By: Mike Blumenkrantz Part-of: --- src/mesa/main/formats.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 50c65aca848..f479a98b804 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -189,7 +189,7 @@ _mesa_array_format_get_datatype(mesa_array_format f) static inline int _mesa_array_format_datatype_get_size(enum mesa_array_format_datatype type) { - return 1 << (type & MESA_ARRAY_FORMAT_TYPE_SIZE_MASK); + return 1 << ((int)type & MESA_ARRAY_FORMAT_TYPE_SIZE_MASK); } static inline int