From d138cbfb47e379edc1ee915a8c6ff65b01f000d6 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 3 Apr 2020 19:15:01 +0200 Subject: 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 --- source/blender/editors/screen/screen_draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/screen/screen_draw.c') 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, -- cgit v1.2.3