[vlc-devel] [PATCH] picture: init the plane table using the same size

Thomas Guillem thomas at gllm.fr
Tue Apr 30 16:22:43 CEST 2019


On Tue, Apr 30, 2019, at 16:20, Rémi Denis-Courmont wrote:
> Hi,
> 
> Uh, isn't the macro called ARRAY_SIZE? I'm surprised this even compiles (well, I have not tried).

There are few ARRAYSIZE in win32 only code.

/usr/share/mingw-w64/include/winnt.h:
#define RTL_NUMBER_OF_V1(A) (sizeof(A)/sizeof((A)[0]))
#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)

I think it's still preferable to use VLC MACRO (ARRAY_SIZE).

> Le 30 avril 2019 11:03:14 GMT+02:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>> And the table is using PICTURE_PLANE_MAX not VOUT_MAX_PLANES. src/misc/picture.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/src/misc/picture.c b/src/misc/picture.c
>> index 46a2a069de..7ca4c6ac56 100644
>> --- a/src/misc/picture.c
>> +++ b/src/misc/picture.c
>> @@ -114,7 +114,7 @@ int picture_Setup( picture_t *p_picture, const video_format_t *restrict fmt )
>>  
>>      /* Store default values */
>>      p_picture->i_planes = 0;
>> -    for( unsigned i = 0; i < VOUT_MAX_PLANES; i++ )
>> +    for( unsigned i = 0; i < ARRAYSIZE(p_picture->p); i++ )
>>      {
>>          plane_t *p = &p_picture->p[i];
>>          p->p_pixels = NULL;
> 
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190430/610cbc59/attachment.html>


More information about the vlc-devel mailing list