[vlc-commits] input: remove input_item_node_t.p_parent
Rémi Denis-Courmont
git at videolan.org
Thu May 18 20:50:38 CEST 2017
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 18 21:49:46 2017 +0300| [d2eaa0d2df3ac96efe4a6cc351c68c58781c5519] | committer: Rémi Denis-Courmont
input: remove input_item_node_t.p_parent
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d2eaa0d2df3ac96efe4a6cc351c68c58781c5519
---
include/vlc_input_item.h | 1 -
src/input/item.c | 20 ++++++--------------
2 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h
index bd6a8fd8d8..24d67871d6 100644
--- a/include/vlc_input_item.h
+++ b/include/vlc_input_item.h
@@ -168,7 +168,6 @@ struct input_item_node_t
input_item_t * p_item;
int i_children;
input_item_node_t **pp_children;
- input_item_node_t *p_parent;
};
VLC_API void input_item_CopyOptions( input_item_t *p_child, input_item_t *p_parent );
diff --git a/src/input/item.c b/src/input/item.c
index 07d980ebc7..299927fe3b 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -1241,30 +1241,22 @@ input_item_node_t *input_item_node_Create( input_item_t *p_input )
p_node->p_item = p_input;
input_item_Hold( p_input );
- p_node->p_parent = NULL;
p_node->i_children = 0;
p_node->pp_children = NULL;
return p_node;
}
-static void RecursiveNodeDelete( input_item_node_t *p_node )
+void input_item_node_Delete( input_item_node_t *p_node )
{
for( int i = 0; i < p_node->i_children; i++ )
- RecursiveNodeDelete( p_node->pp_children[i] );
+ input_item_node_Delete( p_node->pp_children[i] );
input_item_Release( p_node->p_item );
free( p_node->pp_children );
free( p_node );
}
-void input_item_node_Delete( input_item_node_t *p_node )
-{
- if( p_node->p_parent )
- input_item_node_RemoveNode(node->p_parent, node);
- RecursiveNodeDelete( p_node );
-}
-
input_item_node_t *input_item_node_AppendItem( input_item_node_t *p_node, input_item_t *p_item )
{
int i_preparse_depth;
@@ -1285,18 +1277,18 @@ input_item_node_t *input_item_node_AppendItem( input_item_node_t *p_node, input_
return p_new_child;
}
-void input_item_node_AppendNode( input_item_node_t *p_parent, input_item_node_t *p_child )
+void input_item_node_AppendNode( input_item_node_t *p_parent,
+ input_item_node_t *p_child )
{
- assert( p_parent && p_child && p_child->p_parent == NULL );
+ assert(p_parent != NULL);
+ assert(p_child != NULL);
TAB_APPEND(p_parent->i_children, p_parent->pp_children, p_child);
- p_child->p_parent = p_parent;
}
void input_item_node_RemoveNode( input_item_node_t *parent,
input_item_node_t *child )
{
TAB_REMOVE(parent->i_children, parent->pp_children, child);
- child->p_parent = NULL;
}
void input_item_node_PostAndDelete( input_item_node_t *p_root )
More information about the vlc-commits
mailing list