Commit 0716ea6d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove used FIND_STRICT

parent aa7e71ce
...@@ -45,8 +45,6 @@ ...@@ -45,8 +45,6 @@
#define FIND_CHILD 0x0002 #define FIND_CHILD 0x0002
#define FIND_ANYWHERE 0x0003 #define FIND_ANYWHERE 0x0003
#define FIND_STRICT 0x0010
/* Object flags */ /* Object flags */
#define OBJECT_FLAGS_NODBG 0x0001 #define OBJECT_FLAGS_NODBG 0x0001
#define OBJECT_FLAGS_QUIET 0x0002 #define OBJECT_FLAGS_QUIET 0x0002
......
...@@ -442,17 +442,15 @@ void * __vlc_object_find( vlc_object_t *p_this, int i_type, int i_mode ) ...@@ -442,17 +442,15 @@ void * __vlc_object_find( vlc_object_t *p_this, int i_type, int i_mode )
vlc_object_t *p_found; vlc_object_t *p_found;
/* If we are of the requested type ourselves, don't look further */ /* If we are of the requested type ourselves, don't look further */
if( !(i_mode & FIND_STRICT) if( vlc_internals (p_this)->i_object_type == i_type )
&& vlc_internals (p_this)->i_object_type == i_type )
{ {
vlc_object_hold( p_this ); vlc_object_hold( p_this );
return p_this; return p_this;
} }
/* Otherwise, recursively look for the object */ /* Otherwise, recursively look for the object */
if ((i_mode & 0x000f) == FIND_ANYWHERE) if (i_mode == FIND_ANYWHERE)
return vlc_object_find (p_this->p_libvlc, i_type, return vlc_object_find (p_this->p_libvlc, i_type, FIND_CHILD);
(i_mode & ~0x000f)|FIND_CHILD);
libvlc_lock (p_this->p_libvlc); libvlc_lock (p_this->p_libvlc);
p_found = FindObject( p_this, i_type, i_mode ); p_found = FindObject( p_this, i_type, i_mode );
...@@ -498,7 +496,7 @@ vlc_object_t *vlc_object_find_name( vlc_object_t *p_this, ...@@ -498,7 +496,7 @@ vlc_object_t *vlc_object_find_name( vlc_object_t *p_this,
* Use a libvlc address variable instead for that sort of things! */ * Use a libvlc address variable instead for that sort of things! */
msg_Warn( p_this, "%s(%s) is not safe!", __func__, psz_name ); msg_Warn( p_this, "%s(%s) is not safe!", __func__, psz_name );
/* If have the requested name ourselves, don't look further */ /* If have the requested name ourselves, don't look further */
if( !(i_mode & FIND_STRICT) && !objnamecmp(p_this, psz_name) ) if( !objnamecmp(p_this, psz_name) )
{ {
vlc_object_hold( p_this ); vlc_object_hold( p_this );
return p_this; return p_this;
...@@ -507,7 +505,7 @@ vlc_object_t *vlc_object_find_name( vlc_object_t *p_this, ...@@ -507,7 +505,7 @@ vlc_object_t *vlc_object_find_name( vlc_object_t *p_this,
libvlc_lock (p_this->p_libvlc); libvlc_lock (p_this->p_libvlc);
/* Otherwise, recursively look for the object */ /* Otherwise, recursively look for the object */
if( (i_mode & 0x000f) == FIND_ANYWHERE ) if( i_mode == FIND_ANYWHERE )
{ {
vlc_object_t *p_root = p_this; vlc_object_t *p_root = p_this;
...@@ -518,12 +516,11 @@ vlc_object_t *vlc_object_find_name( vlc_object_t *p_this, ...@@ -518,12 +516,11 @@ vlc_object_t *vlc_object_find_name( vlc_object_t *p_this,
p_root = p_root->p_parent; p_root = p_root->p_parent;
} }
p_found = FindObjectName( p_root, psz_name, p_found = FindObjectName( p_root, psz_name, FIND_CHILD );
(i_mode & ~0x000f)|FIND_CHILD );
if( p_found == NULL && p_root != VLC_OBJECT( p_this->p_libvlc ) ) if( p_found == NULL && p_root != VLC_OBJECT( p_this->p_libvlc ) )
{ {
p_found = FindObjectName( VLC_OBJECT( p_this->p_libvlc ), p_found = FindObjectName( VLC_OBJECT( p_this->p_libvlc ),
psz_name, (i_mode & ~0x000f)|FIND_CHILD ); psz_name, FIND_CHILD );
} }
} }
else else
...@@ -708,7 +705,7 @@ vlc_list_t * vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode ) ...@@ -708,7 +705,7 @@ vlc_list_t * vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode )
int i_count = 0; int i_count = 0;
/* Look for the objects */ /* Look for the objects */
switch( i_mode & 0x000f ) switch( i_mode )
{ {
case FIND_ANYWHERE: case FIND_ANYWHERE:
return vlc_list_find (VLC_OBJECT(p_this->p_libvlc), i_type, FIND_CHILD); return vlc_list_find (VLC_OBJECT(p_this->p_libvlc), i_type, FIND_CHILD);
...@@ -915,7 +912,7 @@ static vlc_object_t * FindObject( vlc_object_t *p_this, int i_type, int i_mode ) ...@@ -915,7 +912,7 @@ static vlc_object_t * FindObject( vlc_object_t *p_this, int i_type, int i_mode )
int i; int i;
vlc_object_t *p_tmp; vlc_object_t *p_tmp;
switch( i_mode & 0x000f ) switch( i_mode )
{ {
case FIND_PARENT: case FIND_PARENT:
p_tmp = p_this->p_parent; p_tmp = p_this->p_parent;
...@@ -968,7 +965,7 @@ static vlc_object_t * FindObjectName( vlc_object_t *p_this, ...@@ -968,7 +965,7 @@ static vlc_object_t * FindObjectName( vlc_object_t *p_this,
int i; int i;
vlc_object_t *p_tmp; vlc_object_t *p_tmp;
switch( i_mode & 0x000f ) switch( i_mode )
{ {
case FIND_PARENT: case FIND_PARENT:
p_tmp = p_this->p_parent; p_tmp = p_this->p_parent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment