]> git.sesse.net Git - vlc/commitdiff
Remove unused macros (or used only one time).
authorRémi Duraffort <ivoire@videolan.org>
Fri, 31 Oct 2008 22:29:04 +0000 (23:29 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Fri, 31 Oct 2008 22:29:04 +0000 (23:29 +0100)
include/vlc_common.h
src/input/item.c
src/interface/interaction.c
src/playlist/item.c

index 649553b48ff3f050bbf7ff6671694a65676ac752..27d594d4655f5ea7a52f5bb8a97634db424e54ad 100644 (file)
@@ -610,14 +610,6 @@ static inline uint8_t clip_uint8_vlc( int32_t a )
                                    if( !var ) return NULL; } while(0)
 #define MALLOC_ERR( var, type ) do { var = (type*)malloc( sizeof( type) ); \
                                    if( !var ) return VLC_ENOMEM; } while(0)
-#define MALLOC_GOTOERR( var, type ) do { var = (type*)malloc( sizeof( type) ); \
-                                      if( !var ) goto error; } while(0)
-#define DECMALLOC_VOID( var, type ) type* var = (type*)malloc( sizeof(type) );\
-                                    if( !var ) return;
-#define DECMALLOC_ERR( var, type )  type* var = (type*)malloc( sizeof(type) );\
-                                    if( !var ) return VLC_ENOMEM;
-#define DECMALLOC_NULL( var, type ) type* var = (type*)malloc( sizeof(type) );\
-                                    if( !var ) return NULL;
 
 #define FREENULL(a) do { free( a ); a = NULL; } while(0)
 
index 8ce43c3133e4ca989a39e245e026f0924340a827..75477a25e7215bd5315663ff480e77f3127ee976 100644 (file)
@@ -496,7 +496,9 @@ input_item_t *input_item_NewWithType( vlc_object_t *p_obj, const char *psz_uri,
 {
     libvlc_priv_t *priv = libvlc_priv (p_obj->p_libvlc);
 
-    DECMALLOC_NULL( p_input, input_item_t );
+    input_item_t* p_input = malloc( sizeof(input_item_t ) );
+    if( !p_input )
+        return NULL;
 
     input_item_Init( p_obj, p_input );
     vlc_gc_init( p_input, input_item_Destroy );
index 2359516378e20d7fff93710105779f8c170d6365..2be331760057e2edf1eb1eb920b909ad734d21a9 100644 (file)
@@ -56,13 +56,13 @@ static void                     DialogDestroy( interaction_dialog_t * );
 static int DialogSend( vlc_object_t *, interaction_dialog_t * );
 
 #define DIALOG_INIT( type ) \
-        DECMALLOC_ERR( p_new, interaction_dialog_t );       \
-        memset( p_new, 0, sizeof( interaction_dialog_t ) ); \
+        interaction_dialog_t* p_new = calloc( 1, sizeof( interaction_dialog_t ) ); \
+        if( !p_new ) return VLC_EGENERIC;               \
         p_new->b_cancelled = false;                     \
-        p_new->i_status = NEW_DIALOG;                       \
-        p_new->i_flags = 0;                                 \
-        p_new->i_type = INTERACT_DIALOG_##type;             \
-        p_new->psz_returned[0] = NULL;                      \
+        p_new->i_status = NEW_DIALOG;                   \
+        p_new->i_flags = 0;                             \
+        p_new->i_type = INTERACT_DIALOG_##type;         \
+        p_new->psz_returned[0] = NULL;                  \
         p_new->psz_returned[1] = NULL
 
 #define FORMAT_DESC \
index dee676c86fd75be33a6347679910fd1c94a49bd8..2fa541d18a36fef5ff6863ca0d34051fa669221f 100644 (file)
@@ -161,7 +161,9 @@ static void uninstall_input_item_observer( playlist_item_t * p_item )
 playlist_item_t *playlist_ItemNewFromInput( playlist_t *p_playlist,
                                               input_item_t *p_input )
 {
-    DECMALLOC_NULL( p_item, playlist_item_t );
+    playlist_item_t* p_item = malloc( sizeof( playlist_item_t ) );
+    if( !p_item )
+        return NULL;
 
     assert( p_input );