From 501d2443d03cce18985fab3ffad5d23238748f3e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 30 Jun 2021 16:37:14 +1000 Subject: Cleanup: use const arguments for accessor functions --- source/blender/editors/animation/anim_filter.c | 4 ++-- source/blender/editors/animation/keyframing.c | 2 +- source/blender/editors/curve/editcurve_select.c | 18 +++++++++--------- .../editors/gizmo_library/gizmo_types/snap3d_gizmo.c | 4 ++-- source/blender/editors/gpencil/editaction_gpencil.c | 4 ++-- source/blender/editors/gpencil/gpencil_data.c | 14 +++++++------- source/blender/editors/gpencil/gpencil_sculpt_paint.c | 2 +- source/blender/editors/gpencil/gpencil_utils.c | 16 ++++++++-------- source/blender/editors/include/ED_curve.h | 8 ++++---- source/blender/editors/include/ED_gizmo_library.h | 2 +- source/blender/editors/include/ED_gpencil.h | 16 ++++++++-------- source/blender/editors/include/ED_keyframing.h | 2 +- source/blender/editors/include/ED_mask.h | 2 +- source/blender/editors/include/ED_node.h | 2 +- source/blender/editors/include/ED_object.h | 5 +++-- source/blender/editors/interface/interface_widgets.c | 4 ++-- source/blender/editors/mask/mask_editaction.c | 2 +- source/blender/editors/object/object_edit.c | 2 +- source/blender/editors/object/object_modes.c | 4 ++-- source/blender/editors/object/object_vgroup.c | 2 +- source/blender/editors/render/render_shading.c | 4 ++-- source/blender/editors/space_node/node_edit.cc | 4 ++-- .../blender/editors/transform/transform_constraints.c | 2 +- .../blender/editors/transform/transform_constraints.h | 2 +- 24 files changed, 64 insertions(+), 63 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 1cdd879a8f9..f04fa556dad 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1217,7 +1217,7 @@ static bool skip_fcurve_with_name( * * \return true if F-Curve has errors/is disabled */ -static bool fcurve_has_errors(FCurve *fcu) +static bool fcurve_has_errors(const FCurve *fcu) { /* F-Curve disabled - path eval error */ if (fcu->flag & FCURVE_DISABLED) { @@ -1226,7 +1226,7 @@ static bool fcurve_has_errors(FCurve *fcu) /* driver? */ if (fcu->driver) { - ChannelDriver *driver = fcu->driver; + const ChannelDriver *driver = fcu->driver; DriverVar *dvar; /* error flag on driver usually means that there is an error diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 506b126d01e..9364be41543 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -2810,7 +2810,7 @@ bool autokeyframe_cfra_can_key(const Scene *scene, ID *id) /* --------------- API/Per-Datablock Handling ------------------- */ /* Checks if some F-Curve has a keyframe for a given frame */ -bool fcurve_frame_has_keyframe(FCurve *fcu, float frame, short filter) +bool fcurve_frame_has_keyframe(const FCurve *fcu, float frame, short filter) { /* quick sanity check */ if (ELEM(NULL, fcu, fcu->bezt)) { diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c index a265a794f56..721aa7afecc 100644 --- a/source/blender/editors/curve/editcurve_select.c +++ b/source/blender/editors/curve/editcurve_select.c @@ -111,10 +111,10 @@ static bool swap_selection_bpoint(BPoint *bp) return select_bpoint(bp, SELECT, SELECT, VISIBLE); } -bool ED_curve_nurb_select_check(View3D *v3d, Nurb *nu) +bool ED_curve_nurb_select_check(const View3D *v3d, const Nurb *nu) { if (nu->type == CU_BEZIER) { - BezTriple *bezt; + const BezTriple *bezt; int i; for (i = nu->pntsu, bezt = nu->bezt; i--; bezt++) { @@ -124,7 +124,7 @@ bool ED_curve_nurb_select_check(View3D *v3d, Nurb *nu) } } else { - BPoint *bp; + const BPoint *bp; int i; for (i = nu->pntsu * nu->pntsv, bp = nu->bp; i--; bp++) { @@ -136,12 +136,12 @@ bool ED_curve_nurb_select_check(View3D *v3d, Nurb *nu) return false; } -int ED_curve_nurb_select_count(View3D *v3d, Nurb *nu) +int ED_curve_nurb_select_count(const View3D *v3d, const Nurb *nu) { int sel = 0; if (nu->type == CU_BEZIER) { - BezTriple *bezt; + const BezTriple *bezt; int i; for (i = nu->pntsu, bezt = nu->bezt; i--; bezt++) { @@ -151,7 +151,7 @@ int ED_curve_nurb_select_count(View3D *v3d, Nurb *nu) } } else { - BPoint *bp; + const BPoint *bp; int i; for (i = nu->pntsu * nu->pntsv, bp = nu->bp; i--; bp++) { @@ -227,7 +227,7 @@ bool ED_curve_nurb_deselect_all(const Nurb *nu) return changed; } -int ED_curve_select_count(View3D *v3d, struct EditNurb *editnurb) +int ED_curve_select_count(const View3D *v3d, const EditNurb *editnurb) { int sel = 0; Nurb *nu; @@ -239,9 +239,9 @@ int ED_curve_select_count(View3D *v3d, struct EditNurb *editnurb) return sel; } -bool ED_curve_select_check(View3D *v3d, struct EditNurb *editnurb) +bool ED_curve_select_check(const View3D *v3d, const EditNurb *editnurb) { - LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) { + LISTBASE_FOREACH (const Nurb *, nu, &editnurb->nurbs) { if (ED_curve_nurb_select_check(v3d, nu)) { return true; } diff --git a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c index b2d3a2e1576..31ab5eca974 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c @@ -319,9 +319,9 @@ bool ED_gizmotypes_snap_3d_invert_snap_get(struct wmGizmo *gz) #endif } -bool ED_gizmotypes_snap_3d_is_enabled(wmGizmo *gz) +bool ED_gizmotypes_snap_3d_is_enabled(const wmGizmo *gz) { - SnapGizmo3D *snap_gizmo = (SnapGizmo3D *)gz; + const SnapGizmo3D *snap_gizmo = (const SnapGizmo3D *)gz; return snap_gizmo->is_enabled; } diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c index 92f1629f7f7..6e6d94a2909 100644 --- a/source/blender/editors/gpencil/editaction_gpencil.c +++ b/source/blender/editors/gpencil/editaction_gpencil.c @@ -107,7 +107,7 @@ void ED_gpencil_layer_make_cfra_list(bGPDlayer *gpl, ListBase *elems, bool onlys /* Selection Tools */ /* check if one of the frames in this layer is selected */ -bool ED_gpencil_layer_frame_select_check(bGPDlayer *gpl) +bool ED_gpencil_layer_frame_select_check(const bGPDlayer *gpl) { /* error checking */ if (gpl == NULL) { @@ -115,7 +115,7 @@ bool ED_gpencil_layer_frame_select_check(bGPDlayer *gpl) } /* stop at the first one found */ - LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { + LISTBASE_FOREACH (const bGPDframe *, gpf, &gpl->frames) { if (gpf->flag & GP_FRAME_SELECT) { return true; } diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index e11ed927cbf..e272f46d13d 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -871,20 +871,20 @@ void GPENCIL_OT_frame_clean_loose(wmOperatorType *ot) } /* ********************* Clean Duplicated Frames ************************** */ -static bool gpencil_frame_is_equal(bGPDframe *gpf_a, bGPDframe *gpf_b) +static bool gpencil_frame_is_equal(const bGPDframe *gpf_a, const bGPDframe *gpf_b) { if ((gpf_a == NULL) || (gpf_b == NULL)) { return false; } /* If the number of strokes is different, cannot be equal. */ - int totstrokes_a = BLI_listbase_count(&gpf_a->strokes); - int totstrokes_b = BLI_listbase_count(&gpf_b->strokes); + const int totstrokes_a = BLI_listbase_count(&gpf_a->strokes); + const int totstrokes_b = BLI_listbase_count(&gpf_b->strokes); if ((totstrokes_a == 0) || (totstrokes_b == 0) || (totstrokes_a != totstrokes_b)) { return false; } /* Loop all strokes and check. */ - bGPDstroke *gps_a = gpf_a->strokes.first; - bGPDstroke *gps_b = gpf_b->strokes.first; + const bGPDstroke *gps_a = gpf_a->strokes.first; + const bGPDstroke *gps_b = gpf_b->strokes.first; for (int i = 0; i < totstrokes_a; i++) { /* If the number of points is different, cannot be equal. */ if (gps_a->totpoints != gps_b->totpoints) { @@ -924,8 +924,8 @@ static bool gpencil_frame_is_equal(bGPDframe *gpf_a, bGPDframe *gpf_b) /* Loop points and check if equals or not. */ for (int p = 0; p < gps_a->totpoints; p++) { - bGPDspoint *pt_a = &gps_a->points[p]; - bGPDspoint *pt_b = &gps_b->points[p]; + const bGPDspoint *pt_a = &gps_a->points[p]; + const bGPDspoint *pt_b = &gps_b->points[p]; if (!equals_v3v3(&pt_a->x, &pt_b->x)) { return false; } diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c index 864231e6aab..0226558b4a0 100644 --- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c +++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c @@ -1381,7 +1381,7 @@ static float gpencil_sculpt_rotation_eval_get(tGP_BrushEditData *gso, return 0.0f; } - GP_SpaceConversion *gsc = &gso->gsc; + const GP_SpaceConversion *gsc = &gso->gsc; bGPDstroke *gps_orig = (gps_eval->runtime.gps_orig) ? gps_eval->runtime.gps_orig : gps_eval; bGPDspoint *pt_orig = &gps_orig->points[pt_eval->runtime.idx_orig]; bGPDspoint *pt_prev_eval = NULL; diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 15ada6e0891..54672743439 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -3106,8 +3106,8 @@ void ED_gpencil_sbuffer_vertex_color_set(Depsgraph *depsgraph, } /* Get the bigger 2D bound box points. */ -void ED_gpencil_projected_2d_bound_box(GP_SpaceConversion *gsc, - bGPDstroke *gps, +void ED_gpencil_projected_2d_bound_box(const GP_SpaceConversion *gsc, + const bGPDstroke *gps, const float diff_mat[4][4], float r_min[2], float r_max[2]) @@ -3140,7 +3140,7 @@ void ED_gpencil_projected_2d_bound_box(GP_SpaceConversion *gsc, } /* Check if the stroke collides with brush. */ -bool ED_gpencil_stroke_check_collision(GP_SpaceConversion *gsc, +bool ED_gpencil_stroke_check_collision(const GP_SpaceConversion *gsc, bGPDstroke *gps, const float mouse[2], const int radius, @@ -3175,9 +3175,9 @@ bool ED_gpencil_stroke_check_collision(GP_SpaceConversion *gsc, * \param diff_mat: View matrix. * \return True if the point is inside. */ -bool ED_gpencil_stroke_point_is_inside(bGPDstroke *gps, - GP_SpaceConversion *gsc, - int mouse[2], +bool ED_gpencil_stroke_point_is_inside(const bGPDstroke *gps, + const GP_SpaceConversion *gsc, + const int mouse[2], const float diff_mat[4][4]) { bool hit = false; @@ -3190,7 +3190,7 @@ bool ED_gpencil_stroke_point_is_inside(bGPDstroke *gps, mcoords = MEM_mallocN(sizeof(int[2]) * len, __func__); /* Convert stroke to 2D array of points. */ - bGPDspoint *pt; + const bGPDspoint *pt; int i; for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { bGPDspoint pt2; @@ -3214,7 +3214,7 @@ bool ED_gpencil_stroke_point_is_inside(bGPDstroke *gps, } bGPDstroke *ED_gpencil_stroke_nearest_to_ends(bContext *C, - GP_SpaceConversion *gsc, + const GP_SpaceConversion *gsc, bGPDlayer *gpl, bGPDframe *gpf, bGPDstroke *gps, diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index 8015a665970..44c5897d3a3 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -60,21 +60,21 @@ bool ED_curve_editnurb_select_pick( struct Nurb *ED_curve_add_nurbs_primitive( struct bContext *C, struct Object *obedit, float mat[4][4], int type, int newob); -bool ED_curve_nurb_select_check(struct View3D *v3d, struct Nurb *nu); -int ED_curve_nurb_select_count(struct View3D *v3d, struct Nurb *nu); +bool ED_curve_nurb_select_check(const struct View3D *v3d, const struct Nurb *nu); +int ED_curve_nurb_select_count(const struct View3D *v3d, const struct Nurb *nu); bool ED_curve_nurb_select_all(const struct Nurb *nu); bool ED_curve_nurb_deselect_all(const struct Nurb *nu); int ED_curve_join_objects_exec(struct bContext *C, struct wmOperator *op); /* editcurve_select.c */ -bool ED_curve_select_check(struct View3D *v3d, struct EditNurb *editnurb); +bool ED_curve_select_check(const struct View3D *v3d, const struct EditNurb *editnurb); bool ED_curve_deselect_all(struct EditNurb *editnurb); bool ED_curve_deselect_all_multi_ex(struct Base **bases, int bases_len); bool ED_curve_deselect_all_multi(struct bContext *C); bool ED_curve_select_all(struct EditNurb *editnurb); bool ED_curve_select_swap(struct EditNurb *editnurb, bool hide_handles); -int ED_curve_select_count(struct View3D *v3d, struct EditNurb *editnurb); +int ED_curve_select_count(const struct View3D *v3d, const struct EditNurb *editnurb); /* editcurve_undo.c */ void ED_curve_undosys_type(struct UndoType *ut); diff --git a/source/blender/editors/include/ED_gizmo_library.h b/source/blender/editors/include/ED_gizmo_library.h index 571519e52f7..357d5e10fa7 100644 --- a/source/blender/editors/include/ED_gizmo_library.h +++ b/source/blender/editors/include/ED_gizmo_library.h @@ -275,7 +275,7 @@ void ED_gizmotypes_snap_3d_flag_clear(struct wmGizmo *gz, eSnapGizmo flag); bool ED_gizmotypes_snap_3d_flag_test(struct wmGizmo *gz, eSnapGizmo flag); bool ED_gizmotypes_snap_3d_invert_snap_get(struct wmGizmo *gz); -bool ED_gizmotypes_snap_3d_is_enabled(struct wmGizmo *gz); +bool ED_gizmotypes_snap_3d_is_enabled(const struct wmGizmo *gz); short ED_gizmotypes_snap_3d_update(struct wmGizmo *gz, struct Depsgraph *depsgraph, diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index bad080e1609..59b5a1abaa6 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -189,7 +189,7 @@ bool ED_gpencil_layer_frames_looper(struct bGPDlayer *gpl, bool (*gpf_cb)(struct bGPDframe *, struct Scene *)); void ED_gpencil_layer_make_cfra_list(struct bGPDlayer *gpl, ListBase *elems, bool onlysel); -bool ED_gpencil_layer_frame_select_check(struct bGPDlayer *gpl); +bool ED_gpencil_layer_frame_select_check(const struct bGPDlayer *gpl); void ED_gpencil_layer_frame_select_set(struct bGPDlayer *gpl, short mode); void ED_gpencil_layer_frames_select_box(struct bGPDlayer *gpl, float min, @@ -364,23 +364,23 @@ void ED_gpencil_init_random_settings(struct Brush *brush, const int mval[2], struct GpRandomSettings *random_settings); -bool ED_gpencil_stroke_check_collision(struct GP_SpaceConversion *gsc, +bool ED_gpencil_stroke_check_collision(const struct GP_SpaceConversion *gsc, struct bGPDstroke *gps, const float mouse[2], const int radius, const float diff_mat[4][4]); -bool ED_gpencil_stroke_point_is_inside(struct bGPDstroke *gps, - struct GP_SpaceConversion *gsc, - int mouse[2], +bool ED_gpencil_stroke_point_is_inside(const struct bGPDstroke *gps, + const struct GP_SpaceConversion *gsc, + const int mouse[2], const float diff_mat[4][4]); -void ED_gpencil_projected_2d_bound_box(struct GP_SpaceConversion *gsc, - struct bGPDstroke *gps, +void ED_gpencil_projected_2d_bound_box(const struct GP_SpaceConversion *gsc, + const struct bGPDstroke *gps, const float diff_mat[4][4], float r_min[2], float r_max[2]); struct bGPDstroke *ED_gpencil_stroke_nearest_to_ends(struct bContext *C, - struct GP_SpaceConversion *gsc, + const struct GP_SpaceConversion *gsc, struct bGPDlayer *gpl, struct bGPDframe *gpf, struct bGPDstroke *gps, diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 08d19318d4c..0493832c06f 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -452,7 +452,7 @@ bool autokeyframe_cfra_can_key(const struct Scene *scene, struct ID *id); /* Lesser Keyframe Checking API call: * - Used for the buttons to check for keyframes... */ -bool fcurve_frame_has_keyframe(struct FCurve *fcu, float frame, short filter); +bool fcurve_frame_has_keyframe(const struct FCurve *fcu, float frame, short filter); /* Lesser Keyframe Checking API call: * - Returns whether the current value of a given property differs from the interpolated value. diff --git a/source/blender/editors/include/ED_mask.h b/source/blender/editors/include/ED_mask.h index 247911bdc55..c2fdbc160de 100644 --- a/source/blender/editors/include/ED_mask.h +++ b/source/blender/editors/include/ED_mask.h @@ -100,7 +100,7 @@ bool ED_masklayer_frames_looper(struct MaskLayer *mask_layer, struct Scene *)); void ED_masklayer_make_cfra_list(struct MaskLayer *mask_layer, ListBase *elems, bool onlysel); -bool ED_masklayer_frame_select_check(struct MaskLayer *mask_layer); +bool ED_masklayer_frame_select_check(const struct MaskLayer *mask_layer); void ED_masklayer_frame_select_set(struct MaskLayer *mask_layer, short mode); void ED_masklayer_frames_select_box(struct MaskLayer *mask_layer, float min, diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index ba65840dc99..73a1548362c 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -110,7 +110,7 @@ bool ED_node_is_geometry(struct SpaceNode *snode); void ED_node_shader_default(const struct bContext *C, struct ID *id); void ED_node_composit_default(const struct bContext *C, struct Scene *scene); void ED_node_texture_default(const struct bContext *C, struct Tex *tex); -bool ED_node_select_check(ListBase *lb); +bool ED_node_select_check(const ListBase *lb); void ED_node_select_all(ListBase *lb, int action); void ED_node_post_apply_transform(struct bContext *C, struct bNodeTree *ntree); void ED_node_set_active(struct Main *bmain, diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 1738c383328..888dcd9d428 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -62,7 +62,8 @@ struct Object *ED_object_active_context(const struct bContext *C); void ED_collection_hide_menu_draw(const struct bContext *C, struct uiLayout *layout); Object **ED_object_array_in_mode_or_selected(struct bContext *C, - bool (*filter_fn)(struct Object *ob, void *user_data), + bool (*filter_fn)(const struct Object *ob, + void *user_data), void *filter_user_data, uint *r_objects_len); @@ -387,7 +388,7 @@ void ED_object_mode_generic_exit(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob); -bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, struct Object *ob); +bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, const struct Object *ob); void ED_object_posemode_set_for_weight_paint(struct bContext *C, struct Main *bmain, diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 91a4c430023..92dd41932f2 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -3489,7 +3489,7 @@ static void widget_menubut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), /** * Draw menu buttons still with triangles when field is not embossed */ -static void widget_menubut_embossn(uiBut *UNUSED(but), +static void widget_menubut_embossn(const uiBut *UNUSED(but), uiWidgetColors *wcol, rcti *rect, int UNUSED(state), @@ -3512,7 +3512,7 @@ static void widget_menubut_embossn(uiBut *UNUSED(but), * Draw number buttons still with triangles when field is not embossed */ static void widget_numbut_embossn( - uiBut *UNUSED(but), uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) + const uiBut *UNUSED(but), uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) { widget_numbut_draw(wcol, rect, state, roundboxalign, true); } diff --git a/source/blender/editors/mask/mask_editaction.c b/source/blender/editors/mask/mask_editaction.c index 03f3f438829..d9efbef4b42 100644 --- a/source/blender/editors/mask/mask_editaction.c +++ b/source/blender/editors/mask/mask_editaction.c @@ -109,7 +109,7 @@ void ED_masklayer_make_cfra_list(MaskLayer *mask_layer, ListBase *elems, bool on /* Selection Tools */ /* check if one of the frames in this layer is selected */ -bool ED_masklayer_frame_select_check(MaskLayer *mask_layer) +bool ED_masklayer_frame_select_check(const MaskLayer *mask_layer) { MaskLayerShape *mask_layer_shape; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 36c51bcda7c..1ca967d9112 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -157,7 +157,7 @@ Object *ED_object_active_context(const bContext *C) * (assuming they need to be modified). */ Object **ED_object_array_in_mode_or_selected(bContext *C, - bool (*filter_fn)(Object *ob, void *user_data), + bool (*filter_fn)(const Object *ob, void *user_data), void *filter_user_data, uint *r_objects_len) { diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c index ed06cd2a217..36a4f002978 100644 --- a/source/blender/editors/object/object_modes.c +++ b/source/blender/editors/object/object_modes.c @@ -401,9 +401,9 @@ void ED_object_mode_generic_exit(struct Main *bmain, ed_object_mode_generic_exit_ex(bmain, depsgraph, scene, ob, false); } -bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, struct Object *ob) +bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, const struct Object *ob) { - return ed_object_mode_generic_exit_ex(NULL, depsgraph, NULL, ob, true); + return ed_object_mode_generic_exit_ex(NULL, depsgraph, NULL, (Object *)ob, true); } /** \} */ diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 51a9a3676e7..e6cde60e9aa 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -83,7 +83,7 @@ static bool vertex_group_supported_poll_ex(bContext *C, const Object *ob); /** \name Local Utility Functions * \{ */ -static bool object_array_for_wpaint_filter(Object *ob, void *user_data) +static bool object_array_for_wpaint_filter(const Object *ob, void *user_data) { bContext *C = user_data; if (vertex_group_supported_poll_ex(C, ob)) { diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 36492359d5c..ae9f80f746a 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -103,7 +103,7 @@ static bool object_materials_supported_poll_ex(bContext *C, const Object *ob); /** \name Local Utilities * \{ */ -static bool object_array_for_shading_edit_mode_enabled_filter(Object *ob, void *user_data) +static bool object_array_for_shading_edit_mode_enabled_filter(const Object *ob, void *user_data) { bContext *C = user_data; if (object_materials_supported_poll_ex(C, ob)) { @@ -120,7 +120,7 @@ static Object **object_array_for_shading_edit_mode_enabled(bContext *C, uint *r_ C, object_array_for_shading_edit_mode_enabled_filter, C, r_objects_len); } -static bool object_array_for_shading_edit_mode_disabled_filter(Object *ob, void *user_data) +static bool object_array_for_shading_edit_mode_disabled_filter(const Object *ob, void *user_data) { bContext *C = user_data; if (object_materials_supported_poll_ex(C, ob)) { diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index 4bacf319f7c..0cf47ed35fa 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -1357,9 +1357,9 @@ void NODE_OT_duplicate(wmOperatorType *ot) ot->srna, "keep_inputs", false, "Keep Inputs", "Keep the input links to duplicated nodes"); } -bool ED_node_select_check(ListBase *lb) +bool ED_node_select_check(const ListBase *lb) { - LISTBASE_FOREACH (bNode *, node, lb) { + LISTBASE_FOREACH (const bNode *, node, lb) { if (node->flag & NODE_SELECT) { return true; } diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 78fc6575e6e..7135395ee2d 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -1150,7 +1150,7 @@ int constraintModeToIndex(const TransInfo *t) } } -bool isLockConstraint(TransInfo *t) +bool isLockConstraint(const TransInfo *t) { int mode = t->con.mode; diff --git a/source/blender/editors/transform/transform_constraints.h b/source/blender/editors/transform/transform_constraints.h index cbf6c7bb576..3632b352476 100644 --- a/source/blender/editors/transform/transform_constraints.h +++ b/source/blender/editors/transform/transform_constraints.h @@ -46,5 +46,5 @@ void postSelectConstraint(TransInfo *t); void setNearestAxis(TransInfo *t); int constraintModeToIndex(const TransInfo *t); char constraintModeToChar(const TransInfo *t); -bool isLockConstraint(TransInfo *t); +bool isLockConstraint(const TransInfo *t); int getConstraintSpaceDimension(const TransInfo *t); -- cgit v1.2.3