diff options
author | Dalai Felinto <dalai@blender.org> | 2020-04-03 20:15:01 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2020-04-03 20:27:46 +0300 |
commit | d138cbfb47e379edc1ee915a8c6ff65b01f000d6 (patch) | |
tree | f4773ecce897c32eaf75295dd5f6a8e730d471ed /source/blender/editors/screen/screen_draw.c | |
parent | b0c1184875d39abac4a65a5d20e263ea6d841009 (diff) |
Code Quality: Replace for loops with LISTBASE_FOREACH
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
Diffstat (limited to 'source/blender/editors/screen/screen_draw.c')
-rw-r--r-- | source/blender/editors/screen/screen_draw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c index c1b6df07129..2452302561b 100644 --- a/source/blender/editors/screen/screen_draw.c +++ b/source/blender/editors/screen/screen_draw.c @@ -547,7 +547,7 @@ static void screen_preview_scale_get( { float max_x = 0, max_y = 0; - for (ScrArea *area = screen->areabase.first; area; area = area->next) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { max_x = MAX2(max_x, area->totrct.xmax); max_y = MAX2(max_y, area->totrct.ymax); } @@ -566,7 +566,7 @@ static void screen_preview_draw_areas(const bScreen *screen, immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(col); - for (ScrArea *area = screen->areabase.first; area; area = area->next) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { rctf rect = { .xmin = area->totrct.xmin * scale[0] + ofs_h, .xmax = area->totrct.xmax * scale[0] - ofs_h, |