nir: fix returning _Bool instead of pointer

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 <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36323>
This commit is contained in:
Antonio Ospite
2025-07-23 09:29:22 +02:00
committed by Marge Bot
parent c869971d05
commit 8825bf9b48
@@ -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);