]> git.sesse.net Git - vlc/commitdiff
vlc_object_create: remove legacy support for negative sizes
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 27 Jan 2010 18:26:01 +0000 (20:26 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 27 Jan 2010 19:05:56 +0000 (21:05 +0200)
include/vlc_objects.h
src/libvlccore.sym
src/misc/objects.c

index 17e7cd964da8170b25bf74d64dd33db69cb31801..d58d2ee1561c1a986941890dcf7eb068046c2907 100644 (file)
@@ -65,7 +65,7 @@ struct vlc_object_t
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
-VLC_EXPORT( void *, __vlc_object_create, ( vlc_object_t *, int ) ) LIBVLC_MALLOC LIBVLC_USED;
+VLC_EXPORT( void *, vlc_object_create, ( vlc_object_t *, size_t ) ) LIBVLC_MALLOC LIBVLC_USED;
 VLC_EXPORT( void, __vlc_object_set_destructor, ( vlc_object_t *, vlc_destructor_t ) );
 VLC_EXPORT( void, __vlc_object_attach, ( vlc_object_t *, vlc_object_t * ) );
 VLC_EXPORT( void, __vlc_object_detach, ( vlc_object_t * ) );
@@ -86,8 +86,7 @@ VLC_EXPORT( char *, vlc_object_get_name, ( const vlc_object_t * ) ) LIBVLC_USED;
 
 /**}@*/
 
-#define vlc_object_create(a,b) \
-    __vlc_object_create( VLC_OBJECT(a), b )
+#define vlc_object_create(a,b) vlc_object_create( VLC_OBJECT(a), b )
 
 #define vlc_object_set_destructor(a,b) \
     __vlc_object_set_destructor( VLC_OBJECT(a), b )
index efa2ac5b5e8ed8b3bd4a7d0f810373fa4413d54e..55caa496bdb232880ef69b98af9da29e5eca72dd 100644 (file)
@@ -531,7 +531,7 @@ vlc_mutex_lock
 vlc_mutex_trylock
 vlc_mutex_unlock
 __vlc_object_attach
-__vlc_object_create
+vlc_object_create
 __vlc_object_detach
 __vlc_object_find
 vlc_object_find_name
index 0e92c926b65ffba099416cfabe56aa1e7e2d04eb..d5c98c00f64a8ba0e5ea059a48f052c6870b8633 100644 (file)
@@ -174,39 +174,17 @@ void *__vlc_custom_create( vlc_object_t *p_this, size_t i_size,
     return p_new;
 }
 
-
+#undef vlc_object_create
 /**
  * Allocates and initializes a vlc object.
  *
- * @param i_type known object type (all of them are negative integer values),
- *               or object byte size (always positive).
+ * @param i_size object byte size
  *
  * @return the new object, or NULL on error.
  */
-void * __vlc_object_create( vlc_object_t *p_this, int i_type )
+void *vlc_object_create( vlc_object_t *p_this, size_t i_size )
 {
-    const char   * psz_type;
-    size_t         i_size;
-
-    switch( i_type )
-    {
-        case VLC_OBJECT_DECODER:
-            i_size = sizeof(decoder_t);
-            psz_type = "decoder";
-            break;
-        case VLC_OBJECT_AOUT:
-            i_size = sizeof(aout_instance_t);
-            psz_type = "audio output";
-            break;
-        default:
-            assert( i_type > 0 ); /* unknown type?! */
-            i_size = i_type;
-            i_type = VLC_OBJECT_GENERIC;
-            psz_type = "generic";
-            break;
-    }
-
-    return vlc_custom_create( p_this, i_size, i_type, psz_type );
+    return vlc_custom_create( p_this, i_size, VLC_OBJECT_GENERIC, "generic" );
 }