The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

drivers: Use U_LOG_CHK_AND_RET helper in some places

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2483>

+13 -24
+7 -12
src/xrt/drivers/ht_ctrl_emu/ht_ctrl_emu.cpp
··· 227 227 struct xrt_space_relation head_rel; 228 228 xrt_result_t xret = 229 229 xrt_device_get_tracked_pose(sys->in_head, XRT_INPUT_GENERIC_HEAD_POSE, head_timestamp_ns, &head_rel); 230 - if (xret != XRT_SUCCESS) { 231 - return xret; 232 - } 230 + U_LOG_CHK_AND_RET(sys->log_level, xret, "xrt_device_get_tracked_pose"); 233 231 234 232 *out_head = head_rel.pose; 235 233 int other; ··· 253 251 int64_t hand_timestamp_ns, 254 252 struct xrt_space_relation *out_relation) 255 253 { 254 + struct cemu_system *sys = dev->sys; 255 + 256 256 struct xrt_vec3 vec3_up = {0, 1, 0}; 257 257 struct xrt_pose head; 258 258 struct xrt_hand_joint_set joint_set_secondary; ··· 263 263 // "Moshi way" 264 264 xrt_result_t xret = get_other_two(dev, head_timestamp_ns, hand_timestamp_ns, &head, &joint_set_secondary); 265 265 #endif 266 - if (xret != XRT_SUCCESS) { 267 - return xret; 268 - } 266 + U_LOG_CHK_AND_RET(sys->log_level, xret, "get_other_two"); 269 267 270 268 // Average shoulder width for women:37cm, men:41cm, center of shoulder 271 269 // joint is around 4cm inwards ··· 345 343 struct xrt_hand_joint_set joint_set; 346 344 xrt_result_t xret = xrt_device_get_hand_tracking(sys->in_hand, dev->ht_input_name, at_timestamp_ns, &joint_set, 347 345 &hand_timestamp_ns); 348 - if (xret != XRT_SUCCESS) { 349 - return xret; 350 - } 346 + U_LOG_CHK_AND_RET(sys->log_level, xret, "xrt_device_get_hand_tracking"); 351 347 352 348 if (joint_set.is_active == false) { 353 349 out_relation->relation_flags = XRT_SPACE_RELATION_BITMASK_NONE; ··· 397 393 cemu_device_update_inputs(struct xrt_device *xdev) 398 394 { 399 395 struct cemu_device *dev = cemu_device(xdev); 396 + struct cemu_system *sys = dev->sys; 400 397 401 398 struct xrt_hand_joint_set joint_set; 402 399 int64_t noop; 403 400 404 401 xrt_result_t xret = xrt_device_get_hand_tracking(dev->sys->in_hand, dev->ht_input_name, os_monotonic_get_ns(), 405 402 &joint_set, &noop); 406 - if (xret != XRT_SUCCESS) { 407 - return xret; 408 - } 403 + U_LOG_CHK_AND_RET(sys->log_level, xret, "xrt_device_get_hand_tracking"); 409 404 410 405 if (!joint_set.is_active) { 411 406 xdev->inputs[CEMU_INDEX_SELECT].value.boolean = false;
+4 -8
src/xrt/drivers/multi_wrapper/multi.c
··· 148 148 { 149 149 struct multi_device *d = (struct multi_device *)xdev; 150 150 struct xrt_device *target = d->tracking_override.target; 151 - xrt_result_t ret = xrt_device_get_hand_tracking(target, name, at_timestamp_ns, out_value, out_timestamp_ns); 152 - if (ret != XRT_SUCCESS) { 153 - return ret; 154 - } 151 + xrt_result_t xret = xrt_device_get_hand_tracking(target, name, at_timestamp_ns, out_value, out_timestamp_ns); 152 + U_LOG_CHK_AND_RET(d->log_level, xret, "xrt_device_get_hand_tracking"); 155 153 156 154 if (!out_value->is_active) { 157 155 return XRT_SUCCESS; ··· 159 157 160 158 struct xrt_device *tracker = d->tracking_override.tracker; 161 159 struct xrt_space_relation tracker_relation; 162 - ret = 160 + xret = 163 161 xrt_device_get_tracked_pose(tracker, d->tracking_override.input_name, *out_timestamp_ns, &tracker_relation); 164 - if (ret != XRT_SUCCESS) { 165 - return ret; 166 - } 162 + U_LOG_CHK_AND_RET(d->log_level, xret, "xrt_device_get_hand_tracking"); 167 163 168 164 switch (d->override_type) { 169 165 case XRT_TRACKING_OVERRIDE_DIRECT: direct_override(d, &tracker_relation, &out_value->hand_pose); break;
+2 -4
src/xrt/drivers/remote/r_device.c
··· 164 164 165 165 // Get the pose of the hand. 166 166 struct xrt_space_relation relation; 167 - xrt_result_t ret = 167 + xrt_result_t xret = 168 168 xrt_device_get_tracked_pose(xdev, XRT_INPUT_INDEX_GRIP_POSE, requested_timestamp_ns, &relation); 169 - if (ret != XRT_SUCCESS) { 170 - return ret; 171 - } 169 + U_LOG_CHK_AND_RET(u_log_get_global_level(), xret, "xrt_device_get_tracked_pose"); 172 170 173 171 // Simulate the hand. 174 172 enum xrt_hand hand = rd->is_left ? XRT_HAND_LEFT : XRT_HAND_RIGHT;