[vlc-devel] [PATCH] d3d11_adjust: Pass a non-const pointer to atomic_load

Steve Lhomme robux4 at ycbcr.xyz
Mon Feb 19 13:53:34 CET 2018


Le 19/02/2018 à 13:42, Martin Storsjö a écrit :
> This fixes compilation with clang, which previously errored
> out with this message:
>
> error: address argument to atomic operation must be a pointer to non-const _Atomic
>        type ('const atomic_int *' (aka 'const _Atomic(int) *') invalid)
>      int level = atomic_load(&p_level->level);
>                  ^           ~~~~~~~~~~~~~~~

This is odd as atomic_load() doesn't change the internal value. In C++11 
atomic::load() is a const method.
But feel free to push.

> ---
>   modules/hw/d3d11/d3d11_filters.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c
> index 643ab7f..9678603 100644
> --- a/modules/hw/d3d11/d3d11_filters.c
> +++ b/modules/hw/d3d11/d3d11_filters.c
> @@ -135,7 +135,7 @@ static int assert_ProcessorInput(filter_t *p_filter, picture_sys_t *p_sys_src)
>   
>   static bool ApplyFilter( filter_sys_t *p_sys,
>                            D3D11_VIDEO_PROCESSOR_FILTER filter,
> -                         const struct filter_level *p_level,
> +                         struct filter_level *p_level,
>                            ID3D11VideoProcessorInputView *input,
>                            ID3D11VideoProcessorOutputView *output,
>                            const video_format_t *fmt)



More information about the vlc-devel mailing list