From: Rob Clark Date: Wed, 3 Jun 2020 19:07:52 +0000 (-0700) Subject: nir: get_base_type() should return enum type X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=924bfb65604238439374c314bd02ff2b99441e21;p=mesa.git 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: --- 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