[Bf-blender-cvs] [7cbcfb7f492] master: Cleanup: Use LISTBASE_FOREACH macro in outliner code

Nathan Craddock noreply at git.blender.org
Fri Dec 18 04:13:53 CET 2020


Commit: 7cbcfb7f492d027d415326d3b100803e949ce84a
Author: Nathan Craddock
Date:   Thu Dec 17 19:59:49 2020 -0700
Branches: master
https://developer.blender.org/rB7cbcfb7f492d027d415326d3b100803e949ce84a

Cleanup: Use LISTBASE_FOREACH macro in outliner code

No functional changes.

===================================================================

M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_edit.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 6364fbc0a87..657ada874ea 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -2928,8 +2928,6 @@ static void outliner_draw_iconrow(bContext *C,
 /* closed tree element */
 static void outliner_set_coord_tree_element(TreeElement *te, int startx, int starty)
 {
-  TreeElement *ten;
-
   /* closed items may be displayed in row of parent, don't change their coordinate! */
   if ((te->flag & TE_ICONROW) == 0 && (te->flag & TE_ICONROW_MERGED) == 0) {
     te->xs = 0;
@@ -2937,7 +2935,7 @@ static void outliner_set_coord_tree_element(TreeElement *te, int startx, int sta
     te->xend = 0;
   }
 
-  for (ten = te->subtree.first; ten; ten = ten->next) {
+  LISTBASE_FOREACH (TreeElement *, ten, &te->subtree) {
     outliner_set_coord_tree_element(ten, startx + UI_UNIT_X, starty);
   }
 }
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index a1ff6193cd0..1cb98e704f2 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -1253,8 +1253,7 @@ static void outliner_set_coordinates_element_recursive(SpaceOutliner *space_outl
   *starty -= UI_UNIT_Y;
 
   if (TSELEM_OPEN(tselem, space_outliner)) {
-    TreeElement *ten;
-    for (ten = te->subtree.first; ten; ten = ten->next) {
+    LISTBASE_FOREACH (TreeElement *, ten, &te->subtree) {
       outliner_set_coordinates_element_recursive(space_outliner, ten, startx + UI_UNIT_X, starty);
     }
   }
@@ -1753,7 +1752,7 @@ static void tree_element_to_path(TreeElement *te,
 {
   ListBase hierarchy = {NULL, NULL};
   LinkData *ld;
-  TreeElement *tem, *temnext, *temsub;
+  TreeElement *tem, *temnext;
   TreeStoreElem *tse /* , *tsenext */ /* UNUSED */;
   PointerRNA *ptr, *nextptr;
   PropertyRNA *prop;
@@ -1823,7 +1822,7 @@ static void tree_element_to_path(TreeElement *te,
             /* otherwise use index */
             int index = 0;
 
-            for (temsub = tem->subtree.first; temsub; temsub = temsub->next, index++) {
+            LISTBASE_FOREACH (TreeElement *, temsub, &tem->subtree) {
               if (temsub == temnext) {
                 break;
               }



More information about the Bf-blender-cvs mailing list