[vlc-devel] commit: vlc_object_create: remove legacy support for negative sizes ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Jan 27 20:05:59 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jan 27 20:26:01 2010 +0200| [66852fb38b7e4848cee9cd135db23284a3b99d77] | committer: Rémi Denis-Courmont 

vlc_object_create: remove legacy support for negative sizes

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=66852fb38b7e4848cee9cd135db23284a3b99d77
---

 include/vlc_objects.h |    5 ++---
 src/libvlccore.sym    |    2 +-
 src/misc/objects.c    |   30 ++++--------------------------
 3 files changed, 7 insertions(+), 30 deletions(-)

diff --git a/include/vlc_objects.h b/include/vlc_objects.h
index 17e7cd9..d58d2ee 100644
--- a/include/vlc_objects.h
+++ b/include/vlc_objects.h
@@ -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 )
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index efa2ac5..55caa49 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -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
diff --git a/src/misc/objects.c b/src/misc/objects.c
index 0e92c92..d5c98c0 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -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" );
 }
 
 




More information about the vlc-devel mailing list