From b08797a4a5a6488e040c0005354f7aa42aef464c Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Wed, 13 Jul 2022 12:53:17 -0500 Subject: [PATCH] st/oxr: Fix missing return, resolve warnings --- src/xrt/state_trackers/oxr/oxr_space.c | 14 +++++++------- src/xrt/state_trackers/oxr/oxr_vulkan.c | 10 ++++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/xrt/state_trackers/oxr/oxr_space.c b/src/xrt/state_trackers/oxr/oxr_space.c index 328589677..df82a4132 100644 --- a/src/xrt/state_trackers/oxr/oxr_space.c +++ b/src/xrt/state_trackers/oxr/oxr_space.c @@ -139,7 +139,7 @@ set_up_local_space(struct oxr_logger *log, struct oxr_session *sess, XrTime time return true; } -bool +XRT_CHECK_RESULT bool is_local_space_set_up(struct oxr_session *sess) { return (sess->local_space_pure_relation.relation_flags & XRT_SPACE_RELATION_ORIENTATION_VALID_BIT) != 0; @@ -191,7 +191,7 @@ oxr_space_ref_get_pure_relation(struct oxr_logger *log, return true; } -bool +XRT_CHECK_RESULT bool oxr_space_pure_relation_in_space(struct oxr_logger *log, XrTime time, struct xrt_space_relation *relation, @@ -218,7 +218,7 @@ oxr_space_pure_relation_in_space(struct oxr_logger *log, return true; } -bool +XRT_CHECK_RESULT bool oxr_space_pure_pose_in_space(struct oxr_logger *log, XrTime time, struct xrt_pose *pose, @@ -231,7 +231,7 @@ oxr_space_pure_pose_in_space(struct oxr_logger *log, return oxr_space_pure_relation_in_space(log, time, &rel, spc, apply_space_pose, out_relation); } -bool +XRT_CHECK_RESULT bool oxr_space_pure_relation_from_space(struct oxr_logger *log, XrTime time, struct xrt_space_relation *relation, @@ -252,7 +252,7 @@ oxr_space_pure_relation_from_space(struct oxr_logger *log, return true; } -bool +XRT_CHECK_RESULT bool oxr_space_pure_pose_from_space(struct oxr_logger *log, XrTime time, struct xrt_pose *pose, @@ -264,7 +264,7 @@ oxr_space_pure_pose_from_space(struct oxr_logger *log, return oxr_space_pure_relation_from_space(log, time, &rel, spc, out_relation); } -bool +XRT_CHECK_RESULT bool oxr_space_get_pure_relation(struct oxr_logger *log, struct oxr_space *spc, XrTime time, @@ -296,7 +296,7 @@ oxr_space_get_pure_relation(struct oxr_logger *log, return oxr_error(log, false, "Unknown space type"); } -bool +XRT_CHECK_RESULT bool global_to_local_space(struct oxr_logger *log, struct oxr_session *sess, XrTime time, struct xrt_space_relation *rel) { if (!is_local_space_set_up(sess)) { diff --git a/src/xrt/state_trackers/oxr/oxr_vulkan.c b/src/xrt/state_trackers/oxr/oxr_vulkan.c index cb4c9b96e..dc1bccd9e 100644 --- a/src/xrt/state_trackers/oxr/oxr_vulkan.c +++ b/src/xrt/state_trackers/oxr/oxr_vulkan.c @@ -231,14 +231,15 @@ vk_get_device_ext_props(struct oxr_logger *log, "vkEnumerateDeviceExtensionProperties"); if (!EnumerateDeviceExtensionProperties) { - oxr_error(log, XR_ERROR_RUNTIME_FAILURE, "Failed to get vkEnumerateDeviceExtensionProperties fp"); + return oxr_error(log, XR_ERROR_RUNTIME_FAILURE, + "Failed to get vkEnumerateDeviceExtensionProperties fp"); } uint32_t prop_count = 0; VkResult res = EnumerateDeviceExtensionProperties(physical_device, NULL, &prop_count, NULL); if (res != VK_SUCCESS) { - oxr_error(log, XR_ERROR_RUNTIME_FAILURE, "Failed to enumerate device extension properties count (%d)", - res); + return oxr_error(log, XR_ERROR_RUNTIME_FAILURE, + "Failed to enumerate device extension properties count (%d)", res); } @@ -247,7 +248,8 @@ vk_get_device_ext_props(struct oxr_logger *log, res = EnumerateDeviceExtensionProperties(physical_device, NULL, &prop_count, props); if (res != VK_SUCCESS) { free(props); - oxr_error(log, XR_ERROR_RUNTIME_FAILURE, "Failed to enumerate device extension properties (%d)", res); + return oxr_error(log, XR_ERROR_RUNTIME_FAILURE, "Failed to enumerate device extension properties (%d)", + res); } *out_props = props;