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/space_nla/nla_draw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_nla/nla_draw.c') diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 5a59ba6b553..5c4ccd96534 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -150,7 +150,7 @@ static void nla_action_draw_keyframes( /* - disregard the selection status of keyframes so they draw a certain way * - size is 6.0f which is smaller than the editable keyframes, so that there is a distinction */ - for (ActKeyColumn *ak = keys.first; ak; ak = ak->next) { + LISTBASE_FOREACH (ActKeyColumn *, ak, &keys) { draw_keyframe_shape(ak->cfra, y, 6.0f, @@ -207,7 +207,7 @@ static void nla_actionclip_draw_markers( immUniformThemeColorShade(TH_STRIP_SELECT, shade); immBeginAtMost(GPU_PRIM_LINES, BLI_listbase_count(&act->markers) * 2); - for (TimeMarker *marker = act->markers.first; marker; marker = marker->next) { + LISTBASE_FOREACH (TimeMarker *, marker, &act->markers) { if ((marker->frame > strip->actstart) && (marker->frame < strip->actend)) { float frame = nlastrip_get_frame(strip, marker->frame, NLATIME_CONVERT_MAP); @@ -238,7 +238,7 @@ static void nla_strip_draw_markers(NlaStrip *strip, float yminc, float ymaxc) /* just a solid color, so that it is very easy to spot */ int shade = 20; /* draw the markers in the first level of strips only (if they are actions) */ - for (NlaStrip *nls = strip->strips.first; nls; nls = nls->next) { + LISTBASE_FOREACH (NlaStrip *, nls, &strip->strips) { if (nls->type == NLASTRIP_TYPE_CLIP) { nla_actionclip_draw_markers(nls, yminc, ymaxc, shade, false); } @@ -565,7 +565,7 @@ static void nla_draw_strip(SpaceNla *snla, immBeginAtMost(GPU_PRIM_LINES, 4 * BLI_listbase_count(&strip->strips)); /* only draw first-level of child-strips, but don't draw any lines on the endpoints */ - for (NlaStrip *cs = strip->strips.first; cs; cs = cs->next) { + LISTBASE_FOREACH (NlaStrip *, cs, &strip->strips) { /* draw start-line if not same as end of previous (and only if not the first strip) * - on upper half of strip */ -- cgit v1.2.3