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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user