auxiliary: Fix or disable a number of warnings

Both MSVC and doxygen warnings.
This commit is contained in:
Ryan Pavlik 2022-04-12 14:23:54 -05:00 committed by Jakob Bornecrantz
parent 2b5f07c8e4
commit ad1961fce7
6 changed files with 45 additions and 40 deletions

View file

@ -77,7 +77,7 @@ os_nanosleep(int64_t nsec)
spec.tv_nsec = (nsec % U_1_000_000_000);
nanosleep(&spec, NULL);
#elif defined(XRT_OS_WINDOWS)
Sleep(nsec / U_TIME_1MS_IN_NS);
Sleep((DWORD)(nsec / U_TIME_1MS_IN_NS));
#endif
}

View file

@ -7,6 +7,10 @@
* @ingroup st_prober
*/
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <xrt/xrt_device.h>
#include "xrt/xrt_settings.h"
#include "xrt/xrt_config.h"
@ -359,7 +363,7 @@ u_config_json_get_tracking_settings(struct u_config_json *json, struct xrt_setti
bad |= !get_obj_int(t, "version", &ver);
if (bad || ver >= 1) {
U_LOG_E("Missing or unknown version tag '%i' in tracking config", ver);
return NULL;
return false;
}

View file

@ -130,101 +130,101 @@ static struct u_joint_curl_model hand_joint_default_set_curl_model_defaults[XRT_
[XRT_HAND_JOINT_RING_DISTAL] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, 0, 0},
.bone_length = 0.023,
.radius = 0.01,
.radius = 0.01f,
.joint_id = XRT_HAND_JOINT_RING_DISTAL},
[XRT_HAND_JOINT_RING_TIP] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, 0, 0},
.bone_length = 0,
.radius = 0.013,
.radius = 0.013f,
.joint_id = XRT_HAND_JOINT_RING_TIP},
[XRT_HAND_JOINT_MIDDLE_METACARPAL] = {.position_offset = {.x = 0.00, .y = 0, .z = -0.039},
[XRT_HAND_JOINT_MIDDLE_METACARPAL] = {.position_offset = {.x = 0, .y = 0, .z = -0.039f},
.axis_angle_offset = {0, 0, 0},
.bone_length = 0.045,
.radius = 0.012,
.bone_length = 0.045f,
.radius = 0.012f,
.joint_id = XRT_HAND_JOINT_MIDDLE_METACARPAL},
[XRT_HAND_JOINT_MIDDLE_PROXIMAL] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, 0, 0},
.bone_length = 0.042,
.radius = 0.01,
.bone_length = 0.042f,
.radius = 0.01f,
.joint_id = XRT_HAND_JOINT_MIDDLE_PROXIMAL},
[XRT_HAND_JOINT_MIDDLE_INTERMEDIATE] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, 0, 0},
.bone_length = 0.033,
.radius = 0.01,
.bone_length = 0.033f,
.radius = 0.01f,
.joint_id = XRT_HAND_JOINT_MIDDLE_INTERMEDIATE},
[XRT_HAND_JOINT_MIDDLE_DISTAL] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, 0, 0},
.bone_length = 0.024,
.radius = 0.01,
.bone_length = 0.024f,
.radius = 0.01f,
.joint_id = XRT_HAND_JOINT_MIDDLE_DISTAL},
[XRT_HAND_JOINT_MIDDLE_TIP] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, 0, 0},
.bone_length = 0,
.radius = 0.01,
.radius = 0.01f,
.joint_id = XRT_HAND_JOINT_MIDDLE_TIP},
[XRT_HAND_JOINT_INDEX_METACARPAL] = {.position_offset = {.x = 0.015, .y = 0, .z = -0.038},
.axis_angle_offset = {0, DEG_TO_RAD(12), 0},
.bone_length = 0.05,
.radius = 0.012,
.axis_angle_offset = {0, DEG_TO_RAD(12.0f), 0},
.bone_length = 0.05f,
.radius = 0.012f,
.joint_id = XRT_HAND_JOINT_INDEX_METACARPAL},
[XRT_HAND_JOINT_INDEX_PROXIMAL] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, DEG_TO_RAD(-10), 0},
.bone_length = 0.040,
.radius = 0.011,
.axis_angle_offset = {0, DEG_TO_RAD(-10.0f), 0},
.bone_length = 0.040f,
.radius = 0.011f,
.joint_id = XRT_HAND_JOINT_INDEX_PROXIMAL},
[XRT_HAND_JOINT_INDEX_INTERMEDIATE] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, 0, 0},
.bone_length = 0.031,
.radius = 0.01,
.bone_length = 0.031f,
.radius = 0.01f,
.joint_id = XRT_HAND_JOINT_INDEX_INTERMEDIATE},
[XRT_HAND_JOINT_INDEX_DISTAL] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, 0, 0},
.bone_length = 0.023,
.radius = 0.01,
.bone_length = 0.023f,
.radius = 0.01f,
.joint_id = XRT_HAND_JOINT_INDEX_DISTAL},
[XRT_HAND_JOINT_INDEX_TIP] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, 0, 0},
.bone_length = 0,
.radius = 0.01,
.radius = 0.01f,
.joint_id = XRT_HAND_JOINT_INDEX_TIP},
[XRT_HAND_JOINT_THUMB_METACARPAL] = {.position_offset = {.x = 0.03, .y = 0, .z = -0.033},
[XRT_HAND_JOINT_THUMB_METACARPAL] = {.position_offset = {.x = 0.03f, .y = 0, .z = -0.033f},
.axis_angle_offset = {0, DEG_TO_RAD(40), 0},
.bone_length = 0.037,
.radius = 0.0175,
.bone_length = 0.037f,
.radius = 0.0175f,
.joint_id = XRT_HAND_JOINT_THUMB_METACARPAL},
[XRT_HAND_JOINT_THUMB_PROXIMAL] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, DEG_TO_RAD(-12), 0},
.bone_length = 0.038,
.radius = 0.017,
.bone_length = 0.038f,
.radius = 0.017f,
.joint_id = XRT_HAND_JOINT_THUMB_PROXIMAL},
// no intermediate
[XRT_HAND_JOINT_THUMB_DISTAL] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, 0, 0},
.bone_length = 0.028,
.radius = 0.017,
.bone_length = 0.028f,
.radius = 0.017f,
.joint_id = XRT_HAND_JOINT_THUMB_DISTAL},
[XRT_HAND_JOINT_THUMB_TIP] = {.position_offset = XRT_VEC3_ZERO,
.axis_angle_offset = {0, 0, 0},
.bone_length = 0,
.radius = 0.016,
.radius = 0.016f,
.joint_id = XRT_HAND_JOINT_THUMB_TIP}};
inline static void

View file

@ -17,6 +17,7 @@
#include <iterator>
#include <type_traits>
using xrt::auxiliary::util::RandomAccessIteratorBase;
using xrt::auxiliary::util::detail::RingBufferHelper;
using id_value_type = uint64_t;
@ -111,16 +112,16 @@ static_assert(std::is_same<typename std::iterator_traits<IdRingbufferIterator>::
"Iterator should be random access");
} // namespace
#define DEFAULT_CATCH(RETURNVAL) \
#define DEFAULT_CATCH(...) \
catch (std::exception const &e) \
{ \
U_LOG_E("Caught exception: %s", e.what()); \
return RETURNVAL; \
return __VA_ARGS__; \
} \
catch (...) \
{ \
U_LOG_E("Caught exception"); \
return RETURNVAL; \
return __VA_ARGS__; \
}
struct u_id_ringbuffer *
@ -277,7 +278,7 @@ handleAlgorithmResult(IdRingbufferIterator it, uint64_t *out_id, uint32_t *out_i
*out_id = *it;
}
if (out_index != nullptr) {
*out_index = it.index();
*out_index = static_cast<uint32_t>(it.index());
}
return it.inner_index();
}

View file

@ -19,12 +19,12 @@ extern "C" {
* @defgroup aux_pretty Pretty printing functions.
*
* Multiple modules implement additional pretty printing functions like
* @ref st_oxr.
* @ref oxr_api.
*
* Some functions have a `_indented` suffix added to them, this means that what
* they print starts indented, but also they start with a newline. This is so
* they can easily be chained together to form a debug message printing out
* various information. Most the final logging functions in Monado inserts a
* various information. Most of the final logging functions in Monado inserts a
* newline at the end of the message and we don't want two to be inserted.
*/

View file

@ -49,7 +49,7 @@ public:
}
/*!
* @copydoc u_worker_thread_pool_create.
* @copydoc u_worker_thread_pool_create
*/
SharedThreadPool(uint32_t starting_worker_count, uint32_t thread_count)
{