[vlc-commits] objects: revector

Rémi Denis-Courmont git at videolan.org
Sun Mar 3 16:52:22 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Mar  3 15:14:53 2019 +0200| [c2b3bc30260061d8dd50cc62f181a98e20be12a7] | committer: Rémi Denis-Courmont

objects: revector

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c2b3bc30260061d8dd50cc62f181a98e20be12a7
---

 src/misc/objects.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/misc/objects.c b/src/misc/objects.c
index 33e03ab76b..c43a31e5c7 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -60,6 +60,12 @@ static vlc_mutex_t tree_lock = VLC_STATIC_MUTEX;
 #define vlc_children_foreach(pos, priv) \
     vlc_list_foreach(pos, &priv->children, siblings)
 
+static bool ObjectIsLastChild(vlc_object_t *obj, vlc_object_t *parent)
+{
+    return vlc_list_is_last(&vlc_internals(obj)->siblings,
+                            &vlc_internals(parent)->children);
+}
+
 static void PrintObjectPrefix(vlc_object_t *obj, bool last)
 {
     vlc_object_t *parent = vlc_object_parent(obj);
@@ -70,8 +76,7 @@ static void PrintObjectPrefix(vlc_object_t *obj, bool last)
 
     PrintObjectPrefix(parent, false);
 
-    if (vlc_list_is_last(&vlc_internals(obj)->siblings,
-                         &vlc_internals(parent)->children))
+    if (ObjectIsLastChild(obj, parent))
         str = last ? " \xE2\x94\x94" : "  ";
     else
         str = last ? " \xE2\x94\x9C" : " \xE2\x94\x82";



More information about the vlc-commits mailing list