From 924bfb65604238439374c314bd02ff2b99441e21 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 3 Jun 2020 12:07:52 -0700 Subject: [PATCH] nir: get_base_type() should return enum type Needed by the next patch, for c++ code which is more strict about conversions between integers and enums. Signed-off-by: Rob Clark Reviewed-by: Alyssa Rosenzweig Reviewed-by: Eric Anholt Reviewed-by: Kristian H. Kristensen Part-of: --- src/compiler/nir/nir.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index b7f7e46c9b0..a673a2a8f31 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1023,10 +1023,10 @@ nir_alu_type_get_type_size(nir_alu_type type) return type & NIR_ALU_TYPE_SIZE_MASK; } -static inline unsigned +static inline nir_alu_type nir_alu_type_get_base_type(nir_alu_type type) { - return type & NIR_ALU_TYPE_BASE_TYPE_MASK; + return (nir_alu_type)(type & NIR_ALU_TYPE_BASE_TYPE_MASK); } static inline nir_alu_type -- 2.30.2