Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-04-21 21:25:58 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-04-21 21:25:58 +0400
commit284a0d3610b50ff45a7acdc084c21003c9af0d41 (patch)
treed47161d4a20db189cb48db6b618e16f0c8dfab7c /source/blender/editors
parent9646f8e5b15f55e2172411922a6849945d27739c (diff)
pass even mouse coords value as const so its not edited, view3d_get_view_aligned_coordinate() could modify the event->mval.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/armature/armature_intern.h2
-rw-r--r--source/blender/editors/armature/editarmature.c4
-rw-r--r--source/blender/editors/armature/editarmature_sketch.c4
-rw-r--r--source/blender/editors/curve/editcurve.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c2
-rw-r--r--source/blender/editors/include/ED_armature.h2
-rw-r--r--source/blender/editors/include/ED_curve.h2
-rw-r--r--source/blender/editors/include/ED_mball.h2
-rw-r--r--source/blender/editors/include/ED_mesh.h4
-rw-r--r--source/blender/editors/include/ED_object.h2
-rw-r--r--source/blender/editors/include/ED_particle.h4
-rw-r--r--source/blender/editors/include/ED_view3d.h36
-rw-r--r--source/blender/editors/mesh/editface.c4
-rw-r--r--source/blender/editors/mesh/editmesh_mods.c6
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c2
-rw-r--r--source/blender/editors/metaball/mball_edit.c2
-rw-r--r--source/blender/editors/object/object_lattice.c4
-rw-r--r--source/blender/editors/physics/particle_edit.c6
-rw-r--r--source/blender/editors/space_node/node_select.c2
-rw-r--r--source/blender/editors/space_node/node_state.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_intern.h2
-rw-r--r--source/blender/editors/space_text/text_ops.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c6
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c10
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c46
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c42
-rw-r--r--source/blender/editors/transform/transform.c50
-rw-r--r--source/blender/editors/transform/transform.h54
-rw-r--r--source/blender/editors/transform/transform_input.c20
-rw-r--r--source/blender/editors/transform/transform_manipulator.c2
31 files changed, 166 insertions, 166 deletions
diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h
index 7a6141540bd..86dc2182e03 100644
--- a/source/blender/editors/armature/armature_intern.h
+++ b/source/blender/editors/armature/armature_intern.h
@@ -206,7 +206,7 @@ void POSE_OT_propagate(struct wmOperatorType *ot);
/* editarmature.c */
EditBone *make_boneList(struct ListBase *edbo, struct ListBase *bones, struct EditBone *parent, struct Bone *actBone);
-void BIF_sk_selectStroke(struct bContext *C, short mval[2], short extend);
+void BIF_sk_selectStroke(struct bContext *C, const short mval[2], short extend);
/* duplicate method */
void preEditBoneDuplicate(struct ListBase *editbones);
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 23f91f88c8d..f0f33ec3258 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -1698,7 +1698,7 @@ void ARMATURE_OT_select_linked(wmOperatorType *ot)
/* does bones and points */
/* note that BONE ROOT only gets drawn for root bones (or without IK) */
-static EditBone *get_nearest_editbonepoint (ViewContext *vc, short mval[2], ListBase *edbo, int findunsel, int *selmask)
+static EditBone *get_nearest_editbonepoint (ViewContext *vc, const short mval[2], ListBase *edbo, int findunsel, int *selmask)
{
EditBone *ebone;
rcti rect;
@@ -1958,7 +1958,7 @@ static int ebone_select_flag(EditBone *ebone)
}
/* context: editmode armature in view3d */
-int mouse_armature(bContext *C, short mval[2], int extend)
+int mouse_armature(bContext *C, const short mval[2], int extend)
{
Object *obedit= CTX_data_edit_object(C);
bArmature *arm= obedit->data;
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c
index 4b83af30799..158c0d23ddc 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -2157,7 +2157,7 @@ static void sk_applyGesture(bContext *C, SK_Sketch *sketch)
/********************************************/
-static int sk_selectStroke(bContext *C, SK_Sketch *sketch, short mval[2], int extend)
+static int sk_selectStroke(bContext *C, SK_Sketch *sketch, const short mval[2], int extend)
{
ViewContext vc;
rcti rect;
@@ -2473,7 +2473,7 @@ static int sketch_delete(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(ev
return OPERATOR_FINISHED;
}
-void BIF_sk_selectStroke(bContext *C, short mval[2], short extend)
+void BIF_sk_selectStroke(bContext *C, const short mval[2], short extend)
{
ToolSettings *ts = CTX_data_tool_settings(C);
SK_Sketch *sketch = contextSketch(C, 0);
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index bea5a729f31..4365bf69308 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -4170,7 +4170,7 @@ void CURVE_OT_make_segment(wmOperatorType *ot)
/***************** pick select from 3d view **********************/
-int mouse_nurb(bContext *C, short mval[2], int extend)
+int mouse_nurb(bContext *C, const short mval[2], int extend)
{
Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data;
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 17e7c0c221b..04391d0c531 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -239,7 +239,7 @@ static short gp_stroke_filtermval (tGPsdata *p, int mval[2], int pmval[2])
/* convert screen-coordinates to buffer-coordinates */
// XXX this method needs a total overhaul!
-static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[], float *depth)
+static void gp_stroke_convertcoords (tGPsdata *p, short mval[2], float out[3], float *depth)
{
bGPdata *gpd= p->gpd;
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h
index fcd56277b87..36923736068 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -117,7 +117,7 @@ void ED_armature_deselect_all_visible(struct Object *obedit);
int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer,
short hits, short extend);
-int mouse_armature(struct bContext *C, short mval[2], int extend);
+int mouse_armature(struct bContext *C, const short mval[2], int extend);
int join_armature_exec(struct bContext *C, struct wmOperator *op);
struct Bone *get_indexed_bone (struct Object *ob, int index);
float ED_rollBoneToVector(EditBone *bone, const float new_up_axis[3], const short axis_only);
diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h
index 08a63a470c1..cfafd38ed15 100644
--- a/source/blender/editors/include/ED_curve.h
+++ b/source/blender/editors/include/ED_curve.h
@@ -66,7 +66,7 @@ void free_editNurb (struct Object *obedit);
void free_curve_editNurb (struct Curve *cu);
-int mouse_nurb (struct bContext *C, short mval[2], int extend);
+int mouse_nurb (struct bContext *C, const short mval[2], int extend);
struct Nurb *add_nurbs_primitive(struct bContext *C, float mat[4][4], int type, int newob);
diff --git a/source/blender/editors/include/ED_mball.h b/source/blender/editors/include/ED_mball.h
index 504cc4e2d52..a742be7337c 100644
--- a/source/blender/editors/include/ED_mball.h
+++ b/source/blender/editors/include/ED_mball.h
@@ -42,7 +42,7 @@ void ED_keymap_metaball(struct wmKeyConfig *keyconf);
struct MetaElem *add_metaball_primitive(struct bContext *C, float mat[4][4], int type, int newname);
-int mouse_mball(struct bContext *C, short mval[2], int extend);
+int mouse_mball(struct bContext *C, const short mval[2], int extend);
void free_editMball(struct Object *obedit);
void make_editMball(struct Object *obedit);
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
index 054e46971b5..c3c843154e5 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -169,7 +169,7 @@ void EM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct Object
extern unsigned int em_vertoffs, em_solidoffs, em_wireoffs;
void EM_cache_x_mirror_vert(struct Object *ob, struct EditMesh *em);
-int mouse_mesh(struct bContext *C, short mval[2], short extend);
+int mouse_mesh(struct bContext *C, const short mval[2], short extend);
int EM_check_backbuf(unsigned int index);
int EM_mask_init_backbuf_border(struct ViewContext *vc, short mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax);
void EM_free_backbuf(void);
@@ -187,7 +187,7 @@ void EM_automerge(struct Scene *scene, struct Object *obedit, int update);
/* editface.c */
void paintface_flush_flags(struct Object *ob);
struct MTFace *EM_get_active_mtface(struct EditMesh *em, struct EditFace **act_efa, struct MCol **mcol, int sloppy);
-int paintface_mouse_select(struct bContext *C, struct Object *ob, short mval[2], int extend);
+int paintface_mouse_select(struct bContext *C, struct Object *ob, const short mval[2], int extend);
int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, int select, int extend);
void paintface_deselect_all_visible(struct Object *ob, int action, short flush_flags);
void paintface_select_linked(struct bContext *C, struct Object *ob, short mval[2], int mode);
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index ce6a9d609db..3b27fb45f5d 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -126,7 +126,7 @@ void ED_object_constraint_update(struct Object *ob);
void ED_object_constraint_dependency_update(struct Main *bmain, struct Scene *scene, struct Object *ob);
/* object_lattice.c */
-int mouse_lattice(struct bContext *C, short mval[2], int extend);
+int mouse_lattice(struct bContext *C, const short mval[2], int extend);
void undo_push_lattice(struct bContext *C, const char *name);
/* object_lattice.c */
diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h
index 7b4a2e6fe16..f29284fe64d 100644
--- a/source/blender/editors/include/ED_particle.h
+++ b/source/blender/editors/include/ED_particle.h
@@ -60,9 +60,9 @@ void PE_hide_keys_time(struct Scene *scene, struct PTCacheEdit *edit, float cfra
void PE_update_object(struct Scene *scene, struct Object *ob, int useflag);
/* selection tools */
-int PE_mouse_particles(struct bContext *C, short *mval, int extend);
+int PE_mouse_particles(struct bContext *C, const short mval[2], int extend);
int PE_border_select(struct bContext *C, struct rcti *rect, int select, int extend);
-int PE_circle_select(struct bContext *C, int selecting, short *mval, float rad);
+int PE_circle_select(struct bContext *C, int selecting, const short mval[2], float rad);
int PE_lasso_select(struct bContext *C, short mcords[][2], short moves, short extend, short select);
void PE_deselect_all_visible(struct PTCacheEdit *edit);
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index c741c41ff5e..3903cfa19a3 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -80,9 +80,9 @@ typedef struct ViewDepths {
float *give_cursor(struct Scene *scene, struct View3D *v3d);
int initgrabz(struct RegionView3D *rv3d, float x, float y, float z);
-void window_to_3d(struct ARegion *ar, float *vec, short mx, short my);
-void window_to_3d_delta(struct ARegion *ar, float *vec, short mx, short my);
-void window_to_3d_vector(struct ARegion *ar, float *vec, short mx, short my);
+void window_to_3d(struct ARegion *ar, float out[3], short mx, short my);
+void window_to_3d_delta(struct ARegion *ar, float out[3], short mx, short my);
+void window_to_3d_vector(struct ARegion *ar, float out[3], short mx, short my);
void view3d_unproject(struct bglMats *mats, float out[3], const short x, const short y, const float z);
/* Depth buffer */
@@ -95,14 +95,14 @@ void request_depth_update(struct RegionView3D *rv3d);
void view3d_calculate_clipping(struct BoundBox *bb, float planes[4][4], struct bglMats *mats, struct rcti *rect);
-void project_short(struct ARegion *ar, float *vec, short *adr);
-void project_short_noclip(struct ARegion *ar, float *vec, short *adr);
+void project_short(struct ARegion *ar, const float vec[3], short adr[2]);
+void project_short_noclip(struct ARegion *ar, const float vec[3], short adr[2]);
-void project_int(struct ARegion *ar, float *vec, int *adr);
-void project_int_noclip(struct ARegion *ar, float *vec, int *adr);
+void project_int(struct ARegion *ar, const float vec[3], int adr[2]);
+void project_int_noclip(struct ARegion *ar, const float vec[3], int adr[2]);
-void project_float(struct ARegion *ar, float *vec, float *adr);
-void project_float_noclip(struct ARegion *ar, float *vec, float *adr);
+void project_float(struct ARegion *ar, const float vec[3], float adr[2]);
+void project_float_noclip(struct ARegion *ar, const float vec[3], float adr[2]);
void viewvector(struct RegionView3D *rv3d, float coord[3], float vec[3]);
@@ -113,7 +113,7 @@ int get_view3d_cliprange(struct View3D *v3d, struct RegionView3D *rv3d, float *c
int get_view3d_viewplane(struct View3D *v3d, struct RegionView3D *rv3d, int winxi, int winyi, struct rctf *viewplane, float *clipsta, float *clipend, float *pixsize);
int get_view3d_ortho(struct View3D *v3d, struct RegionView3D *rv3d);
void view3d_get_object_project_mat(struct RegionView3D *v3d, struct Object *ob, float pmat[4][4]);
-void view3d_project_float(struct ARegion *a, float *vec, float *adr, float mat[4][4]);
+void view3d_project_float(struct ARegion *a, const float vec[3], float adr[2], float mat[4][4]);
void view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar, struct RegionView3D *rv3d, struct View3D *v3d, struct rctf *viewborder_r, short do_shift);
/* drawobject.c iterators */
@@ -124,7 +124,7 @@ void nurbs_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData
void lattice_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct BPoint *bp, int x, int y), void *userData);
void ED_view3d_local_clipping(struct RegionView3D *rv3d, float mat[][4]);
-int view3d_test_clipping(struct RegionView3D *rv3d, float *vec, int local);
+int view3d_test_clipping(struct RegionView3D *rv3d, const float vec[3], const int local);
void view3d_align_axis_to_vector(struct View3D *v3d, struct RegionView3D *rv3d, int axisidx, float vec[3]);
float view3d_pixel_size(struct RegionView3D *rv3d, const float co[3]);
@@ -133,18 +133,18 @@ void drawcircball(int mode, const float cent[3], float rad, float tmat[][4]);
/* backbuffer select and draw support */
void view3d_validate_backbuf(struct ViewContext *vc);
struct ImBuf *view3d_read_backbuf(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
-unsigned int view3d_sample_backbuf_rect(struct ViewContext *vc, short mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict,
+unsigned int view3d_sample_backbuf_rect(struct ViewContext *vc, const short mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict,
void *handle, unsigned int (*indextest)(void *handle, unsigned int index));
unsigned int view3d_sample_backbuf(struct ViewContext *vc, int x, int y);
/* draws and does a 4x4 sample */
-int view_autodist(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, short *mval, float mouse_worldloc[3]);
+int view_autodist(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, const short mval[2], float mouse_worldloc[3]);
/* only draw so view_autodist_simple can be called many times after */
int view_autodist_init(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, int mode);
-int view_autodist_simple(struct ARegion *ar, short mval[2], float mouse_worldloc[3], int margin, float *force_depth);
-int view_autodist_depth(struct ARegion *ar, short mval[2], int margin, float *depth);
-int view_autodist_depth_segment(struct ARegion *ar, short mval_sta[2], short mval_end[2], int margin, float *depth);
+int view_autodist_simple(struct ARegion *ar, const short mval[2], float mouse_worldloc[3], int margin, float *force_depth);
+int view_autodist_depth(struct ARegion *ar, const short mval[2], int margin, float *depth);
+int view_autodist_depth_segment(struct ARegion *ar, const short mval_sta[2], const short mval_end[2], int margin, float *depth);
/* select */
#define MAXPICKBUF 10000
@@ -153,7 +153,7 @@ short view3d_opengl_select(struct ViewContext *vc, unsigned int *buffer, unsigne
void view3d_set_viewcontext(struct bContext *C, struct ViewContext *vc);
void view3d_operator_needs_opengl(const struct bContext *C);
void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *ar);
-void view3d_get_view_aligned_coordinate(struct ViewContext *vc, float *fp, short mval[2]);
+void view3d_get_view_aligned_coordinate(struct ViewContext *vc, float fp[3], const short mval[2]);
void view3d_get_transformation(struct ARegion *ar, struct RegionView3D *rv3d, struct Object *ob, struct bglMats *mats);
/* XXX should move to BLI_math */
@@ -176,7 +176,7 @@ struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D
struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, unsigned int flag, int drawtype, char err_out[256]);
-Base *ED_view3d_give_base_under_cursor(struct bContext *C, short *mval);
+Base *ED_view3d_give_base_under_cursor(struct bContext *C, const short mval[2]);
void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar, short do_clip);
int ED_view3d_lock(struct RegionView3D *rv3d);
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index af3716b4677..9cec034af28 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -98,7 +98,7 @@ void paintface_flush_flags(Object *ob)
}
/* returns 0 if not found, otherwise 1 */
-static int facesel_face_pick(struct bContext *C, Mesh *me, short *mval, unsigned int *index, short rect)
+static int facesel_face_pick(struct bContext *C, Mesh *me, const short mval[2], unsigned int *index, short rect)
{
ViewContext vc;
view3d_set_viewcontext(C, &vc);
@@ -716,7 +716,7 @@ void seam_mark_clear_tface(Scene *scene, short mode)
}
#endif
-int paintface_mouse_select(struct bContext *C, Object *ob, short mval[2], int extend)
+int paintface_mouse_select(struct bContext *C, Object *ob, const short mval[2], int extend)
{
Mesh *me;
MFace *mface, *msel;
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c
index 789c5c9c749..1ae6fb0bd98 100644
--- a/source/blender/editors/mesh/editmesh_mods.c
+++ b/source/blender/editors/mesh/editmesh_mods.c
@@ -2061,7 +2061,7 @@ void MESH_OT_loop_multi_select(wmOperatorType *ot)
/* ***************** loop select (non modal) ************** */
-static void mouse_mesh_loop(bContext *C, short mval[2], short extend, short ring)
+static void mouse_mesh_loop(bContext *C, const short mval[2], short extend, short ring)
{
ViewContext vc;
EditMesh *em;
@@ -2149,7 +2149,7 @@ void MESH_OT_loop_select(wmOperatorType *ot)
/* ******************* mesh shortest path select, uses prev-selected edge ****************** */
/* since you want to create paths with multiple selects, it doesn't have extend option */
-static void mouse_mesh_shortest_path(bContext *C, short mval[2])
+static void mouse_mesh_shortest_path(bContext *C, const short mval[2])
{
ViewContext vc;
EditMesh *em;
@@ -2282,7 +2282,7 @@ void MESH_OT_select_shortest_path(wmOperatorType *ot)
/* here actual select happens */
/* gets called via generic mouse select operator */
-int mouse_mesh(bContext *C, short mval[2], short extend)
+int mouse_mesh(bContext *C, const short mval[2], short extend)
{
ViewContext vc;
EditVert *eve;
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 83840f0f4cb..5901a36980c 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -4857,7 +4857,7 @@ void mesh_set_face_flags(EditMesh *em, short mode)
/********************** Rip Operator *************************/
/* helper to find edge for edge_rip */
-static float mesh_rip_edgedist(ARegion *ar, float mat[][4], float *co1, float *co2, short *mval)
+static float mesh_rip_edgedist(ARegion *ar, float mat[][4], float *co1, float *co2, const short mval[2])
{
float vec1[3], vec2[3], mvalf[2];
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index d3e1401b20e..b67f9d6de29 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -455,7 +455,7 @@ void MBALL_OT_reveal_metaelems(wmOperatorType *ot)
/* Select MetaElement with mouse click (user can select radius circle or
* stiffness circle) */
-int mouse_mball(bContext *C, short mval[2], int extend)
+int mouse_mball(bContext *C, const short mval[2], int extend)
{
static MetaElem *startelem=NULL;
Object *obedit= CTX_data_edit_object(C);
diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c
index 72bf3b52b74..198c8cab7fa 100644
--- a/source/blender/editors/object/object_lattice.c
+++ b/source/blender/editors/object/object_lattice.c
@@ -318,7 +318,7 @@ static void findnearestLattvert__doClosest(void *userData, BPoint *bp, int x, in
}
}
-static BPoint *findnearestLattvert(ViewContext *vc, short mval[2], int sel)
+static BPoint *findnearestLattvert(ViewContext *vc, const short mval[2], int sel)
{
/* sel==1: selected gets a disadvantage */
/* in nurb and bezt or bp the nearest is written */
@@ -336,7 +336,7 @@ static BPoint *findnearestLattvert(ViewContext *vc, short mval[2], int sel)
return data.bp;
}
-int mouse_lattice(bContext *C, short mval[2], int extend)
+int mouse_lattice(bContext *C, const short mval[2], int extend)
{
ViewContext vc;
BPoint *bp= NULL;
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index d7df329816d..1c9f9e60e14 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -338,7 +338,7 @@ typedef struct PEData {
DerivedMesh *dm;
PTCacheEdit *edit;
- short *mval;
+ const short *mval;
rcti *rect;
float rad;
float dist;
@@ -1369,7 +1369,7 @@ void PARTICLE_OT_select_all(wmOperatorType *ot)
/************************ pick select operator ************************/
-int PE_mouse_particles(bContext *C, short *mval, int extend)
+int PE_mouse_particles(bContext *C, const short mval[2], int extend)
{
PEData data;
Scene *scene= CTX_data_scene(C);
@@ -1574,7 +1574,7 @@ int PE_border_select(bContext *C, rcti *rect, int select, int extend)
/************************ circle select operator ************************/
-int PE_circle_select(bContext *C, int selecting, short *mval, float rad)
+int PE_circle_select(bContext *C, int selecting, const short mval[2], float rad)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index 4aa56ef370d..78368d91378 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -70,7 +70,7 @@ static bNode *node_under_mouse(bNodeTree *ntree, int mx, int my)
/* ****** Click Select ****** */
-static bNode *node_mouse_select(SpaceNode *snode, ARegion *ar, short *mval, short extend)
+static bNode *node_mouse_select(SpaceNode *snode, ARegion *ar, const short mval[2], short extend)
{
bNode *node;
float mx, my;
diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c
index 6172f212aef..1ae36b077af 100644
--- a/source/blender/editors/space_node/node_state.c
+++ b/source/blender/editors/space_node/node_state.c
@@ -158,7 +158,7 @@ static int do_header_hidden_node(bNode *node, float mx, float my)
return 0;
}
-static int node_toggle_visibility(SpaceNode *snode, ARegion *ar, short *mval)
+static int node_toggle_visibility(SpaceNode *snode, ARegion *ar, const short mval[2])
{
bNode *node;
float mx, my;
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 88d83b55788..92fae3d4820 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -284,7 +284,7 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i
}
-Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, short mval[2])
+Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const short mval[2])
{
Sequence *seq;
Editing *ed= seq_give_editing(scene, FALSE);
diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h
index f29919476cc..9a4796ced5e 100644
--- a/source/blender/editors/space_sequencer/sequencer_intern.h
+++ b/source/blender/editors/space_sequencer/sequencer_intern.h
@@ -61,7 +61,7 @@ void seq_reset_imageofs(struct SpaceSeq *sseq);
struct View2D;
void seq_rectf(struct Sequence *seq, struct rctf *rectf);
void boundbox_seq(struct Scene *scene, struct rctf *rect);
-struct Sequence *find_nearest_seq(struct Scene *scene, struct View2D *v2d, int *hand, short mval[2]);
+struct Sequence *find_nearest_seq(struct Scene *scene, struct View2D *v2d, int *hand, const short mval[2]);
struct Sequence *find_neighboring_sequence(struct Scene *scene, struct Sequence *test, int lr, int sel);
void deselect_all_seq(struct Scene *scene);
void recurs_sel_seq(struct Sequence *seqm);
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 091018670ba..c0c928dcb24 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -2283,7 +2283,7 @@ static int scroll_bar_invoke(bContext *C, wmOperator *op, wmEvent *event)
SpaceText *st= CTX_wm_space_text(C);
ARegion *ar= CTX_wm_region(C);
TextScroll *tsc;
- short *mval= event->mval;
+ const short *mval= event->mval;
int zone= -1;
if(RNA_property_is_set(op->ptr, "lines"))
@@ -2694,7 +2694,7 @@ static int line_number_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *even
SpaceText *st= CTX_wm_space_text(C);
Text *text= CTX_data_edit_text(C);
ARegion *ar= CTX_wm_region(C);
- short *mval= event->mval;
+ const short *mval= event->mval;
double time;
static int jump_to= 0;
static double last_jump= 0;
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 345b3746100..78538a6f16d 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -189,7 +189,7 @@ void view3d_clr_clipping(void)
}
}
-static int test_clipping(float *vec, float clip[][4])
+static int test_clipping(const float vec[3], float clip[][4])
{
float view[3];
copy_v3_v3(view, vec);
@@ -205,7 +205,7 @@ static int test_clipping(float *vec, float clip[][4])
/* for 'local' ED_view3d_local_clipping must run first
* then all comparisons can be done in localspace */
-int view3d_test_clipping(RegionView3D *rv3d, float *vec, int local)
+int view3d_test_clipping(RegionView3D *rv3d, const float vec[3], const int local)
{
return test_clipping(vec, local ? rv3d->clip_local : rv3d->clip);
}
@@ -1172,7 +1172,7 @@ ImBuf *view3d_read_backbuf(ViewContext *vc, short xmin, short ymin, short xmax,
}
/* smart function to sample a rect spiralling outside, nice for backbuf selection */
-unsigned int view3d_sample_backbuf_rect(ViewContext *vc, short mval[2], int size,
+unsigned int view3d_sample_backbuf_rect(ViewContext *vc, const short mval[2], int size,
unsigned int min, unsigned int max, int *dist, short strict,
void *handle, unsigned int (*indextest)(void *handle, unsigned int index))
{
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 98742bd0c7c..67576c188af 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -2650,7 +2650,7 @@ void VIEW3D_OT_enable_manipulator(wmOperatorType *ot)
/* ************************* below the line! *********************** */
-static float view_autodist_depth_margin(ARegion *ar, short mval[2], int margin)
+static float view_autodist_depth_margin(ARegion *ar, const short mval[2], int margin)
{
ViewDepths depth_temp= {0};
rcti rect;
@@ -2678,7 +2678,7 @@ static float view_autodist_depth_margin(ARegion *ar, short mval[2], int margin)
}
/* XXX todo Zooms in on a border drawn by the user */
-int view_autodist(Scene *scene, ARegion *ar, View3D *v3d, short *mval, float mouse_worldloc[3] ) //, float *autodist )
+int view_autodist(Scene *scene, ARegion *ar, View3D *v3d, const short mval[2], float mouse_worldloc[3] ) //, float *autodist )
{
bglMats mats; /* ZBuffer depth vars */
float depth_close= FLT_MAX;
@@ -2721,7 +2721,7 @@ int view_autodist_init(Scene *scene, ARegion *ar, View3D *v3d, int mode) //, flo
}
// no 4x4 sampling, run view_autodist_init first
-int view_autodist_simple(ARegion *ar, short *mval, float mouse_worldloc[3], int margin, float *force_depth) //, float *autodist )
+int view_autodist_simple(ARegion *ar, const short mval[2], float mouse_worldloc[3], int margin, float *force_depth) //, float *autodist )
{
bglMats mats; /* ZBuffer depth vars, could cache? */
float depth;
@@ -2749,7 +2749,7 @@ int view_autodist_simple(ARegion *ar, short *mval, float mouse_worldloc[3], int
return 1;
}
-int view_autodist_depth(struct ARegion *ar, short mval[2], int margin, float *depth)
+int view_autodist_depth(struct ARegion *ar, const short mval[2], int margin, float *depth)
{
*depth= view_autodist_depth_margin(ar, mval, margin);
@@ -2776,7 +2776,7 @@ static int depth_segment_cb(int x, int y, void *userData)
}
}
-int view_autodist_depth_segment(struct ARegion *ar, short mval_sta[2], short mval_end[2], int margin, float *depth)
+int view_autodist_depth_segment(struct ARegion *ar, const short mval_sta[2], const short mval_end[2], int margin, float *depth)
{
struct { struct ARegion *ar; int margin; float depth; } data = {NULL};
int p1[2];
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 75999fdeb6d..e8fbb3542fa 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -93,20 +93,20 @@ void view3d_set_viewcontext(bContext *C, ViewContext *vc)
vc->obedit= CTX_data_edit_object(C);
}
-void view3d_get_view_aligned_coordinate(ViewContext *vc, float *fp, short mval[2])
+void view3d_get_view_aligned_coordinate(ViewContext *vc, float fp[3], const short mval[2])
{
float dvec[3];
- short mx, my;
-
- mx= mval[0];
- my= mval[1];
-
- project_short_noclip(vc->ar, fp, mval);
-
+ short mval_cpy[2];
+
+ mval_cpy[0]= mval[0];
+ mval_cpy[1]= mval[1];
+
+ project_short_noclip(vc->ar, fp, mval_cpy);
+
initgrabz(vc->rv3d, fp[0], fp[1], fp[2]);
-
- if(mval[0]!=IS_CLIPPED) {
- window_to_3d_delta(vc->ar, dvec, mval[0]-mx, mval[1]-my);
+
+ if(mval_cpy[0]!=IS_CLIPPED) {
+ window_to_3d_delta(vc->ar, dvec, mval_cpy[0]-mval[0], mval_cpy[1]-mval[1]);
sub_v3_v3(fp, dvec);
}
}
@@ -941,7 +941,7 @@ static void deselectall_except(Scene *scene, Base *b) /* deselect all except b
}
}
-static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffer, int hits, short *mval, short extend)
+static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffer, int hits, const short mval[2], short extend)
{
short baseCount = 0;
short ok;
@@ -1027,7 +1027,7 @@ static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffe
/* we want a select buffer with bones, if there are... */
/* so check three selection levels and compare */
-static short mixed_bones_object_selectbuffer(ViewContext *vc, unsigned int *buffer, short *mval)
+static short mixed_bones_object_selectbuffer(ViewContext *vc, unsigned int *buffer, const short mval[2])
{
rcti rect;
int offs;
@@ -1084,7 +1084,7 @@ static short mixed_bones_object_selectbuffer(ViewContext *vc, unsigned int *buff
}
/* returns basact */
-static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int hits, short *mval, Base *startbase, int has_bones)
+static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int hits, const short mval[2], Base *startbase, int has_bones)
{
Scene *scene= vc->scene;
View3D *v3d= vc->v3d;
@@ -1177,7 +1177,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
}
/* mval comes from event->mval, only use within region handlers */
-Base *ED_view3d_give_base_under_cursor(bContext *C, short *mval)
+Base *ED_view3d_give_base_under_cursor(bContext *C, const short mval[2])
{
ViewContext vc;
Base *basact= NULL;
@@ -1202,7 +1202,7 @@ Base *ED_view3d_give_base_under_cursor(bContext *C, short *mval)
}
/* mval is region coords */
-static int mouse_select(bContext *C, short *mval, short extend, short obcenter, short enumerate)
+static int mouse_select(bContext *C, const short mval[2], short extend, short obcenter, short enumerate)
{
ViewContext vc;
ARegion *ar= CTX_wm_region(C);
@@ -1920,7 +1920,7 @@ static void mesh_circle_doSelectFace(void *userData, EditFace *efa, int x, int y
}
}
-static void mesh_circle_select(ViewContext *vc, int select, short *mval, float rad)
+static void mesh_circle_select(ViewContext *vc, int select, const short mval[2], float rad)
{
ToolSettings *ts= vc->scene->toolsettings;
int bbsel;
@@ -1965,7 +1965,7 @@ static void mesh_circle_select(ViewContext *vc, int select, short *mval, float r
EM_selectmode_flush(vc->em);
}
-static void paint_facesel_circle_select(ViewContext *vc, int select, short *mval, float rad)
+static void paint_facesel_circle_select(ViewContext *vc, int select, const short mval[2], float rad)
{
Object *ob= vc->obact;
Mesh *me = ob?ob->data:NULL;
@@ -2012,7 +2012,7 @@ static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint
}
}
}
-static void nurbscurve_circle_select(ViewContext *vc, int select, short *mval, float rad)
+static void nurbscurve_circle_select(ViewContext *vc, int select, const short mval[2], float rad)
{
struct {ViewContext *vc; short select, mval[2]; float radius; } data;
@@ -2039,7 +2039,7 @@ static void latticecurve_circle_doSelect(void *userData, BPoint *bp, int x, int
bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
}
}
-static void lattice_circle_select(ViewContext *vc, int select, short *mval, float rad)
+static void lattice_circle_select(ViewContext *vc, int select, const short mval[2], float rad)
{
struct {ViewContext *vc; short select, mval[2]; float radius; } data;
@@ -2071,7 +2071,7 @@ static short pchan_circle_doSelectJoint(void *userData, bPoseChannel *pchan, int
}
return 0;
}
-static void pose_circle_select(ViewContext *vc, int select, short *mval, float rad)
+static void pose_circle_select(ViewContext *vc, int select, const short mval[2], float rad)
{
struct {ViewContext *vc; short select, mval[2]; float radius; } data;
bPose *pose = vc->obact->pose;
@@ -2139,7 +2139,7 @@ static short armature_circle_doSelectJoint(void *userData, EditBone *ebone, int
}
return 0;
}
-static void armature_circle_select(ViewContext *vc, int select, short *mval, float rad)
+static void armature_circle_select(ViewContext *vc, int select, const short mval[2], float rad)
{
struct {ViewContext *vc; short select, mval[2]; float radius; } data;
bArmature *arm= vc->obedit->data;
@@ -2198,7 +2198,7 @@ static void armature_circle_select(ViewContext *vc, int select, short *mval, flo
/** Callbacks for circle selection in Editmode */
-static void obedit_circle_select(ViewContext *vc, short select, short *mval, float rad)
+static void obedit_circle_select(ViewContext *vc, short select, const short mval[2], float rad)
{
switch(vc->obedit->type) {
case OB_MESH:
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 1fdc2d9cad7..6dae0938f54 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -646,25 +646,25 @@ int initgrabz(RegionView3D *rv3d, float x, float y, float z)
}
/* always call initgrabz */
-void window_to_3d(ARegion *ar, float *vec, short mx, short my)
+void window_to_3d(ARegion *ar, float out[3], short mx, short my)
{
RegionView3D *rv3d= ar->regiondata;
float dx= ((float)(mx-(ar->winx/2)))*rv3d->zfac/(ar->winx/2);
float dy= ((float)(my-(ar->winy/2)))*rv3d->zfac/(ar->winy/2);
- float fz= rv3d->persmat[0][3]*vec[0]+ rv3d->persmat[1][3]*vec[1]+ rv3d->persmat[2][3]*vec[2]+ rv3d->persmat[3][3];
+ float fz= rv3d->persmat[0][3]*out[0]+ rv3d->persmat[1][3]*out[1]+ rv3d->persmat[2][3]*out[2]+ rv3d->persmat[3][3];
fz= fz/rv3d->zfac;
- vec[0]= (rv3d->persinv[0][0]*dx + rv3d->persinv[1][0]*dy+ rv3d->persinv[2][0]*fz)-rv3d->ofs[0];
- vec[1]= (rv3d->persinv[0][1]*dx + rv3d->persinv[1][1]*dy+ rv3d->persinv[2][1]*fz)-rv3d->ofs[1];
- vec[2]= (rv3d->persinv[0][2]*dx + rv3d->persinv[1][2]*dy+ rv3d->persinv[2][2]*fz)-rv3d->ofs[2];
+ out[0]= (rv3d->persinv[0][0]*dx + rv3d->persinv[1][0]*dy+ rv3d->persinv[2][0]*fz)-rv3d->ofs[0];
+ out[1]= (rv3d->persinv[0][1]*dx + rv3d->persinv[1][1]*dy+ rv3d->persinv[2][1]*fz)-rv3d->ofs[1];
+ out[2]= (rv3d->persinv[0][2]*dx + rv3d->persinv[1][2]*dy+ rv3d->persinv[2][2]*fz)-rv3d->ofs[2];
}
/* always call initgrabz */
/* only to detect delta motion */
-void window_to_3d_delta(ARegion *ar, float *vec, short mx, short my)
+void window_to_3d_delta(ARegion *ar, float out[3], short mx, short my)
{
RegionView3D *rv3d= ar->regiondata;
float dx, dy;
@@ -672,15 +672,15 @@ void window_to_3d_delta(ARegion *ar, float *vec, short mx, short my)
dx= 2.0f*mx*rv3d->zfac/ar->winx;
dy= 2.0f*my*rv3d->zfac/ar->winy;
- vec[0]= (rv3d->persinv[0][0]*dx + rv3d->persinv[1][0]*dy);
- vec[1]= (rv3d->persinv[0][1]*dx + rv3d->persinv[1][1]*dy);
- vec[2]= (rv3d->persinv[0][2]*dx + rv3d->persinv[1][2]*dy);
+ out[0]= (rv3d->persinv[0][0]*dx + rv3d->persinv[1][0]*dy);
+ out[1]= (rv3d->persinv[0][1]*dx + rv3d->persinv[1][1]*dy);
+ out[2]= (rv3d->persinv[0][2]*dx + rv3d->persinv[1][2]*dy);
}
/* doesn't rely on initgrabz */
/* for perspective view, get the vector direction to
* the mouse cursor as a normalized vector */
-void window_to_3d_vector(ARegion *ar, float *vec, short mx, short my)
+void window_to_3d_vector(ARegion *ar, float out[3], short mx, short my)
{
RegionView3D *rv3d= ar->regiondata;
float dx, dy;
@@ -692,11 +692,11 @@ void window_to_3d_vector(ARegion *ar, float *vec, short mx, short my)
/* normalize here so vecs are proportional to eachother */
normalize_v3_v3(viewvec, rv3d->viewinv[2]);
- vec[0]= viewvec[0] - (rv3d->persinv[0][0]*dx + rv3d->persinv[1][0]*dy);
- vec[1]= viewvec[1] - (rv3d->persinv[0][1]*dx + rv3d->persinv[1][1]*dy);
- vec[2]= viewvec[2] - (rv3d->persinv[0][2]*dx + rv3d->persinv[1][2]*dy);
+ out[0]= viewvec[0] - (rv3d->persinv[0][0]*dx + rv3d->persinv[1][0]*dy);
+ out[1]= viewvec[1] - (rv3d->persinv[0][1]*dx + rv3d->persinv[1][1]*dy);
+ out[2]= viewvec[2] - (rv3d->persinv[0][2]*dx + rv3d->persinv[1][2]*dy);
- normalize_v3(vec);
+ normalize_v3(out);
}
float read_cached_depth(ViewContext *vc, int x, int y)
@@ -740,7 +740,7 @@ void view3d_unproject(bglMats *mats, float out[3], const short x, const short y,
}
/* use above call to get projecting mat */
-void view3d_project_float(ARegion *ar, float *vec, float *adr, float mat[4][4])
+void view3d_project_float(ARegion *ar, const float vec[3], float adr[2], float mat[4][4])
{
float vec4[4];
@@ -793,7 +793,7 @@ int boundbox_clip(RegionView3D *rv3d, float obmat[][4], BoundBox *bb)
return 0;
}
-void project_short(ARegion *ar, float *vec, short *adr) /* clips */
+void project_short(ARegion *ar, const float vec[3], short adr[2]) /* clips */
{
RegionView3D *rv3d= ar->regiondata;
float fx, fy, vec4[4];
@@ -824,7 +824,7 @@ void project_short(ARegion *ar, float *vec, short *adr) /* clips */
}
}
-void project_int(ARegion *ar, float *vec, int *adr)
+void project_int(ARegion *ar, const float vec[3], int adr[2])
{
RegionView3D *rv3d= ar->regiondata;
float fx, fy, vec4[4];
@@ -849,7 +849,7 @@ void project_int(ARegion *ar, float *vec, int *adr)
}
}
-void project_int_noclip(ARegion *ar, float *vec, int *adr)
+void project_int_noclip(ARegion *ar, const float vec[3], int adr[2])
{
RegionView3D *rv3d= ar->regiondata;
float fx, fy, vec4[4];
@@ -873,7 +873,7 @@ void project_int_noclip(ARegion *ar, float *vec, int *adr)
}
}
-void project_short_noclip(ARegion *ar, float *vec, short *adr)
+void project_short_noclip(ARegion *ar, const float vec[3], short adr[2])
{
RegionView3D *rv3d= ar->regiondata;
float fx, fy, vec4[4];
@@ -899,7 +899,7 @@ void project_short_noclip(ARegion *ar, float *vec, short *adr)
}
}
-void project_float(ARegion *ar, float *vec, float *adr)
+void project_float(ARegion *ar, const float vec[3], float adr[2])
{
RegionView3D *rv3d= ar->regiondata;
float vec4[4];
@@ -916,7 +916,7 @@ void project_float(ARegion *ar, float *vec, float *adr)
}
}
-void project_float_noclip(ARegion *ar, float *vec, float *adr)
+void project_float_noclip(ARegion *ar, const float vec[3], float adr[2])
{
RegionView3D *rv3d= ar->regiondata;
float vec4[4];
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index c710312606d..ae863efa9f7 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -2283,7 +2283,7 @@ int handleEventWarp(TransInfo *t, wmEvent *event)
return status;
}
-int Warp(TransInfo *t, short UNUSED(mval[2]))
+int Warp(TransInfo *t, const short UNUSED(mval[2]))
{
TransData *td = t->data;
float vec[3], circumfac, dist, phi0, co, si, *curs, cursor[3], gcursor[3];
@@ -2431,7 +2431,7 @@ int handleEventShear(TransInfo *t, wmEvent *event)
}
-int Shear(TransInfo *t, short UNUSED(mval[2]))
+int Shear(TransInfo *t, const short UNUSED(mval[2]))
{
TransData *td = t->data;
float vec[3];
@@ -2697,7 +2697,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) {
constraintTransLim(t, td);
}
-int Resize(TransInfo *t, short mval[2])
+int Resize(TransInfo *t, const short mval[2])
{
TransData *td;
float size[3], mat[3][3];
@@ -2802,7 +2802,7 @@ void initToSphere(TransInfo *t)
t->val /= (float)t->total;
}
-int ToSphere(TransInfo *t, short UNUSED(mval[2]))
+int ToSphere(TransInfo *t, const short UNUSED(mval[2]))
{
float vec[3];
float ratio, radius;
@@ -3149,7 +3149,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
}
}
-int Rotation(TransInfo *t, short UNUSED(mval[2]))
+int Rotation(TransInfo *t, const short UNUSED(mval[2]))
{
char str[128];
@@ -3255,7 +3255,7 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a
}
}
-int Trackball(TransInfo *t, short UNUSED(mval[2]))
+int Trackball(TransInfo *t, const short UNUSED(mval[2]))
{
char str[128];
float axis1[3], axis2[3];
@@ -3477,7 +3477,7 @@ static void applyTranslation(TransInfo *t, float vec[3]) {
}
/* uses t->vec to store actual translation in */
-int Translation(TransInfo *t, short UNUSED(mval[2]))
+int Translation(TransInfo *t, const short UNUSED(mval[2]))
{
char str[250];
@@ -3544,7 +3544,7 @@ void initShrinkFatten(TransInfo *t)
-int ShrinkFatten(TransInfo *t, short UNUSED(mval[2]))
+int ShrinkFatten(TransInfo *t, const short UNUSED(mval[2]))
{
float vec[3];
float distance;
@@ -3619,7 +3619,7 @@ void initTilt(TransInfo *t)
-int Tilt(TransInfo *t, short UNUSED(mval[2]))
+int Tilt(TransInfo *t, const short UNUSED(mval[2]))
{
TransData *td = t->data;
int i;
@@ -3691,7 +3691,7 @@ void initCurveShrinkFatten(TransInfo *t)
t->flag |= T_NO_CONSTRAINT;
}
-int CurveShrinkFatten(TransInfo *t, short UNUSED(mval[2]))
+int CurveShrinkFatten(TransInfo *t, const short UNUSED(mval[2]))
{
TransData *td = t->data;
float ratio;
@@ -3759,7 +3759,7 @@ void initPushPull(TransInfo *t)
}
-int PushPull(TransInfo *t, short UNUSED(mval[2]))
+int PushPull(TransInfo *t, const short UNUSED(mval[2]))
{
float vec[3], axis[3];
float distance;
@@ -3892,7 +3892,7 @@ int handleEventBevel(TransInfo *t, wmEvent *event)
return 0;
}
-int Bevel(TransInfo *t, short UNUSED(mval[2]))
+int Bevel(TransInfo *t, const short UNUSED(mval[2]))
{
float distance,d;
int i;
@@ -3960,7 +3960,7 @@ void initBevelWeight(TransInfo *t)
t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT;
}
-int BevelWeight(TransInfo *t, short UNUSED(mval[2]))
+int BevelWeight(TransInfo *t, const short UNUSED(mval[2]))
{
TransData *td = t->data;
float weight;
@@ -4033,7 +4033,7 @@ void initCrease(TransInfo *t)
t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT;
}
-int Crease(TransInfo *t, short UNUSED(mval[2]))
+int Crease(TransInfo *t, const short UNUSED(mval[2]))
{
TransData *td = t->data;
float crease;
@@ -4152,7 +4152,7 @@ static void ElementBoneSize(TransInfo *t, TransData *td, float mat[3][3])
td->loc[1]= oldy;
}
-int BoneSize(TransInfo *t, short mval[2])
+int BoneSize(TransInfo *t, const short mval[2])
{
TransData *td = t->data;
float size[3], mat[3][3];
@@ -4228,7 +4228,7 @@ void initBoneEnvelope(TransInfo *t)
t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT;
}
-int BoneEnvelope(TransInfo *t, short UNUSED(mval[2]))
+int BoneEnvelope(TransInfo *t, const short UNUSED(mval[2]))
{
TransData *td = t->data;
float ratio;
@@ -4962,7 +4962,7 @@ int doEdgeSlide(TransInfo *t, float perc)
return 1;
}
-int EdgeSlide(TransInfo *t, short UNUSED(mval[2]))
+int EdgeSlide(TransInfo *t, const short UNUSED(mval[2]))
{
char str[50];
float final;
@@ -5021,7 +5021,7 @@ void initBoneRoll(TransInfo *t)
t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT;
}
-int BoneRoll(TransInfo *t, short UNUSED(mval[2]))
+int BoneRoll(TransInfo *t, const short UNUSED(mval[2]))
{
TransData *td = t->data;
int i;
@@ -5082,7 +5082,7 @@ void initBakeTime(TransInfo *t)
t->num.increment = t->snap[1];
}
-int BakeTime(TransInfo *t, short mval[2])
+int BakeTime(TransInfo *t, const short mval[2])
{
TransData *td = t->data;
float time;
@@ -5157,7 +5157,7 @@ void initMirror(TransInfo *t)
}
}
-int Mirror(TransInfo *t, short UNUSED(mval[2]))
+int Mirror(TransInfo *t, const short UNUSED(mval[2]))
{
TransData *td;
float size[3], mat[3][3];
@@ -5234,7 +5234,7 @@ void initAlign(TransInfo *t)
initMouseInputMode(t, &t->mouse, INPUT_NONE);
}
-int Align(TransInfo *t, short UNUSED(mval[2]))
+int Align(TransInfo *t, const short UNUSED(mval[2]))
{
TransData *td = t->data;
float center[3];
@@ -5337,7 +5337,7 @@ static void applySeqSlide(TransInfo *t, float val[2]) {
}
}
-int SeqSlide(TransInfo *t, short UNUSED(mval[2]))
+int SeqSlide(TransInfo *t, const short UNUSED(mval[2]))
{
char str[200];
@@ -5627,7 +5627,7 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval))
}
}
-int TimeTranslate(TransInfo *t, short mval[2])
+int TimeTranslate(TransInfo *t, const short mval[2])
{
View2D *v2d = (View2D *)t->view;
float cval[2], sval[2];
@@ -5757,7 +5757,7 @@ static void applyTimeSlide(TransInfo *t, float sval)
}
}
-int TimeSlide(TransInfo *t, short mval[2])
+int TimeSlide(TransInfo *t, const short mval[2])
{
View2D *v2d = (View2D *)t->view;
float cval[2], sval[2];
@@ -5882,7 +5882,7 @@ static void applyTimeScale(TransInfo *t) {
}
}
-int TimeScale(TransInfo *t, short UNUSED(mval[2]))
+int TimeScale(TransInfo *t, const short UNUSED(mval[2]))
{
char str[200];
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index b0bd4ccc5eb..b94f2cc525a 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -242,7 +242,7 @@ typedef struct TransData {
} TransData;
typedef struct MouseInput {
- void (*apply)(struct TransInfo *, struct MouseInput *, short [2], float [3]);
+ void (*apply)(struct TransInfo *, struct MouseInput *, const short [2], float [3]);
void (*post)(struct TransInfo *, float [3]);
short imval[2]; /* initial mouse position */
@@ -261,7 +261,7 @@ typedef struct TransInfo {
int options; /* current context/options for transform */
float val; /* init value for some transformations (and rotation angle) */
float fac; /* factor for distance based transform */
- int (*transform)(struct TransInfo *, short *);
+ int (*transform)(struct TransInfo *, const short *);
/* transform function pointer */
int (*handleEvent)(struct TransInfo *, struct wmEvent *);
/* event handler function pointer RETURN 1 if redraw is needed */
@@ -467,81 +467,81 @@ void removeAspectRatio(TransInfo *t, float *vec);
void initWarp(TransInfo *t);
int handleEventWarp(TransInfo *t, struct wmEvent *event);
-int Warp(TransInfo *t, short mval[2]);
+int Warp(TransInfo *t, const short mval[2]);
void initShear(TransInfo *t);
int handleEventShear(TransInfo *t, struct wmEvent *event);
-int Shear(TransInfo *t, short mval[2]);
+int Shear(TransInfo *t, const short mval[2]);
void initResize(TransInfo *t);
-int Resize(TransInfo *t, short mval[2]);
+int Resize(TransInfo *t, const short mval[2]);
void initTranslation(TransInfo *t);
-int Translation(TransInfo *t, short mval[2]);
+int Translation(TransInfo *t, const short mval[2]);
void initToSphere(TransInfo *t);
-int ToSphere(TransInfo *t, short mval[2]);
+int ToSphere(TransInfo *t, const short mval[2]);
void initRotation(TransInfo *t);
-int Rotation(TransInfo *t, short mval[2]);
+int Rotation(TransInfo *t, const short mval[2]);
void initShrinkFatten(TransInfo *t);
-int ShrinkFatten(TransInfo *t, short mval[2]);
+int ShrinkFatten(TransInfo *t, const short mval[2]);
void initTilt(TransInfo *t);
-int Tilt(TransInfo *t, short mval[2]);
+int Tilt(TransInfo *t, const short mval[2]);
void initCurveShrinkFatten(TransInfo *t);
-int CurveShrinkFatten(TransInfo *t, short mval[2]);
+int CurveShrinkFatten(TransInfo *t, const short mval[2]);
void initTrackball(TransInfo *t);
-int Trackball(TransInfo *t, short mval[2]);
+int Trackball(TransInfo *t, const short mval[2]);
void initPushPull(TransInfo *t);
-int PushPull(TransInfo *t, short mval[2]);
+int PushPull(TransInfo *t, const short mval[2]);
void initBevel(TransInfo *t);
int handleEventBevel(TransInfo *t, struct wmEvent *event);
-int Bevel(TransInfo *t, short mval[2]);
+int Bevel(TransInfo *t, const short mval[2]);
void initBevelWeight(TransInfo *t);
-int BevelWeight(TransInfo *t, short mval[2]);
+int BevelWeight(TransInfo *t, const short mval[2]);
void initCrease(TransInfo *t);
-int Crease(TransInfo *t, short mval[2]);
+int Crease(TransInfo *t, const short mval[2]);
void initBoneSize(TransInfo *t);
-int BoneSize(TransInfo *t, short mval[2]);
+int BoneSize(TransInfo *t, const short mval[2]);
void initBoneEnvelope(TransInfo *t);
-int BoneEnvelope(TransInfo *t, short mval[2]);
+int BoneEnvelope(TransInfo *t, const short mval[2]);
void initBoneRoll(TransInfo *t);
-int BoneRoll(TransInfo *t, short mval[2]);
+int BoneRoll(TransInfo *t, const short mval[2]);
void initEdgeSlide(TransInfo *t);
-int EdgeSlide(TransInfo *t, short mval[2]);
+int EdgeSlide(TransInfo *t, const short mval[2]);
void initTimeTranslate(TransInfo *t);
-int TimeTranslate(TransInfo *t, short mval[2]);
+int TimeTranslate(TransInfo *t, const short mval[2]);
void initTimeSlide(TransInfo *t);
-int TimeSlide(TransInfo *t, short mval[2]);
+int TimeSlide(TransInfo *t, const short mval[2]);
void initTimeScale(TransInfo *t);
-int TimeScale(TransInfo *t, short mval[2]);
+int TimeScale(TransInfo *t, const short mval[2]);
void initBakeTime(TransInfo *t);
-int BakeTime(TransInfo *t, short mval[2]);
+int BakeTime(TransInfo *t, const short mval[2]);
void initMirror(TransInfo *t);
-int Mirror(TransInfo *t, short mval[2]);
+int Mirror(TransInfo *t, const short mval[2]);
void initAlign(TransInfo *t);
-int Align(TransInfo *t, short mval[2]);
+int Align(TransInfo *t, const short mval[2]);
void initSeqSlide(TransInfo *t);
-int SeqSlide(TransInfo *t, short mval[2]);
+int SeqSlide(TransInfo *t, const short mval[2]);
void drawPropCircle(const struct bContext *C, TransInfo *t);
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c
index 45ed983fce5..5097c12d785 100644
--- a/source/blender/editors/transform/transform_input.c
+++ b/source/blender/editors/transform/transform_input.c
@@ -43,7 +43,7 @@
/* ************************** INPUT FROM MOUSE *************************** */
-static void InputVector(TransInfo *t, MouseInput *mi, short mval[2], float output[3])
+static void InputVector(TransInfo *t, MouseInput *mi, const short mval[2], float output[3])
{
float vec[3], dvec[3];
if(mi->precision)
@@ -61,7 +61,7 @@ static void InputVector(TransInfo *t, MouseInput *mi, short mval[2], float outpu
}
-static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, short mval[2], float output[3])
+static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const short mval[2], float output[3])
{
float ratio, precise_ratio, dx, dy;
if(mi->precision)
@@ -87,7 +87,7 @@ static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, short mval[2], flo
output[0] = ratio;
}
-static void InputSpringFlip(TransInfo *t, MouseInput *mi, short mval[2], float output[3])
+static void InputSpringFlip(TransInfo *t, MouseInput *mi, const short mval[2], float output[3])
{
InputSpring(t, mi, mval, output);
@@ -100,7 +100,7 @@ static void InputSpringFlip(TransInfo *t, MouseInput *mi, short mval[2], float o
}
}
-static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, short mval[2], float output[3])
+static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const short mval[2], float output[3])
{
if(mi->precision)
@@ -118,7 +118,7 @@ static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, short mval[2],
output[1] *= mi->factor;
}
-static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) {
+static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const short mval[2], float output[3]) {
float x, pad;
pad = t->ar->winx / 10;
@@ -135,7 +135,7 @@ static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, short mval[2], fl
output[0] = (x - pad) / (t->ar->winx - 2 * pad);
}
-static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) {
+static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, const short mval[2], float output[3]) {
float vec[3];
InputVector(t, mi, mval, vec);
@@ -144,7 +144,7 @@ static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, short mval[2],
output[0] = dot_v3v3(t->viewinv[0], vec) * 2.0f;
}
-static void InputVerticalRatio(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) {
+static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const short mval[2], float output[3]) {
float y, pad;
pad = t->ar->winy / 10;
@@ -160,7 +160,7 @@ static void InputVerticalRatio(TransInfo *t, MouseInput *mi, short mval[2], floa
output[0] = (y - pad) / (t->ar->winy - 2 * pad);
}
-static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) {
+static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, const short mval[2], float output[3]) {
float vec[3];
InputVector(t, mi, mval, vec);
@@ -185,7 +185,7 @@ void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, short start[2], short
data[3] = end[1];
}
-static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, short mval[2], float output[3])
+static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const short mval[2], float output[3])
{
float length;
float distance;
@@ -218,7 +218,7 @@ static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, short mval[2]
}
}
-static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, short mval[2], float output[3])
+static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const short mval[2], float output[3])
{
double dx2 = mval[0] - mi->center[0];
double dy2 = mval[1] - mi->center[1];
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index da1a1b91654..2fa094c6b8b 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -1487,7 +1487,7 @@ void BIF_draw_manipulator(const bContext *C)
}
}
-static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, short *mval, float hotspot)
+static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const short mval[2], float hotspot)
{
View3D *v3d= sa->spacedata.first;
RegionView3D *rv3d= ar->regiondata;