[vlc-commits] vlc_list_children: use vlc_value_t.p_address, not .p_object
Rémi Denis-Courmont
git at videolan.org
Thu Feb 19 23:14:57 CET 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Feb 20 00:09:31 2015 +0200| [7b1d9b5473ded556434be197f7ce6fb55fa4ff68] | committer: Rémi Denis-Courmont
vlc_list_children: use vlc_value_t.p_address, not .p_object
This was a remnant from the times of VLC_VAR_OBJECT.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7b1d9b5473ded556434be197f7ce6fb55fa4ff68
---
include/vlc_common.h | 1 -
modules/gui/ncurses.c | 2 +-
modules/gui/qt4/components/complete_preferences.cpp | 2 +-
modules/gui/qt4/dialogs/messages.cpp | 2 +-
src/misc/objects.c | 12 ++++--------
5 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/include/vlc_common.h b/include/vlc_common.h
index 1490932..98d91fc 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -340,7 +340,6 @@ typedef union
float f_float;
char * psz_string;
void * p_address;
- vlc_object_t * p_object;
vlc_list_t * p_list;
mtime_t i_time;
struct { int32_t x; int32_t y; } coords;
diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index d64afd6..a5e786c 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -718,7 +718,7 @@ static int SubDrawObject(intf_sys_t *sys, int l, vlc_object_t *p_obj, int i_leve
vlc_list_t *list = vlc_list_children(p_obj);
for (int i = 0; i < list->i_count ; i++) {
- l = SubDrawObject(sys, l, list->p_values[i].p_object, i_level,
+ l = SubDrawObject(sys, l, list->p_values[i].p_address, i_level,
(i == list->i_count - 1) ? "`-" : "|-" );
}
vlc_list_release(list);
diff --git a/modules/gui/qt4/components/complete_preferences.cpp b/modules/gui/qt4/components/complete_preferences.cpp
index c4e98f7..8841b79 100644
--- a/modules/gui/qt4/components/complete_preferences.cpp
+++ b/modules/gui/qt4/components/complete_preferences.cpp
@@ -408,7 +408,7 @@ static void populateLoadedSet( QSet<QString> *loaded, vlc_object_t *p_node )
vlc_list_t *l = vlc_list_children( p_node );
for( int i=0; i < l->i_count; i++ )
- populateLoadedSet( loaded, l->p_values[i].p_object );
+ populateLoadedSet( loaded, (vlc_object_t *)l->p_values[i].p_address );
vlc_list_release( l );
}
diff --git a/modules/gui/qt4/dialogs/messages.cpp b/modules/gui/qt4/dialogs/messages.cpp
index 252dcc4..21c1110 100644
--- a/modules/gui/qt4/dialogs/messages.cpp
+++ b/modules/gui/qt4/dialogs/messages.cpp
@@ -309,7 +309,7 @@ void MessagesDialog::buildTree( QTreeWidgetItem *parentItem,
vlc_list_t *l = vlc_list_children( p_obj );
for( int i=0; i < l->i_count; i++ )
- buildTree( item, l->p_values[i].p_object );
+ buildTree( item, (vlc_object_t *)l->p_values[i].p_address );
vlc_list_release( l );
}
diff --git a/src/misc/objects.c b/src/misc/objects.c
index 3b04518..7604e56 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -403,7 +403,7 @@ void ObjectKillChildrens( vlc_object_t *p_obj )
vlc_list_t *p_list = vlc_list_children( p_obj );
for( int i = 0; i < p_list->i_count; i++ )
- ObjectKillChildrens( p_list->p_values[i].p_object );
+ ObjectKillChildrens( p_list->p_values[i].p_address );
vlc_list_release( p_list );
}
@@ -562,7 +562,7 @@ vlc_list_t *vlc_list_children( vlc_object_t *obj )
unsigned i = 0;
for (priv = vlc_internals (obj)->first; priv; priv = priv->next)
- l->p_values[i++].p_object = vlc_object_hold (vlc_externals (priv));
+ l->p_values[i++].p_address = vlc_object_hold (vlc_externals (priv));
}
libvlc_unlock (obj->p_libvlc);
return l;
@@ -697,12 +697,8 @@ static int DumpCommand( vlc_object_t *p_this, char const *psz_cmd,
*****************************************************************************/
void vlc_list_release( vlc_list_t *p_list )
{
- int i_index;
-
- for( i_index = 0; i_index < p_list->i_count; i_index++ )
- {
- vlc_object_release( p_list->p_values[i_index].p_object );
- }
+ for( int i = 0; i < p_list->i_count; i++ )
+ vlc_object_release( p_list->p_values[i].p_address );
free( p_list->p_values );
free( p_list );
More information about the vlc-commits
mailing list