[vlc-devel] [PATCH 6/6] modules: check deactivation callback type

Steve Lhomme robux4 at ycbcr.xyz
Thu Jul 25 06:54:59 CEST 2019


OK for the set after the git log fix

On 2019-07-24 21:38, RĂ©mi Denis-Courmont wrote:
> ---
>   include/vlc_plugin.h |  2 +-
>   src/modules/entry.c  | 12 +++++++++++-
>   2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h
> index bd06aa224d..2ddc6cb0b1 100644
> --- a/include/vlc_plugin.h
> +++ b/include/vlc_plugin.h
> @@ -314,7 +314,7 @@ VLC_METADATA_EXPORTS
>   #define set_callbacks( activate, deactivate ) \
>       set_callback(activate) \
>       if (vlc_module_set(VLC_MODULE_CB_CLOSE, #deactivate, \
> -                       (void *)(deactivate))) \
> +                       (void (*)(vlc_object_t *)){ deactivate })) \
>           goto error;
>   
>   #define cannot_unload_broken_library( ) \
> diff --git a/src/modules/entry.c b/src/modules/entry.c
> index 52326386e2..c3e64af3d3 100644
> --- a/src/modules/entry.c
> +++ b/src/modules/entry.c
> @@ -274,7 +274,7 @@ static int vlc_plugin_desc_cb(void *ctx, void *tgt, int propid, ...)
>   
>           case VLC_MODULE_CB_CLOSE:
>               module->deactivate_name = va_arg(ap, const char *);
> -            module->deactivate = va_arg (ap, void *);
> +            module->deactivate = va_arg(ap, void (*)(vlc_object_t *));
>               break;
>   
>           case VLC_MODULE_NO_UNLOAD:
> @@ -493,6 +493,16 @@ static int vlc_plugin_gpa_cb(void *ctx, void *tgt, int propid, ...)
>               va_end (ap);
>               break;
>           }
> +        case VLC_MODULE_CB_CLOSE:
> +        {
> +            va_list ap;
> +
> +            va_start(ap, propid);
> +            name = va_arg(ap, const char *);
> +            addr = va_arg(ap, void (*)(vlc_object_t *));
> +            va_end(ap);
> +            break;
> +        }
>           default:
>               return 0;
>       }
> -- 
> 2.22.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list