From 8825bf9b48c5e3bb0741b874e8ed2ecb03566907 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 23 Jul 2025 09:29:22 +0200 Subject: [PATCH] nir: fix returning _Bool instead of pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building for C23 the compiler warns about returning a boolean when a different type is expected instead. Change the code to return NULL instead of false, fixing the following error: ----------------------------------------------------------------------- ../src/compiler/nir/nir_lower_io_indirect_loads.c: In function ‘get_load_once_variable’: ../src/compiler/nir/nir_lower_io_indirect_loads.c:87:17: error: incompatible types when returning type ‘_Bool’ but ‘nir_variable **’ {aka ‘struct nir_variable **’} was expected 87 | return false; | ^~~~~ ----------------------------------------------------------------------- Reviewed-by: Faith Ekstrand Part-of: --- src/compiler/nir/nir_lower_io_indirect_loads.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_lower_io_indirect_loads.c b/src/compiler/nir/nir_lower_io_indirect_loads.c index 90ebcf05ba3..0c95f439f56 100644 --- a/src/compiler/nir/nir_lower_io_indirect_loads.c +++ b/src/compiler/nir/nir_lower_io_indirect_loads.c @@ -84,7 +84,7 @@ get_load_once_variable(gl_shader_stage stage, nir_intrinsic_instr *intr, */ nir_intrinsic_instr *baryc = nir_src_as_intrinsic(intr->src[0]); if (!baryc) - return false; + return NULL; enum glsl_interp_mode interp = nir_intrinsic_interp_mode(baryc);