From 0dd8051f344a3b3689f1cf1a401f73c77ec204f2 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 23 Jul 2025 10:46:55 +0200 Subject: [PATCH] radv: 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 errors: ----------------------------------------------------------------------- ../src/amd/vulkan/radv_pipeline_cache.c: In function ‘radv_pipeline_cache_object_search’: ../src/amd/vulkan/radv_pipeline_cache.c:338:14: error: incompatible types when returning type ‘_Bool’ but ‘struct radv_pipeline_cache_object *’ was expected 338 | return false; | ^~~~~ ../src/amd/vulkan/radv_pipeline_cache.c:352:14: error: incompatible types when returning type ‘_Bool’ but ‘struct radv_pipeline_cache_object *’ was expected 352 | return false; | ^~~~~ ----------------------------------------------------------------------- Reviewed-by: Faith Ekstrand Part-of: --- src/amd/vulkan/radv_pipeline_cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline_cache.c b/src/amd/vulkan/radv_pipeline_cache.c index 4b050e6048b..79bfc11f280 100644 --- a/src/amd/vulkan/radv_pipeline_cache.c +++ b/src/amd/vulkan/radv_pipeline_cache.c @@ -335,7 +335,7 @@ radv_pipeline_cache_object_search(struct radv_device *device, struct vk_pipeline *found_in_application_cache = false; if (radv_is_cache_disabled(device, cache)) - return false; + return NULL; bool *found = found_in_application_cache; if (!cache) { @@ -349,7 +349,7 @@ radv_pipeline_cache_object_search(struct radv_device *device, struct vk_pipeline radv_report_pso_cache_stats(device, pipeline, !!object); if (!object) - return false; + return NULL; return container_of(object, struct radv_pipeline_cache_object, base); }