]> git.sesse.net Git - vlc/blobdiff - modules/control/http/mvar.c
Remove useless <ctype.h> inclusions
[vlc] / modules / control / http / mvar.c
index eead1fe5707cba3a63883c00cb925f428b9e09a0..13a5b9864256a480b3e8c1d0ba6535be786f2b4c 100644 (file)
@@ -28,8 +28,8 @@
 
 #include "http.h"
 #include <limits.h>
-
-#include <assert.h>
+#include <errno.h>
+#include <ctype.h>
 
 /* Utility function for scandir */
 static int Filter( const char *foo )
@@ -54,7 +54,7 @@ mvar_t *mvar_New( const char *name, const char *value )
     v->value = strdup( value ? value : "" );
 
     v->i_field = 0;
-    v->field = malloc( sizeof( mvar_t * ) );
+    v->field = xmalloc( sizeof( mvar_t * ) );
     v->field[0] = NULL;
 
     return v;
@@ -77,7 +77,7 @@ void mvar_Delete( mvar_t *v )
 
 void mvar_AppendVar( mvar_t *v, mvar_t *f )
 {
-    v->field = realloc( v->field, sizeof( mvar_t * ) * ( v->i_field + 2 ) );
+    v->field = xrealloc( v->field, sizeof( mvar_t * ) * ( v->i_field + 2 ) );
     v->field[v->i_field] = f;
     v->i_field++;
 }
@@ -98,7 +98,7 @@ mvar_t *mvar_Duplicate( const mvar_t *v )
 
 void mvar_PushVar( mvar_t *v, mvar_t *f )
 {
-    v->field = realloc( v->field, sizeof( mvar_t * ) * ( v->i_field + 2 ) );
+    v->field = xrealloc( v->field, sizeof( mvar_t * ) * ( v->i_field + 2 ) );
     if( v->i_field > 0 )
     {
         memmove( &v->field[1], &v->field[0], sizeof( mvar_t * ) * v->i_field );
@@ -287,9 +287,9 @@ mvar_t *mvar_PlaylistSetNew( intf_thread_t *p_intf, char *name,
                                  playlist_t *p_pl )
 {
     mvar_t *s = mvar_New( name, "set" );
-    vlc_object_lock( p_pl );
+    playlist_Lock( p_pl );
     PlaylistListNode( p_intf, p_pl, p_pl->p_root_category , name, s, 0 );
-    vlc_object_unlock( p_pl );
+    playlist_Unlock( p_pl );
     return s;
 }
 
@@ -335,6 +335,7 @@ mvar_t *mvar_InfoSetNew( char *name, input_thread_t *p_input )
 mvar_t *mvar_ObjectSetNew( intf_thread_t *p_intf, char *psz_name,
                                const char *psz_capability )
 {
+    VLC_UNUSED(p_intf);
     mvar_t *s = mvar_New( psz_name, "set" );
     size_t i;
 
@@ -450,8 +451,7 @@ mvar_t *mvar_InputVarSetNew( intf_thread_t *p_intf, char *name,
     }
     /* clean up everything */
     if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
-    var_Change( p_sys->p_input, psz_variable, VLC_VAR_FREELIST, &val_list,
-                &text_list );
+    var_FreeList( &val_list, &text_list );
     return s;
 }