[Bf-blender-cvs] [bd8b3f57df8] xr-controller-support: Fix build warnings
Peter Kim
noreply at git.blender.org
Fri Jul 9 06:58:28 CEST 2021
Commit: bd8b3f57df85b5ee2a22e7d4d52070fef69506c6
Author: Peter Kim
Date: Fri Jul 9 13:58:12 2021 +0900
Branches: xr-controller-support
https://developer.blender.org/rBbd8b3f57df85b5ee2a22e7d4d52070fef69506c6
Fix build warnings
===================================================================
M source/blender/makesrna/intern/rna_xr.c
M source/blender/windowmanager/WM_api.h
M source/blender/windowmanager/xr/intern/wm_xr_action.c
M source/blender/windowmanager/xr/intern/wm_xr_intern.h
M source/blender/windowmanager/xr/intern/wm_xr_operators.c
M source/blender/windowmanager/xr/intern/wm_xr_session.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_xr.c b/source/blender/makesrna/intern/rna_xr.c
index c2419e19bd1..c6bb6cf4581 100644
--- a/source/blender/makesrna/intern/rna_xr.c
+++ b/source/blender/makesrna/intern/rna_xr.c
@@ -903,7 +903,7 @@ static bool rna_XrSessionState_action_create(bContext *C,
const bool is_float_action = (type == XR_FLOAT_INPUT || type == XR_VECTOR2F_INPUT);
wmOperatorType *ot = NULL;
IDProperty *op_properties = NULL;
- long long haptic_duration_msec;
+ int64_t haptic_duration_msec;
eXrActionFlag flag = 0;
if (is_float_action) {
@@ -926,7 +926,7 @@ static bool rna_XrSessionState_action_create(bContext *C,
}
}
- haptic_duration_msec = (long long)(haptic_duration * 1000.0f);
+ haptic_duration_msec = (int64_t)(haptic_duration * 1000.0f);
flag |= (op_flag | axis0_flag | axis1_flag | haptic_flag);
if (bimanual) {
@@ -1136,7 +1136,7 @@ bool rna_XrSessionState_haptic_action_apply(bContext *C,
{
# ifdef WITH_XR_OPENXR
wmWindowManager *wm = CTX_wm_manager(C);
- long long duration_msec = (long long)(duration * 1000.0f);
+ int64_t duration_msec = (int64_t)(duration * 1000.0f);
return WM_xr_haptic_action_apply(&wm->xr,
action_set_name,
action_name,
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 663b13d6208..19e1678b3d2 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -1017,7 +1017,7 @@ bool WM_xr_action_create(wmXrData *xr,
struct wmOperatorType *ot,
struct IDProperty *op_properties,
const char **haptic_name,
- const long long *haptic_duration,
+ const int64_t *haptic_duration,
const float *haptic_frequency,
const float *haptic_amplitude,
eXrActionFlag flag);
diff --git a/source/blender/windowmanager/xr/intern/wm_xr_action.c b/source/blender/windowmanager/xr/intern/wm_xr_action.c
index da947bd422f..d2b184005c7 100644
--- a/source/blender/windowmanager/xr/intern/wm_xr_action.c
+++ b/source/blender/windowmanager/xr/intern/wm_xr_action.c
@@ -76,7 +76,7 @@ static wmXrAction *action_create(const char *action_name,
wmOperatorType *ot,
IDProperty *op_properties,
const char **haptic_name,
- const long long *haptic_duration,
+ const int64_t *haptic_duration,
const float *haptic_frequency,
const float *haptic_amplitude,
eXrActionFlag flag)
@@ -223,7 +223,7 @@ bool WM_xr_action_create(wmXrData *xr,
wmOperatorType *ot,
IDProperty *op_properties,
const char **haptic_name,
- const long long *haptic_duration,
+ const int64_t *haptic_duration,
const float *haptic_frequency,
const float *haptic_amplitude,
eXrActionFlag flag)
diff --git a/source/blender/windowmanager/xr/intern/wm_xr_intern.h b/source/blender/windowmanager/xr/intern/wm_xr_intern.h
index 5c4a9717ff5..c7775506eb8 100644
--- a/source/blender/windowmanager/xr/intern/wm_xr_intern.h
+++ b/source/blender/windowmanager/xr/intern/wm_xr_intern.h
@@ -20,6 +20,8 @@
#pragma once
+#include "BLI_sys_types.h"
+
#include "CLG_log.h"
#include "wm_xr.h"
@@ -171,7 +173,7 @@ typedef struct wmXrAction {
/** Haptics. */
char *haptic_name;
- long long haptic_duration;
+ int64_t haptic_duration;
float haptic_frequency;
float haptic_amplitude;
@@ -183,7 +185,7 @@ typedef struct wmXrHapticAction {
struct wmXrHapticAction *next, *prev;
wmXrAction *action;
const char **subaction_path;
- long long time_start;
+ int64_t time_start;
} wmXrHapticAction;
typedef struct wmXrActionSet {
diff --git a/source/blender/windowmanager/xr/intern/wm_xr_operators.c b/source/blender/windowmanager/xr/intern/wm_xr_operators.c
index 75531076a5d..d2a53d7c8da 100644
--- a/source/blender/windowmanager/xr/intern/wm_xr_operators.c
+++ b/source/blender/windowmanager/xr/intern/wm_xr_operators.c
@@ -927,7 +927,7 @@ static int wm_xr_navigation_fly_modal_3d(bContext *C, wmOperator *op, const wmEv
GHOST_XrPose nav_pose;
float nav_mat[4][4], delta[4][4], out[4][4];
- const float time_now = PIL_check_seconds_timer();
+ const double time_now = PIL_check_seconds_timer();
PropertyRNA *prop = RNA_struct_find_property(op->ptr, "mode");
mode = prop ? RNA_property_enum_get(op->ptr, prop) : XR_FLY_VIEWER_FORWARD;
@@ -990,7 +990,7 @@ static int wm_xr_navigation_fly_modal_3d(bContext *C, wmOperator *op, const wmEv
(1.0f - actiondata->float_threshold) :
1.0f;
if (speed_interp_cubic) {
- float start[2], end[2], out[2];
+ float start[2], end[2], p[2];
start[0] = 0.0f;
start[1] = speed;
@@ -999,8 +999,8 @@ static int wm_xr_navigation_fly_modal_3d(bContext *C, wmOperator *op, const wmEv
end[0] = 1.0f;
end[1] = speed_max;
- interp_v2_v2v2v2v2_cubic(out, start, speed_p0, speed_p1, end, speed_t);
- speed = out[1];
+ interp_v2_v2v2v2v2_cubic(p, start, speed_p0, speed_p1, end, speed_t);
+ speed = p[1];
}
else {
speed += speed_t * (speed_max - speed);
diff --git a/source/blender/windowmanager/xr/intern/wm_xr_session.c b/source/blender/windowmanager/xr/intern/wm_xr_session.c
index ea9549ce75a..f08b6ade505 100644
--- a/source/blender/windowmanager/xr/intern/wm_xr_session.c
+++ b/source/blender/windowmanager/xr/intern/wm_xr_session.c
@@ -860,7 +860,7 @@ static wmXrHapticAction *wm_xr_session_haptic_action_find(ListBase *active_hapti
static void wm_xr_session_haptic_action_add(ListBase *active_haptic_actions,
const wmXrAction *action,
const char **subaction_path,
- long long time_now)
+ int64_t time_now)
{
wmXrHapticAction *ha = wm_xr_session_haptic_action_find(
active_haptic_actions, action, subaction_path);
@@ -888,7 +888,7 @@ static void wm_xr_session_haptic_action_remove(ListBase *active_haptic_actions,
}
}
-static void wm_xr_session_haptic_timers_check(ListBase *active_haptic_actions, long long time_now)
+static void wm_xr_session_haptic_timers_check(ListBase *active_haptic_actions, int64_t time_now)
{
wmXrHapticAction *ha = active_haptic_actions->first;
while (ha) {
@@ -909,7 +909,7 @@ static void wm_xr_session_action_states_interpret(wmXrData *xr,
unsigned int subaction_idx,
ListBase *active_modal_actions,
ListBase *active_haptic_actions,
- long long time_now,
+ int64_t time_now,
bool modal,
bool haptic,
short *r_val,
@@ -1112,7 +1112,7 @@ static void wm_xr_session_events_dispatch(wmXrData *xr,
return;
}
- const long long time_now = (long long)(PIL_check_seconds_timer() * 1000);
+ const int64_t time_now = (int64_t)(PIL_check_seconds_timer() * 1000);
const wmXrEyeData *eye_data = &session_state->eyes[settings->selection_eye];
ListBase *active_modal_actions = &action_set->active_modal_actions;
More information about the Bf-blender-cvs
mailing list