[vlc-devel] [PATCH] crystalhd: fix cast warning
Steve Lhomme
robux4 at ycbcr.xyz
Wed Jul 10 08:12:29 CEST 2019
On 2019-07-09 16:31, Rémi Denis-Courmont wrote:
> Le tiistaina 9. heinäkuuta 2019, 15.32.57 EEST Steve Lhomme a écrit :
>> ---
>> modules/codec/crystalhd.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/modules/codec/crystalhd.c b/modules/codec/crystalhd.c
>> index 98526e175ce..4c824e0f732 100644
>> --- a/modules/codec/crystalhd.c
>> +++ b/modules/codec/crystalhd.c
>> @@ -478,7 +478,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t
>> *p_block ) proc_out.PicInfo.width = p_dec->fmt_out.video.i_width;
>> proc_out.PicInfo.height = p_dec->fmt_out.video.i_height;
>> proc_out.PoutFlags = BC_POUT_FLAGS_SIZE;
>> - proc_out.AppCallBack = ourCallback;
>> + proc_out.AppCallBack = (dts_pout_callback) ourCallback;
>> proc_out.hnd = p_dec;
>> p_sys->proc_out = &proc_out;
>
> That cast looks dubious. It seems more like ourCallback prototype is wrong.
I think we can't get around the warning another way:
warning: incompatible pointer types assigning to 'dts_pout_callback'
(aka 'enum _BC_STATUS (*)(void *, unsigned int, unsigned int, unsigned
int, struct _BC_DTS_PROC_OUT *)') from 'BC_STATUS (void *, U32, U32,
U32, struct _BC_DTS_PROC_OUT *)'
(aka 'enum _BC_STATUS (void *, unsigned int, unsigned int, unsigned int,
struct _BC_DTS_PROC_OUT *)')
This is the same signature. But the header is ill-defined:
warning: declaration of 'struct _BC_DTS_PROC_OUT' will not be visible
outside of this function [-Wvisibility]
typedef BC_STATUS (*dts_pout_callback)(void *shnd, U32 width,U32
height, U32 stride, struct _BC_DTS_PROC_OUT *pOut);
It uses a struct pointer of a struct that is defined after. I don't
really care about the warning. It's only for windows too. On Linux the
same prototype uses a void instead of a struct _BC_DTS_PROC_OUT.
More information about the vlc-devel
mailing list