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

vlc_object_create: remove legacy support for negative sizes

parent 26fb9276
...@@ -65,7 +65,7 @@ struct vlc_object_t ...@@ -65,7 +65,7 @@ struct vlc_object_t
/***************************************************************************** /*****************************************************************************
* Prototypes * 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_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_attach, ( vlc_object_t *, vlc_object_t * ) );
VLC_EXPORT( void, __vlc_object_detach, ( 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; ...@@ -86,8 +86,7 @@ VLC_EXPORT( char *, vlc_object_get_name, ( const vlc_object_t * ) ) LIBVLC_USED;
/**}@*/ /**}@*/
#define vlc_object_create(a,b) \ #define vlc_object_create(a,b) vlc_object_create( VLC_OBJECT(a), b )
__vlc_object_create( VLC_OBJECT(a), b )
#define vlc_object_set_destructor(a,b) \ #define vlc_object_set_destructor(a,b) \
__vlc_object_set_destructor( VLC_OBJECT(a), b ) __vlc_object_set_destructor( VLC_OBJECT(a), b )
......
...@@ -531,7 +531,7 @@ vlc_mutex_lock ...@@ -531,7 +531,7 @@ vlc_mutex_lock
vlc_mutex_trylock vlc_mutex_trylock
vlc_mutex_unlock vlc_mutex_unlock
__vlc_object_attach __vlc_object_attach
__vlc_object_create vlc_object_create
__vlc_object_detach __vlc_object_detach
__vlc_object_find __vlc_object_find
vlc_object_find_name vlc_object_find_name
......
...@@ -174,39 +174,17 @@ void *__vlc_custom_create( vlc_object_t *p_this, size_t i_size, ...@@ -174,39 +174,17 @@ void *__vlc_custom_create( vlc_object_t *p_this, size_t i_size,
return p_new; return p_new;
} }
#undef vlc_object_create
/** /**
* Allocates and initializes a vlc object. * Allocates and initializes a vlc object.
* *
* @param i_type known object type (all of them are negative integer values), * @param i_size object byte size
* or object byte size (always positive).
* *
* @return the new object, or NULL on error. * @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; return vlc_custom_create( p_this, i_size, VLC_OBJECT_GENERIC, "generic" );
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 );
} }
......
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