nir: Return NULL, not false, from functions returning pointers

Reported by clang's `-Wbool-conversion`.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34014>
This commit is contained in:
Matt Turner
2025-03-11 15:36:30 -04:00
committed by Marge Bot
parent 702f554aae
commit 7534559f2f
3 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -545,14 +545,14 @@ lower_doubles_instr_to_soft(nir_builder *b, nir_alu_instr *instr,
switch (instr->op) {
case nir_op_f2i64:
if (instr->src[0].src.ssa->bit_size != 64)
return false;
return NULL;
name = "__fp64_to_int64";
mangled_name = "__fp64_to_int64(u641;";
return_type = glsl_int64_t_type();
break;
case nir_op_f2u64:
if (instr->src[0].src.ssa->bit_size != 64)
return false;
return NULL;
name = "__fp64_to_uint64";
mangled_name = "__fp64_to_uint64(u641;";
break;
@@ -675,7 +675,7 @@ lower_doubles_instr_to_soft(nir_builder *b, nir_alu_instr *instr,
return_type = glsl_bool_type();
break;
default:
return false;
return NULL;
}
assert(softfp64 != NULL);
+1 -1
View File
@@ -64,7 +64,7 @@ try_opt_bcsel_of_shuffle(nir_builder *b, nir_alu_instr *alu,
* now and subgroup ops in the presence of discard aren't common.
*/
if (block_has_discard)
return false;
return NULL;
if (!nir_alu_src_is_trivial_ssa(alu, 0))
return NULL;
+2 -2
View File
@@ -2814,12 +2814,12 @@ check_tes_input_load_get_single_use_alu(nir_intrinsic_instr *load,
/* Check the vertex index. Each vertex can be loaded only once. */
if (!nir_src_is_const(load->src[0]))
return false;
return NULL;
*vertex_index = nir_src_as_uint(load->src[0]);
if (*vertex_index >= max_vertices ||
*vertices_used & BITFIELD_BIT(*vertex_index))
return false;
return NULL;
*vertices_used |= BITFIELD_BIT(*vertex_index);