diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-11-23 02:01:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-11-23 09:40:55 +0300 |
commit | 64ab45213166b62d177e4e0f831a0b84ec2c463b (patch) | |
tree | 67f22f9a7054c355fdfb5716641d437976d76508 /source/blender | |
parent | 48b1656a6cce6fd7606a671eea9d0d17b67d7445 (diff) |
Cleanup: shadowing (interface)
Diffstat (limited to 'source/blender')
4 files changed, 13 insertions, 16 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 8199ce038ed..5ad8acb46ab 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2827,10 +2827,11 @@ void ui_but_update(uiBut *but) /* only needed for menus in popup blocks that don't recreate buttons on redraw */ if (but->block->flag & UI_BLOCK_LOOP) { if (but->rnaprop && (RNA_property_type(but->rnaprop) == PROP_ENUM)) { - int value = RNA_property_enum_get(&but->rnapoin, but->rnaprop); + int value_enum = RNA_property_enum_get(&but->rnapoin, but->rnaprop); const char *buf; - if (RNA_property_enum_name_gettexted(but->block->evil_C, - &but->rnapoin, but->rnaprop, value, &buf)) + if (RNA_property_enum_name_gettexted( + but->block->evil_C, + &but->rnapoin, but->rnaprop, value_enum, &buf)) { size_t slen = strlen(buf); ui_but_string_free_internal(but); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index c3fa26f47fd..561a59b57ef 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -8223,7 +8223,6 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but) case MOUSEMOVE: if (ELEM(but->type, UI_BTYPE_LINK, UI_BTYPE_INLINK)) { - ARegion *ar = data->region; but->flag |= UI_SELECT; ui_do_button(C, block, but, event); ED_region_tag_redraw(ar); @@ -9376,7 +9375,6 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle { ARegion *ar; uiBlock *block; - uiBut *but; float event_xy[2]; double duration; bool is_click_style; @@ -9420,7 +9418,6 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle /* handle animation */ if (!(block->pie_data.flags & UI_PIE_ANIMATION_FINISHED)) { - uiBut *but; double final_time = 0.01 * U.pie_animation_timeout; float fac = duration / final_time; float pie_radius = U.pie_menu_radius * UI_DPI_FAC; @@ -9430,7 +9427,7 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle block->pie_data.flags |= UI_PIE_ANIMATION_FINISHED; } - for (but = block->buttons.first; but; but = but->next) { + for (uiBut *but = block->buttons.first; but; but = but->next) { if (but->pie_dir != UI_RADIAL_NONE) { float vec[2]; float center[2]; @@ -9585,7 +9582,7 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle if ((event->val == KM_PRESS || event->val == KM_DBL_CLICK) && !IS_EVENT_MOD(event, shift, ctrl, oskey)) { - for (but = block->buttons.first; but; but = but->next) { + for (uiBut *but = block->buttons.first; but; but = but->next) { if (but->menu_key == event->type) { ui_but_pie_button_activate(C, but, menu); } @@ -9607,7 +9604,7 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle CASE_NUM_TO_DIR(8, UI_RADIAL_N); CASE_NUM_TO_DIR(9, UI_RADIAL_NE); { - but = ui_block_pie_dir_activate(block, event, num_dir); + uiBut *but = ui_block_pie_dir_activate(block, event, num_dir); retval = ui_but_pie_button_activate(C, but, menu); break; } diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index f62cb4ee68d..f394240c411 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1765,7 +1765,6 @@ uiBlock *ui_popup_block_refresh( } if (block->flag & UI_BLOCK_RADIAL) { - uiBut *but; int win_width = UI_SCREEN_MARGIN; int winx, winy; @@ -1807,9 +1806,9 @@ uiBlock *ui_popup_block_refresh( /* lastly set the buttons at the center of the pie menu, ready for animation */ if (U.pie_animation_timeout > 0) { - for (but = block->buttons.first; but; but = but->next) { - if (but->pie_dir != UI_RADIAL_NONE) { - BLI_rctf_recenter(&but->rect, UNPACK2(block->pie_data.pie_center_spawned)); + for (uiBut *but_iter = block->buttons.first; but_iter; but_iter = but_iter->next) { + if (but_iter->pie_dir != UI_RADIAL_NONE) { + BLI_rctf_recenter(&but_iter->rect, UNPACK2(block->pie_data.pie_center_spawned)); } } } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index c606dd67f29..09422a0ebd3 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2418,15 +2418,15 @@ void uiTemplatePalette(uiLayout *layout, PointerRNA *ptr, const char *propname, uiLayoutRow(col, true); for (; color; color = color->next) { - PointerRNA ptr; + PointerRNA color_ptr; if (row_cols >= cols_per_row) { uiLayoutRow(col, true); row_cols = 0; } - RNA_pointer_create(&palette->id, &RNA_PaletteColor, color, &ptr); - uiDefButR(block, UI_BTYPE_COLOR, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, &ptr, "color", -1, 0.0, 1.0, + RNA_pointer_create(&palette->id, &RNA_PaletteColor, color, &color_ptr); + uiDefButR(block, UI_BTYPE_COLOR, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, &color_ptr, "color", -1, 0.0, 1.0, UI_PALETTE_COLOR, col_id, ""); row_cols++; col_id++; |