From c8776a8b0dc26705689e229f7414dc6a348a5bf3 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Fri, 16 Aug 2019 17:02:18 -0500 Subject: [PATCH] st/oxr: Minor clang-tidy fixes. --- src/xrt/state_trackers/oxr/oxr_api_funcs.h | 4 ++-- .../state_trackers/oxr/oxr_api_negotiate.c | 13 ++++++------ src/xrt/state_trackers/oxr/oxr_objects.h | 4 ++-- src/xrt/state_trackers/oxr/oxr_space.c | 10 ++++----- src/xrt/state_trackers/oxr/oxr_system.c | 2 +- src/xrt/state_trackers/oxr/oxr_verify.cpp | 21 +++++++++---------- 6 files changed, 26 insertions(+), 28 deletions(-) diff --git a/src/xrt/state_trackers/oxr/oxr_api_funcs.h b/src/xrt/state_trackers/oxr/oxr_api_funcs.h index 4825372b7..30ca21c3d 100644 --- a/src/xrt/state_trackers/oxr/oxr_api_funcs.h +++ b/src/xrt/state_trackers/oxr/oxr_api_funcs.h @@ -319,7 +319,7 @@ XrResult oxr_xrLocateSpace(XrSpace space, XrSpace baseSpace, XrTime time, - XrSpaceLocation* relation); + XrSpaceLocation* location); //! OpenXR API function @ep{xrDestroySpace} XrResult @@ -521,7 +521,7 @@ oxr_xrGetInputSourceLocalizedName( XrResult oxr_xrApplyHapticFeedback(XrSession session, const XrHapticActionInfo* hapticActionInfo, - const XrHapticBaseHeader* hapticFeedback); + const XrHapticBaseHeader* hapticEvent); //! OpenXR API function @ep{xrStopHapticFeedback} XrResult diff --git a/src/xrt/state_trackers/oxr/oxr_api_negotiate.c b/src/xrt/state_trackers/oxr/oxr_api_negotiate.c index 54dc137e6..481c5b6a8 100644 --- a/src/xrt/state_trackers/oxr/oxr_api_negotiate.c +++ b/src/xrt/state_trackers/oxr/oxr_api_negotiate.c @@ -255,12 +255,11 @@ oxr_xrGetInstanceProcAddr(XrInstance instance, oxr_log_init(&log, "xrGetInstanceProcAddr"); return handle_null(&log, name, function); - } else { - struct oxr_instance* inst; - struct oxr_logger log; - OXR_VERIFY_INSTANCE_AND_INIT_LOG(&log, instance, inst, - "xrGetInstanceProcAddr"); - - return handle_none_null(&log, name, function); } + struct oxr_instance* inst; + struct oxr_logger log; + OXR_VERIFY_INSTANCE_AND_INIT_LOG(&log, instance, inst, + "xrGetInstanceProcAddr"); + + return handle_none_null(&log, name, function); } diff --git a/src/xrt/state_trackers/oxr/oxr_objects.h b/src/xrt/state_trackers/oxr/oxr_objects.h index 170e7a125..1c1f58db4 100644 --- a/src/xrt/state_trackers/oxr/oxr_objects.h +++ b/src/xrt/state_trackers/oxr/oxr_objects.h @@ -457,7 +457,7 @@ oxr_space_locate(struct oxr_logger *log, struct oxr_space *spc, struct oxr_space *baseSpc, XrTime time, - XrSpaceLocation *relation); + XrSpaceLocation *location); XrResult oxr_space_ref_relation(struct oxr_logger *log, @@ -487,7 +487,7 @@ XrResult oxr_create_swapchain(struct oxr_logger *, struct oxr_session *sess, const XrSwapchainCreateInfo *, - struct oxr_swapchain **sc); + struct oxr_swapchain **out_swapchain); /* diff --git a/src/xrt/state_trackers/oxr/oxr_space.c b/src/xrt/state_trackers/oxr/oxr_space.c index 46542a71b..e017dff01 100644 --- a/src/xrt/state_trackers/oxr/oxr_space.c +++ b/src/xrt/state_trackers/oxr/oxr_space.c @@ -282,7 +282,8 @@ get_pure_space_relation(struct oxr_logger *log, if (spc->is_reference && baseSpc->is_reference) { return oxr_space_ref_relation( log, sess, spc->type, baseSpc->type, time, out_relation); - } else if (!spc->is_reference && !baseSpc->is_reference) { + } + if (!spc->is_reference && !baseSpc->is_reference) { // @todo Deal with action to action by keeping a true_space that // we can always go via. Aka poor mans space graph. // WARNING order not thought through here! @@ -295,11 +296,10 @@ get_pure_space_relation(struct oxr_logger *log, // math_pose_relate_2(&pose1, &pose2, out_pose); out_relation->relation_flags = XRT_SPACE_RELATION_BITMASK_NONE; return XR_SUCCESS; - } else { - oxr_space_action_relation(log, sess, spc, baseSpc, time, - out_relation); - return XR_SUCCESS; } + + oxr_space_action_relation(log, sess, spc, baseSpc, time, out_relation); + return XR_SUCCESS; } static void diff --git a/src/xrt/state_trackers/oxr/oxr_system.c b/src/xrt/state_trackers/oxr/oxr_system.c index 52c765d08..bd194e5e8 100644 --- a/src/xrt/state_trackers/oxr/oxr_system.c +++ b/src/xrt/state_trackers/oxr/oxr_system.c @@ -240,7 +240,7 @@ oxr_system_get_view_conf_properties( // clang-format off configurationProperties->viewConfigurationType = sys->view_config_type; - configurationProperties->fovMutable = false; + configurationProperties->fovMutable = XR_FALSE; // clang-format on return XR_SUCCESS; diff --git a/src/xrt/state_trackers/oxr/oxr_verify.cpp b/src/xrt/state_trackers/oxr/oxr_verify.cpp index 1fded74c9..01afd264f 100644 --- a/src/xrt/state_trackers/oxr/oxr_verify.cpp +++ b/src/xrt/state_trackers/oxr/oxr_verify.cpp @@ -285,7 +285,9 @@ subaction_path_no_dups(struct oxr_logger* log, "(%s[%u] == XR_NULL_PATH) not a " "valid subaction path.", variable, index); - } else if (path == inst->path_cache.user) { + } + + if (path == inst->path_cache.user) { if (sub_paths.user) { duplicate = true; } else { @@ -374,18 +376,15 @@ oxr_verify_subaction_path_sync(struct oxr_logger* log, path == inst->path_cache.right || path == inst->path_cache.gamepad) { return XR_SUCCESS; - } else { - const char* str = NULL; - size_t length = 0; - - oxr_path_get_string(log, inst, path, &str, &length); - return oxr_error(log, XR_ERROR_PATH_INVALID, - "(actionSets[%i].subactionPath == '%s') path " - "is not a valid subaction path.", - index, str); } + const char* str = NULL; + size_t length = 0; - return XR_SUCCESS; + oxr_path_get_string(log, inst, path, &str, &length); + return oxr_error(log, XR_ERROR_PATH_INVALID, + "(actionSets[%i].subactionPath == '%s') path " + "is not a valid subaction path.", + index, str); } extern "C" XrResult