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

Use TAB_ERASE instead of REMOVE_ELEM

parent 166873ee
......@@ -315,7 +315,7 @@ static void* Run( void *data )
/* Execute one query (protected against cancellation) */
char *psz_query = p_sys->ppsz_query[p_sys->i_query - 1];
REMOVE_ELEM( p_sys->ppsz_query, p_sys->i_query, p_sys->i_query - 1 );
TAB_ERASE(p_sys->i_query, p_sys->ppsz_query, p_sys->i_query - 1);
vlc_mutex_unlock( &p_sys->lock );
cancel = vlc_savecancel();
......
......@@ -248,7 +248,7 @@ noreturn static void *Run( void *data )
input_Close( p_input );
p_sd->p_sys->pp_input[i] = NULL;
REMOVE_ELEM( p_sys->pp_input, p_sys->i_input, i );
TAB_ERASE(p_sys->i_input, p_sys->pp_input, i);
i--;
}
}
......@@ -411,16 +411,15 @@ static void ParseRequest( services_discovery_t *p_sd )
else if ( !strcmp( psz_request, "RM" ) )
{
psz_request = psz_tok + 1;
for( i = 0; i<p_sys->i_urls; i++ )
if( !strcmp(p_sys->ppsz_urls[i],psz_request) )
break;
if( i != p_sys->i_urls )
{
services_discovery_RemoveItem( p_sd, p_sys->pp_items[i] );
input_item_Release( p_sys->pp_items[i] );
REMOVE_ELEM( p_sys->ppsz_urls, p_sys->i_urls, i );
REMOVE_ELEM( p_sys->pp_items, p_sys->i_items, i );
}
for( i = 0; i < p_sys->i_urls; i++ )
if( !strcmp(p_sys->ppsz_urls[i], psz_request) )
{
services_discovery_RemoveItem( p_sd, p_sys->pp_items[i] );
input_item_Release( p_sys->pp_items[i] );
TAB_ERASE(p_sys->i_urls, p_sys->ppsz_urls, i );
TAB_ERASE(p_sys->i_items, p_sys->pp_items, i );
break;
}
SaveUrls( p_sd );
}
......
......@@ -1529,7 +1529,7 @@ void rtp_del_sink( sout_stream_id_sys_t *id, int fd )
if (id->sinkv[i].rtp_fd == fd)
{
sink = id->sinkv[i];
REMOVE_ELEM( id->sinkv, id->sinkc, i );
TAB_ERASE(id->sinkc, id->sinkv, i);
break;
}
}
......
......@@ -287,7 +287,7 @@ void RtspDelId( rtsp_stream_t *rtsp, rtsp_stream_id_t *id )
{
rtsp_strack_t *tr = ses->trackv + j;
RtspTrackClose( tr );
REMOVE_ELEM( ses->trackv, ses->trackc, j );
TAB_ERASE(ses->trackc, ses->trackv, j);
}
}
}
......@@ -509,7 +509,7 @@ void RtspTrackDetach( rtsp_stream_t *rtsp, const char *name,
/* No (more) SETUP information: better get rid of the
* track so that we can have new random ssrc and
* seq_init next time. */
REMOVE_ELEM( session->trackv, session->trackc, i );
TAB_ERASE(session->trackc, session->trackv, i);
break;
}
/* We keep the SETUP information of the track, but stop it */
......@@ -1161,7 +1161,7 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
/* Keep VoD tracks whose instance is still
* running */
if (!(vod && ses->trackv[i].sout_id != NULL))
REMOVE_ELEM( ses->trackv, ses->trackc, i );
TAB_ERASE(ses->trackc, ses->trackv, i);
}
}
RtspClientAlive(ses);
......
......@@ -116,7 +116,7 @@ static inline int info_category_DeleteInfo(info_category_t *cat, const char *nam
int index;
if (info_category_FindInfo(cat, &index, name)) {
info_Delete(cat->pp_infos[index]);
REMOVE_ELEM(cat->pp_infos, cat->i_infos, index);
TAB_ERASE(cat->i_infos, cat->pp_infos, index);
return VLC_SUCCESS;
}
return VLC_EGENERIC;
......
......@@ -810,7 +810,7 @@ int input_item_DelInfo( input_item_t *p_i,
{
/* Remove the complete categorie */
info_category_Delete( p_cat );
REMOVE_ELEM( p_i->pp_categories, p_i->i_categories, i_cat );
TAB_ERASE(p_i->i_categories, p_i->pp_categories, i_cat);
}
vlc_mutex_unlock( &p_i->lock );
......
......@@ -181,7 +181,7 @@ void stats_Update( counter_t *p_counter, uint64_t val, uint64_t *new_val )
if( p_counter->i_samples == 3 )
{
p_old = p_counter->pp_samples[2];
REMOVE_ELEM( p_counter->pp_samples, p_counter->i_samples, 2 );
TAB_ERASE(p_counter->i_samples, p_counter->pp_samples, 2);
free( p_old );
}
break;
......
......@@ -533,9 +533,9 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
p_var->ops->pf_free( &p_var->choices.p_values[i] );
free( p_var->choices_text.p_values[i].psz_string );
REMOVE_ELEM( p_var->choices.p_values, p_var->choices.i_count, i );
REMOVE_ELEM( p_var->choices_text.p_values,
p_var->choices_text.i_count, i );
TAB_ERASE(p_var->choices.i_count, p_var->choices.p_values, i);
TAB_ERASE(p_var->choices_text.i_count,
p_var->choices_text.p_values, i);
TriggerListCallback(p_this, p_var, psz_name, VLC_VAR_DELCHOICE, p_val);
break;
......@@ -938,7 +938,7 @@ static void DelCallback( vlc_object_t *p_this, const char *psz_name,
return;
}
REMOVE_ELEM( p_table->p_entries, p_table->i_entries, i_entry );
TAB_ERASE(p_table->i_entries, p_table->p_entries, i_entry);
vlc_mutex_unlock( &p_priv->var_lock );
}
......
......@@ -611,7 +611,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item,
playlist_item_t *p_detach = p_item->p_parent;
int i_index = ItemIndex( p_item );
REMOVE_ELEM( p_detach->pp_children, p_detach->i_children, i_index );
TAB_ERASE(p_detach->i_children, p_detach->pp_children, i_index);
if( p_detach == p_node && i_index < i_newpos )
i_newpos--;
......@@ -649,7 +649,7 @@ int playlist_TreeMoveMany( playlist_t *p_playlist,
playlist_item_t *p_item = pp_items[i];
int i_index = ItemIndex( p_item );
playlist_item_t *p_parent = p_item->p_parent;
REMOVE_ELEM( p_parent->pp_children, p_parent->i_children, i_index );
TAB_ERASE(p_parent->i_children, p_parent->pp_children, i_index);
if ( p_parent == p_node && i_index < i_newpos ) i_newpos--;
}
for( int i = i_items - 1; i >= 0; i-- )
......
......@@ -172,7 +172,7 @@ int playlist_ServicesDiscoveryRemove(playlist_t *playlist, const char *name)
if (!strcmp(name, entry->name))
{
REMOVE_ELEM(priv->pp_sds, priv->i_sds, i);
TAB_ERASE(priv->i_sds, priv->pp_sds, i);
sds = entry;
break;
}
......
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