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/armature/armature_utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/armature/armature_utils.c') diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c index fe456324d9c..cf7f6699e5e 100644 --- a/source/blender/editors/armature/armature_utils.c +++ b/source/blender/editors/armature/armature_utils.c @@ -92,7 +92,7 @@ void ED_armature_edit_validate_active(struct bArmature *arm) void ED_armature_edit_refresh_layer_used(bArmature *arm) { arm->layer_used = 0; - for (EditBone *ebo = arm->edbo->first; ebo; ebo = ebo->next) { + LISTBASE_FOREACH (EditBone *, ebo, arm->edbo) { arm->layer_used |= ebo->layer; } } @@ -142,7 +142,7 @@ void bone_free(bArmature *arm, EditBone *bone) } /* Clear references from other edit bones. */ - for (EditBone *ebone = arm->edbo->first; ebone; ebone = ebone->next) { + LISTBASE_FOREACH (EditBone *, ebone, arm->edbo) { if (ebone->bbone_next == bone) { ebone->bbone_next = NULL; } @@ -472,7 +472,7 @@ void ED_armature_ebone_transform_mirror_update(bArmature *arm, EditBone *ebo, bo void ED_armature_edit_transform_mirror_update(Object *obedit) { bArmature *arm = obedit->data; - for (EditBone *ebo = arm->edbo->first; ebo; ebo = ebo->next) { + LISTBASE_FOREACH (EditBone *, ebo, arm->edbo) { ED_armature_ebone_transform_mirror_update(arm, ebo, true); } } @@ -580,7 +580,7 @@ static EditBone *make_boneList_recursive(ListBase *edbo, static EditBone *find_ebone_link(ListBase *edbo, Bone *link) { if (link != NULL) { - for (EditBone *ebone = edbo->first; ebone; ebone = ebone->next) { + LISTBASE_FOREACH (EditBone *, ebone, edbo) { if (ebone->temp.bone == link) { return ebone; } @@ -596,7 +596,7 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, struct Bone *actBone) EditBone *active = make_boneList_recursive(edbo, bones, NULL, actBone); - for (EditBone *ebone = edbo->first; ebone; ebone = ebone->next) { + LISTBASE_FOREACH (EditBone *, ebone, edbo) { Bone *bone = ebone->temp.bone; /* Convert custom B-Bone handle links. */ -- cgit v1.2.3