diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-30 09:37:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-30 09:42:19 +0300 |
commit | 501d2443d03cce18985fab3ffad5d23238748f3e (patch) | |
tree | 1d127d4e4c6d82fc85feedc9826dd5619174e346 /source/blender/blenkernel | |
parent | df9597cfba78deb40009553ab9dcf09c21edd434 (diff) |
Cleanup: use const arguments for accessor functions
Diffstat (limited to 'source/blender/blenkernel')
22 files changed, 60 insertions, 55 deletions
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index 07b7aa2ec50..86aa18e5739 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -151,7 +151,7 @@ typedef struct PoseTree { struct bArmature *BKE_armature_add(struct Main *bmain, const char *name); struct bArmature *BKE_armature_from_object(struct Object *ob); -int BKE_armature_bonelist_count(struct ListBase *lb); +int BKE_armature_bonelist_count(const struct ListBase *lb); void BKE_armature_bonelist_free(struct ListBase *lb, const bool do_id_user); void BKE_armature_editbonelist_free(struct ListBase *lb, const bool do_id_user); diff --git a/source/blender/blenkernel/BKE_collection.h b/source/blender/blenkernel/BKE_collection.h index 7963d54126e..f47cdf32ca0 100644 --- a/source/blender/blenkernel/BKE_collection.h +++ b/source/blender/blenkernel/BKE_collection.h @@ -164,7 +164,8 @@ bool BKE_collection_move(struct Main *bmain, bool BKE_collection_cycle_find(struct Collection *new_ancestor, struct Collection *collection); bool BKE_collection_cycles_fix(struct Main *bmain, struct Collection *collection); -bool BKE_collection_has_collection(struct Collection *parent, struct Collection *collection); +bool BKE_collection_has_collection(const struct Collection *parent, + const struct Collection *collection); void BKE_collection_parent_relations_rebuild(struct Collection *collection); void BKE_main_collections_parent_relations_rebuild(struct Main *bmain); diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index ed2d9d4507f..f494c2e30cc 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -227,9 +227,9 @@ struct FCurve *BKE_fcurve_find_by_rna_context_ui(struct bContext *C, /* Binary search algorithm for finding where to 'insert' BezTriple with given frame number. * Returns the index to insert at (data already at that index will be offset if replace is 0) */ -int BKE_fcurve_bezt_binarysearch_index(struct BezTriple array[], - float frame, - int arraylen, +int BKE_fcurve_bezt_binarysearch_index(const struct BezTriple array[], + const float frame, + const int arraylen, bool *r_replace); /* fcurve_cache.c */ diff --git a/source/blender/blenkernel/BKE_gpencil_geom.h b/source/blender/blenkernel/BKE_gpencil_geom.h index 8fc3ce133a0..c1ccae7a437 100644 --- a/source/blender/blenkernel/BKE_gpencil_geom.h +++ b/source/blender/blenkernel/BKE_gpencil_geom.h @@ -90,7 +90,7 @@ typedef struct GPencilPointCoordinates { float pressure; } GPencilPointCoordinates; -int BKE_gpencil_stroke_point_count(struct bGPdata *gpd); +int BKE_gpencil_stroke_point_count(const struct bGPdata *gpd); void BKE_gpencil_point_coords_get(struct bGPdata *gpd, GPencilPointCoordinates *elem_data); void BKE_gpencil_point_coords_apply(struct bGPdata *gpd, const GPencilPointCoordinates *elem_data); void BKE_gpencil_point_coords_apply_with_mat4(struct bGPdata *gpd, diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h index c969ce07d74..58b8d19abaa 100644 --- a/source/blender/blenkernel/BKE_key.h +++ b/source/blender/blenkernel/BKE_key.h @@ -76,7 +76,7 @@ void BKE_keyblock_update_from_lattice(struct Lattice *lt, struct KeyBlock *kb); void BKE_keyblock_convert_from_lattice(struct Lattice *lt, struct KeyBlock *kb); void BKE_keyblock_convert_to_lattice(struct KeyBlock *kb, struct Lattice *lt); -int BKE_keyblock_curve_element_count(struct ListBase *nurb); +int BKE_keyblock_curve_element_count(const struct ListBase *nurb); void BKE_keyblock_curve_data_transform(const struct ListBase *nurb, const float mat[4][4], const void *src, diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h index 240d6cb18ec..404f344919c 100644 --- a/source/blender/blenkernel/BKE_layer.h +++ b/source/blender/blenkernel/BKE_layer.h @@ -92,7 +92,7 @@ bool BKE_layer_collection_activate(struct ViewLayer *view_layer, struct LayerCol struct LayerCollection *BKE_layer_collection_activate_parent(struct ViewLayer *view_layer, struct LayerCollection *lc); -int BKE_layer_collection_count(struct ViewLayer *view_layer); +int BKE_layer_collection_count(const struct ViewLayer *view_layer); struct LayerCollection *BKE_layer_collection_from_index(struct ViewLayer *view_layer, const int index); @@ -107,8 +107,8 @@ void BKE_layer_collection_local_sync_all(const struct Main *bmain); void BKE_main_collection_sync_remap(const struct Main *bmain); struct LayerCollection *BKE_layer_collection_first_from_scene_collection( - struct ViewLayer *view_layer, const struct Collection *collection); -bool BKE_view_layer_has_collection(struct ViewLayer *view_layer, + const struct ViewLayer *view_layer, const struct Collection *collection); +bool BKE_view_layer_has_collection(const struct ViewLayer *view_layer, const struct Collection *collection); bool BKE_scene_has_object(struct Scene *scene, struct Object *ob); @@ -367,7 +367,7 @@ void BKE_view_layer_visible_bases_iterator_end(BLI_Iterator *iter); struct ObjectsInViewLayerParams { uint no_dup_data : 1; - bool (*filter_fn)(struct Object *ob, void *user_data); + bool (*filter_fn)(const struct Object *ob, void *user_data); void *filter_userdata; }; @@ -388,7 +388,7 @@ struct ObjectsInModeParams { int object_mode; uint no_dup_data : 1; - bool (*filter_fn)(struct Object *ob, void *user_data); + bool (*filter_fn)(const struct Object *ob, void *user_data); void *filter_userdata; }; @@ -412,8 +412,8 @@ struct Object **BKE_view_layer_array_from_objects_in_mode_params( BKE_view_layer_array_from_bases_in_mode_params( \ view_layer, v3d, r_len, &(const struct ObjectsInModeParams)__VA_ARGS__) -bool BKE_view_layer_filter_edit_mesh_has_uvs(struct Object *ob, void *user_data); -bool BKE_view_layer_filter_edit_mesh_has_edges(struct Object *ob, void *user_data); +bool BKE_view_layer_filter_edit_mesh_has_uvs(const struct Object *ob, void *user_data); +bool BKE_view_layer_filter_edit_mesh_has_edges(const struct Object *ob, void *user_data); /* Utility macros that wrap common args (add more as needed). */ diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h index 0fa44067b16..97e5698d6f9 100644 --- a/source/blender/blenkernel/BKE_pbvh.h +++ b/source/blender/blenkernel/BKE_pbvh.h @@ -474,7 +474,7 @@ bool BKE_pbvh_node_vert_update_check_any(PBVH *pbvh, PBVHNode *node); // void BKE_pbvh_node_BB_reset(PBVHNode *node); // void BKE_pbvh_node_BB_expand(PBVHNode *node, float co[3]); -bool pbvh_has_mask(PBVH *pbvh); +bool pbvh_has_mask(const PBVH *pbvh); void pbvh_show_mask_set(PBVH *pbvh, bool show_mask); bool pbvh_has_face_sets(PBVH *pbvh); diff --git a/source/blender/blenkernel/BKE_shader_fx.h b/source/blender/blenkernel/BKE_shader_fx.h index 7e3783a3ee9..8d1fe709355 100644 --- a/source/blender/blenkernel/BKE_shader_fx.h +++ b/source/blender/blenkernel/BKE_shader_fx.h @@ -172,7 +172,7 @@ void BKE_shaderfx_copydata_ex(struct ShaderFxData *fx, void BKE_shaderfx_copy(struct ListBase *dst, const struct ListBase *src); void BKE_shaderfx_foreach_ID_link(struct Object *ob, ShaderFxIDWalkFunc walk, void *userData); -bool BKE_shaderfx_has_gpencil(struct Object *ob); +bool BKE_shaderfx_has_gpencil(const struct Object *ob); void BKE_shaderfx_blend_write(struct BlendWriter *writer, struct ListBase *fxbase); void BKE_shaderfx_blend_read_data(struct BlendDataReader *reader, struct ListBase *lb); diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h index 26351ee65c2..c7120c60020 100644 --- a/source/blender/blenkernel/BKE_text.h +++ b/source/blender/blenkernel/BKE_text.h @@ -48,7 +48,7 @@ char *txt_to_buf(struct Text *text, int *r_buf_strlen); void txt_clean_text(struct Text *text); void txt_order_cursors(struct Text *text, const bool reverse); int txt_find_string(struct Text *text, const char *findstr, int wrap, int match_case); -bool txt_has_sel(struct Text *text); +bool txt_has_sel(const struct Text *text); int txt_get_span(struct TextLine *from, struct TextLine *to); void txt_move_up(struct Text *text, const bool sel); void txt_move_down(struct Text *text, const bool sel); @@ -85,8 +85,8 @@ bool txt_uncomment(struct Text *text); void txt_move_lines(struct Text *text, const int direction); void txt_duplicate_line(struct Text *text); int txt_setcurr_tab_spaces(struct Text *text, int space); -bool txt_cursor_is_line_start(struct Text *text); -bool txt_cursor_is_line_end(struct Text *text); +bool txt_cursor_is_line_start(const struct Text *text); +bool txt_cursor_is_line_end(const struct Text *text); int txt_calc_tab_left(struct TextLine *tl, int ch); int txt_calc_tab_right(struct TextLine *tl, int ch); diff --git a/source/blender/blenkernel/BKE_undo_system.h b/source/blender/blenkernel/BKE_undo_system.h index 620496864f5..efac5d9097f 100644 --- a/source/blender/blenkernel/BKE_undo_system.h +++ b/source/blender/blenkernel/BKE_undo_system.h @@ -178,7 +178,7 @@ UndoStack *BKE_undosys_stack_create(void); void BKE_undosys_stack_destroy(UndoStack *ustack); void BKE_undosys_stack_clear(UndoStack *ustack); void BKE_undosys_stack_clear_active(UndoStack *ustack); -bool BKE_undosys_stack_has_undo(UndoStack *ustack, const char *name); +bool BKE_undosys_stack_has_undo(const UndoStack *ustack, const char *name); void BKE_undosys_stack_init_from_main(UndoStack *ustack, struct Main *bmain); void BKE_undosys_stack_init_from_context(UndoStack *ustack, struct bContext *C); UndoStep *BKE_undosys_stack_active_with_type(UndoStack *ustack, const UndoType *ut); diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 5799f82bf94..d0604f4bfda 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -358,7 +358,7 @@ bArmature *BKE_armature_from_object(Object *ob) return NULL; } -int BKE_armature_bonelist_count(ListBase *lb) +int BKE_armature_bonelist_count(const ListBase *lb) { int i = 0; LISTBASE_FOREACH (Bone *, bone, lb) { diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index fdffe7dca57..24266dc6bea 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -79,7 +79,8 @@ static bool collection_object_remove(Main *bmain, static CollectionChild *collection_find_child(Collection *parent, Collection *collection); static CollectionParent *collection_find_parent(Collection *child, Collection *collection); -static bool collection_find_child_recursive(Collection *parent, Collection *collection); +static bool collection_find_child_recursive(const Collection *parent, + const Collection *collection); /** \} */ @@ -1521,9 +1522,9 @@ static CollectionChild *collection_find_child(Collection *parent, Collection *co return BLI_findptr(&parent->children, collection, offsetof(CollectionChild, collection)); } -static bool collection_find_child_recursive(Collection *parent, Collection *collection) +static bool collection_find_child_recursive(const Collection *parent, const Collection *collection) { - LISTBASE_FOREACH (CollectionChild *, child, &parent->children) { + LISTBASE_FOREACH (const CollectionChild *, child, &parent->children) { if (child->collection == collection) { return true; } @@ -1536,7 +1537,7 @@ static bool collection_find_child_recursive(Collection *parent, Collection *coll return false; } -bool BKE_collection_has_collection(Collection *parent, Collection *collection) +bool BKE_collection_has_collection(const Collection *parent, const Collection *collection) { return collection_find_child_recursive(parent, collection); } diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 18dac2fb679..7fe7b38e120 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -510,8 +510,11 @@ FCurve *BKE_fcurve_find_by_rna_context_ui(bContext *C, * with optional argument for precision required. * Returns the index to insert at (data already at that index will be offset if replace is 0) */ -static int BKE_fcurve_bezt_binarysearch_index_ex( - BezTriple array[], float frame, int arraylen, float threshold, bool *r_replace) +static int BKE_fcurve_bezt_binarysearch_index_ex(const BezTriple array[], + const float frame, + const int arraylen, + const float threshold, + bool *r_replace) { int start = 0, end = arraylen; int loopbreaker = 0, maxloop = arraylen * 2; @@ -597,9 +600,9 @@ static int BKE_fcurve_bezt_binarysearch_index_ex( /* Binary search algorithm for finding where to insert BezTriple. (for use by insert_bezt_fcurve) * Returns the index to insert at (data already at that index will be offset if replace is 0) */ -int BKE_fcurve_bezt_binarysearch_index(BezTriple array[], - float frame, - int arraylen, +int BKE_fcurve_bezt_binarysearch_index(const BezTriple array[], + const float frame, + const int arraylen, bool *r_replace) { /* This is just a wrapper which uses the default threshold. */ diff --git a/source/blender/blenkernel/intern/gpencil_geom.c b/source/blender/blenkernel/intern/gpencil_geom.c index 2b16bbb10b2..53939da08e2 100644 --- a/source/blender/blenkernel/intern/gpencil_geom.c +++ b/source/blender/blenkernel/intern/gpencil_geom.c @@ -2616,7 +2616,7 @@ void BKE_gpencil_transform(bGPdata *gpd, const float mat[4][4]) } /* Used for "move only origins" in object_data_transform.c */ -int BKE_gpencil_stroke_point_count(bGPdata *gpd) +int BKE_gpencil_stroke_point_count(const bGPdata *gpd) { int total_points = 0; @@ -2624,7 +2624,7 @@ int BKE_gpencil_stroke_point_count(bGPdata *gpd) return 0; } - LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { + LISTBASE_FOREACH (const bGPDlayer *, gpl, &gpd->layers) { /* FIXME: For now, we just skip parented layers. * Otherwise, we have to update each frame to find * the current parent position/effects. @@ -2633,7 +2633,7 @@ int BKE_gpencil_stroke_point_count(bGPdata *gpd) continue; } - LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { + LISTBASE_FOREACH (const bGPDframe *, gpf, &gpl->frames) { LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { total_points += gps->totpoints; } diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 073276b7011..1a988e687db 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -2048,9 +2048,9 @@ void BKE_keyblock_convert_to_lattice(KeyBlock *kb, Lattice *lt) /************************* Curve ************************/ -int BKE_keyblock_curve_element_count(ListBase *nurb) +int BKE_keyblock_curve_element_count(const ListBase *nurb) { - Nurb *nu; + const Nurb *nu; int tot = 0; nu = nurb->first; diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 1edf83b6685..d49eb0d4da8 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -676,10 +676,10 @@ LayerCollection *BKE_layer_collection_activate_parent(ViewLayer *view_layer, Lay /** * Recursively get the count of collections */ -static int collection_count(ListBase *lb) +static int collection_count(const ListBase *lb) { int i = 0; - LISTBASE_FOREACH (LayerCollection *, lc, lb) { + LISTBASE_FOREACH (const LayerCollection *, lc, lb) { i += collection_count(&lc->layer_collections) + 1; } return i; @@ -689,7 +689,7 @@ static int collection_count(ListBase *lb) * Get the total number of collections * (including all the nested collections) */ -int BKE_layer_collection_count(ViewLayer *view_layer) +int BKE_layer_collection_count(const ViewLayer *view_layer) { return collection_count(&view_layer->layer_collections); } @@ -1504,7 +1504,7 @@ static LayerCollection *find_layer_collection_by_scene_collection(LayerCollectio /** * Return the first matching LayerCollection in the ViewLayer for the Collection. */ -LayerCollection *BKE_layer_collection_first_from_scene_collection(ViewLayer *view_layer, +LayerCollection *BKE_layer_collection_first_from_scene_collection(const ViewLayer *view_layer, const Collection *collection) { LISTBASE_FOREACH (LayerCollection *, layer_collection, &view_layer->layer_collections) { @@ -1520,7 +1520,7 @@ LayerCollection *BKE_layer_collection_first_from_scene_collection(ViewLayer *vie /** * See if view layer has the scene collection linked directly, or indirectly (nested) */ -bool BKE_view_layer_has_collection(ViewLayer *view_layer, const Collection *collection) +bool BKE_view_layer_has_collection(const ViewLayer *view_layer, const Collection *collection) { return BKE_layer_collection_first_from_scene_collection(view_layer, collection) != NULL; } diff --git a/source/blender/blenkernel/intern/layer_utils.c b/source/blender/blenkernel/intern/layer_utils.c index 974a5a24e8a..10ab0a06dd0 100644 --- a/source/blender/blenkernel/intern/layer_utils.c +++ b/source/blender/blenkernel/intern/layer_utils.c @@ -164,11 +164,11 @@ Object **BKE_view_layer_array_from_objects_in_mode_params(ViewLayer *view_layer, /** \name Filter Functions * \{ */ -bool BKE_view_layer_filter_edit_mesh_has_uvs(Object *ob, void *UNUSED(user_data)) +bool BKE_view_layer_filter_edit_mesh_has_uvs(const Object *ob, void *UNUSED(user_data)) { if (ob->type == OB_MESH) { - Mesh *me = ob->data; - BMEditMesh *em = me->edit_mesh; + const Mesh *me = ob->data; + const BMEditMesh *em = me->edit_mesh; if (em != NULL) { if (CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV) != -1) { return true; @@ -178,11 +178,11 @@ bool BKE_view_layer_filter_edit_mesh_has_uvs(Object *ob, void *UNUSED(user_data) return false; } -bool BKE_view_layer_filter_edit_mesh_has_edges(Object *ob, void *UNUSED(user_data)) +bool BKE_view_layer_filter_edit_mesh_has_edges(const Object *ob, void *UNUSED(user_data)) { if (ob->type == OB_MESH) { - Mesh *me = ob->data; - BMEditMesh *em = me->edit_mesh; + const Mesh *me = ob->data; + const BMEditMesh *em = me->edit_mesh; if (em != NULL) { if (em->bm->totedge != 0) { return true; diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 9f316ec60c0..0d84022da77 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -2985,7 +2985,7 @@ void pbvh_vertex_iter_init(PBVH *pbvh, PBVHNode *node, PBVHVertexIter *vi, int m } } -bool pbvh_has_mask(PBVH *pbvh) +bool pbvh_has_mask(const PBVH *pbvh) { switch (pbvh->type) { case PBVH_GRIDS: diff --git a/source/blender/blenkernel/intern/shader_fx.c b/source/blender/blenkernel/intern/shader_fx.c index 60f0b744e59..b537bdc5479 100644 --- a/source/blender/blenkernel/intern/shader_fx.c +++ b/source/blender/blenkernel/intern/shader_fx.c @@ -58,9 +58,9 @@ static ShaderFxTypeInfo *shader_fx_types[NUM_SHADER_FX_TYPES] = {NULL}; /* Methods - Evaluation Loops, etc. */ /* check if exist grease pencil effects */ -bool BKE_shaderfx_has_gpencil(Object *ob) +bool BKE_shaderfx_has_gpencil(const Object *ob) { - ShaderFxData *fx; + const ShaderFxData *fx; for (fx = ob->shader_fx.first; fx; fx = fx->next) { const ShaderFxTypeInfo *fxi = BKE_shaderfx_get_info(fx->type); if (fxi->type == eShaderFxType_GpencilType) { diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 123843c88db..9d871777c61 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -3205,7 +3205,7 @@ void sbObjectToSoftbody(Object *ob) free_softbody_intern(ob->soft); } -static bool object_has_edges(Object *ob) +static bool object_has_edges(const Object *ob) { if (ob->type == OB_MESH) { return ((Mesh *)ob->data)->totedge; diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 27f5593c2ca..74845e3f1b9 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -781,12 +781,12 @@ static void txt_curs_sel(Text *text, TextLine ***linep, int **charp) *charp = &text->selc; } -bool txt_cursor_is_line_start(Text *text) +bool txt_cursor_is_line_start(const Text *text) { return (text->selc == 0); } -bool txt_cursor_is_line_end(Text *text) +bool txt_cursor_is_line_end(const Text *text) { return (text->selc == text->sell->len); } @@ -1239,7 +1239,7 @@ void txt_order_cursors(Text *text, const bool reverse) } } -bool txt_has_sel(Text *text) +bool txt_has_sel(const Text *text) { return ((text->curl != text->sell) || (text->curc != text->selc)); } diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c index 377802f1af7..14dd286a315 100644 --- a/source/blender/blenkernel/intern/undo_system.c +++ b/source/blender/blenkernel/intern/undo_system.c @@ -368,10 +368,10 @@ void BKE_undosys_stack_init_from_context(UndoStack *ustack, bContext *C) } /* name optional */ -bool BKE_undosys_stack_has_undo(UndoStack *ustack, const char *name) +bool BKE_undosys_stack_has_undo(const UndoStack *ustack, const char *name) { if (name) { - UndoStep *us = BLI_rfindstring(&ustack->steps, name, offsetof(UndoStep, name)); + const UndoStep *us = BLI_rfindstring(&ustack->steps, name, offsetof(UndoStep, name)); return us && us->prev; } |