radv: 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
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 <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36323>
This commit is contained in:
committed by
Marge Bot
parent
bf56ab91fd
commit
0dd8051f34
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user