misc: Fix multiple compile warnings in gcc and clang

This commit is contained in:
Mateo de Mayo 2022-11-03 15:58:30 -03:00 committed by Jakob Bornecrantz
parent 59394d853c
commit 9d6c29397f
10 changed files with 12 additions and 14 deletions

View file

@ -609,7 +609,7 @@ pc_info(struct u_pacing_compositor *upc,
}
assert(f->state == STATE_SUBMITTED);
uint64_t unslopped_desired_present_time_ns = desired_present_time_ns + PRESENT_SLOP_NS;
XRT_MAYBE_UNUSED uint64_t unslopped_desired_present_time_ns = desired_present_time_ns + PRESENT_SLOP_NS;
assert(f->desired_present_time_ns == desired_present_time_ns ||
f->desired_present_time_ns == unslopped_desired_present_time_ns);

View file

@ -586,7 +586,7 @@ null_compositor_create_system(struct xrt_device *xdev, struct xrt_system_composi
// Standard app pacer.
struct u_pacing_app_factory *upaf = NULL;
xrt_result_t xret = u_pa_factory_create(&upaf);
XRT_MAYBE_UNUSED xrt_result_t xret = u_pa_factory_create(&upaf);
assert(xret == XRT_SUCCESS && upaf != NULL);
return comp_multi_create_system_compositor(&c->base.base, upaf, &c->sys_info, false, out_xsysc);

View file

@ -351,6 +351,7 @@ vive_controller_get_hand_tracking(struct xrt_device *xdev,
* This only makes sense with 3dof.
*/
#if 0
float pivot_offset_z = 0.15;
struct xrt_space_relation controller_relation = {
@ -359,6 +360,7 @@ vive_controller_get_hand_tracking(struct xrt_device *xdev,
controller_relation.relation_flags = XRT_SPACE_RELATION_ORIENTATION_VALID_BIT |
XRT_SPACE_RELATION_ORIENTATION_VALID_BIT |
XRT_SPACE_RELATION_POSITION_VALID_BIT;
#endif
struct xrt_vec3 static_offset = {0, 0, 0};

View file

@ -206,7 +206,7 @@ window_draw_misc(struct gui_record_window *rw)
igSameLine(0.0f, 4.0f);
bool plus = igButton("+", button_dims);
const static double scales[] = {
static const double scales[] = {
25.0, 50.0, 100.0, 200.0, 300.0,
};

View file

@ -53,7 +53,7 @@ oxr_dpad_state_get_or_add(struct oxr_dpad_state *state, uint64_t key)
struct oxr_dpad_entry *e = oxr_dpad_state_get(state, key);
if (e == NULL) {
e = U_TYPED_CALLOC(struct oxr_dpad_entry);
int ret = u_hashmap_int_insert(state->uhi, key, (void *)e);
XRT_MAYBE_UNUSED int ret = u_hashmap_int_insert(state->uhi, key, (void *)e);
assert(ret >= 0);
}

View file

@ -1015,7 +1015,7 @@ xr_hand_to_force_feedback_output(XrHandEXT hand)
switch (hand) {
case XR_HAND_LEFT_EXT: return XRT_OUTPUT_NAME_FORCE_FEEDBACK_LEFT;
case XR_HAND_RIGHT_EXT: return XRT_OUTPUT_NAME_FORCE_FEEDBACK_RIGHT;
default: assert(false);
default: assert(false); return 0;
}
}

View file

@ -314,7 +314,7 @@ flexion_joints_to_bone_transform(struct xrt_hand_joint_set *hand_joint_set,
struct xrt_hand_joint_value *joint_values = hand_joint_set->values.hand_joint_set_default;
// Apply orientations for four-finger pxm and onward
int parent;
int parent = -1;
for (int joint = XRT_HAND_JOINT_THUMB_METACARPAL; joint < XRT_HAND_JOINT_COUNT; joint++) {
if (u_hand_joint_is_metacarpal((xrt_hand_joint)joint)) {
parent = joint;

View file

@ -601,7 +601,7 @@ sdl_compositor_create_system(struct sdl_program *sp, struct xrt_system_composito
{
// Standard app pacer.
struct u_pacing_app_factory *upaf = NULL;
xrt_result_t xret = u_pa_factory_create(&upaf);
XRT_MAYBE_UNUSED xrt_result_t xret = u_pa_factory_create(&upaf);
assert(xret == XRT_SUCCESS && upaf != NULL);
return comp_multi_create_system_compositor(&sp->c.base.base, upaf, &sp->c.sys_info, false, out_xsysc);

View file

@ -747,10 +747,6 @@ HandTracking::cCallbackProcess(struct t_hand_tracking_sync *ht_sync,
hgt->views[1].debug_out_to_this = debug_output(cv::Rect(view_offsets[1], view_size));
scribble_image_boundary(hgt);
//
struct xrt_frame *new_model_inputs_and_outputs = NULL;
// Let's check that the collage size is actually as big as we think it is
static_assert(720 == (kVisSpacerSize + ((kKeypointInputSize + kVisSpacerSize) * 4) +
((kDetectionInputSize + 8))));

View file

@ -184,7 +184,7 @@ eval_hand_set_rel_orientations(const OptimizerHand<T> &opt, Orientations54<T> &r
// Thumb MCP hidden orientation
#if 0
Vec2<T> mcp_root_swing;
mcp_root_swing.x = rad<T>((T)(-10));
mcp_root_swing.y = rad<T>((T)(-40));
@ -544,7 +544,7 @@ CostFunctor<optimize_hand_size>::operator()(const T *const x, T *residual) const
// When you're hacking, you want to set the residuals to always-0 so that any of them you forget to touch keep their 0
// gradient.
// But then later this just becomes a waste.
#if 0
#if 0
for (size_t i = 0; i < residual_size; i++) {
residual[i] = (T)(0);
}
@ -848,7 +848,7 @@ opt_run(KinematicHandLM &state, one_frame_input &observation, xrt_hand_joint_set
uint64_t diff = end - start;
double time_taken = (double)diff / (double)U_TIME_1MS_IN_NS;
const char *status;
const char *status = "UNDEFINED";
switch (summary.status) {
case 0: {