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
This commit is contained in:
2020-04-03 19:15:01 +02:00
parent b0c1184875
commit d138cbfb47
207 changed files with 1174 additions and 1251 deletions

View File

@@ -3477,7 +3477,7 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op)
seqbase_clipboard_frame = scene->r.cfra;
/* Need to remove anything that references the current scene */
for (Sequence *seq = seqbase_clipboard.first; seq; seq = seq->next) {
LISTBASE_FOREACH (Sequence *, seq, &seqbase_clipboard) {
seq_copy_del_sound(scene, seq);
}

View File

@@ -962,7 +962,7 @@ static int sequencer_select_side_exec(bContext *C, wmOperator *op)
copy_vn_i(frame_ranges, ARRAY_SIZE(frame_ranges), frame_init);
for (Sequence *seq = ed->seqbasep->first; seq; seq = seq->next) {
LISTBASE_FOREACH (Sequence *, seq, ed->seqbasep) {
if (UNLIKELY(seq->machine >= MAXSEQ)) {
continue;
}
@@ -1037,7 +1037,7 @@ static int sequencer_box_select_exec(bContext *C, wmOperator *op)
WM_operator_properties_border_to_rctf(op, &rectf);
UI_view2d_region_to_view_rctf(v2d, &rectf, &rectf);
for (Sequence *seq = ed->seqbasep->first; seq; seq = seq->next) {
LISTBASE_FOREACH (Sequence *, seq, ed->seqbasep) {
rctf rq;
seq_rectf(seq, &rq);
if (BLI_rctf_isect(&rq, &rectf, NULL)) {