diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-02-04 13:53:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-02-04 14:21:10 +0300 |
commit | 3be5859b21950ed5f5949fce803cf8cbe68dcf99 (patch) | |
tree | d17c63c3db09b6e6c6e4574e3b24de51172172a2 /source/blender/editors/transform | |
parent | dff51d418a6499a9e90adc97ab2bb599de36a860 (diff) |
Cleanup: pass keymap items as const where possible
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_mode_edge_seq_slide.c | 6 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_mode_shrink_fatten.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/transform/transform_mode_edge_seq_slide.c b/source/blender/editors/transform/transform_mode_edge_seq_slide.c index 7ccfd0149bd..dd212af7caf 100644 --- a/source/blender/editors/transform/transform_mode_edge_seq_slide.c +++ b/source/blender/editors/transform/transform_mode_edge_seq_slide.c @@ -49,7 +49,7 @@ static eRedrawFlag seq_slide_handleEvent(struct TransInfo *t, const wmEvent *event) { BLI_assert(t->mode == TFM_SEQ_SLIDE); - wmKeyMapItem *kmi = t->custom.mode.data; + const wmKeyMapItem *kmi = t->custom.mode.data; if (kmi && event->type == kmi->type && event->val == kmi->val) { /* Allows the 'Expand to fit' effect to be enabled as a toogle. */ t->flag ^= T_ALT_TRANSFORM; @@ -73,7 +73,7 @@ static void headerSeqSlide(TransInfo *t, const float val[2], char str[UI_MAX_DRA ofs += BLI_snprintf( str + ofs, UI_MAX_DRAW_STR - ofs, TIP_("Sequence Slide: %s%s, ("), &tvec[0], t->con.text); - wmKeyMapItem *kmi = t->custom.mode.data; + const wmKeyMapItem *kmi = t->custom.mode.data; if (kmi) { ofs += WM_keymap_item_to_string(kmi, false, str + ofs, UI_MAX_DRAW_STR - ofs); } @@ -158,7 +158,7 @@ void initSeqSlide(TransInfo *t) if (t->keymap) { /* Workaround to use the same key as the modal keymap. */ - t->custom.mode.data = WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_TRANSLATE); + t->custom.mode.data = (void *)WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_TRANSLATE); } } /** \} */ diff --git a/source/blender/editors/transform/transform_mode_shrink_fatten.c b/source/blender/editors/transform/transform_mode_shrink_fatten.c index 2a5c631df41..bccf4db66af 100644 --- a/source/blender/editors/transform/transform_mode_shrink_fatten.c +++ b/source/blender/editors/transform/transform_mode_shrink_fatten.c @@ -49,7 +49,7 @@ static eRedrawFlag shrinkfatten_handleEvent(struct TransInfo *t, const wmEvent *event) { BLI_assert(t->mode == TFM_SHRINKFATTEN); - wmKeyMapItem *kmi = t->custom.mode.data; + const wmKeyMapItem *kmi = t->custom.mode.data; if (kmi && event->type == kmi->type && event->val == kmi->val) { /* Allows the 'Even Thickness' effect to be enabled as a toogle. */ t->flag ^= T_ALT_TRANSFORM; @@ -90,7 +90,7 @@ static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) } ofs += BLI_strncpy_rlen(str + ofs, ", (", sizeof(str) - ofs); - wmKeyMapItem *kmi = t->custom.mode.data; + const wmKeyMapItem *kmi = t->custom.mode.data; if (kmi) { ofs += WM_keymap_item_to_string(kmi, false, str + ofs, sizeof(str) - ofs); } @@ -150,7 +150,7 @@ void initShrinkFatten(TransInfo *t) if (t->keymap) { /* Workaround to use the same key as the modal keymap. */ - t->custom.mode.data = WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_RESIZE); + t->custom.mode.data = (void *)WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_RESIZE); } } } |