[vlc-devel] [PATCH 1/8] Extensions: public include

Rémi Denis-Courmont rem at videolan.org
Thu Dec 24 10:04:39 CET 2009


Le mercredi 23 décembre 2009, Jean-Philippe André a écrit :
> +static inline int extension_Control( extensions_manager_t *p_mgr,
> +                                     int i_control, ... )
> +{
> +    assert( p_mgr != NULL );
> +    va_list args;
> +    va_start( args, i_control );
> +    int i_ret = p_mgr->pf_control( p_mgr, i_control, args );
> +    va_end( args );
> +    return i_ret;
> +}

assert() in header files has proven highly problematic.

> +#define extension_UnsetDialogProvider(a) \
> +        __extension_UnsetDialogProvider( VLC_OBJECT(a) )
> +static inline void __extension_UnsetDialogProvider( vlc_object_t *p_this )
> +{ 
> +    var_Destroy( p_this, "dialog-provider" );
> +}

Seems unsafe. The caller does not know when the provider is
unreferenced. Also, if the variable was created more than once,
this won't even unregister the pointer.


> +struct extension_dialog_t
> +{
> +    vlc_object_t *p_object;      ///< FIXME description
> +
> +    char *psz_title;             ///< Title for the Dialog (in
> TitleBar)
> +    int i_width;                 ///< Width hint in pixels 
> (may be discarded)
> +    int i_height;                ///< Height hint 
> in pixels (may be discarded) +
> +    int i_num_widgets;           ///< Number of widgets

Shouldn't those be unsigned?


-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list