Cleanup: shadowing (interface)
authorCampbell Barton <ideasman42@gmail.com>
Sun, 22 Nov 2015 23:01:54 +0000 (10:01 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 23 Nov 2015 06:40:55 +0000 (17:40 +1100)
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_templates.c

index 8199ce038edd566ed513093139bc5bfed547dd70..5ad8acb46ab715fbcff82d585f0ae4bc3cf5f49a 100644 (file)
@@ -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);
index c3fa26f47fd4ddfd39f19343768a780fcbd253e9..561a59b57eff1797bf2167e1bedc9cec429d6823 100644 (file)
@@ -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;
                        }
index f62cb4ee68dfae807b67e0a3ebf2780577199e44..f394240c4110f3e10a2db0769987163b6185cd65 100644 (file)
@@ -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));
                                }
                        }
                }
index c606dd67f29010afc2dd43b162e809950aaf2c9f..09422a0ebd3a6c92f85da15dc030acd637bb05e1 100644 (file)
@@ -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++;