"Ronald S. Bultje" <[email protected]> writes:

> Hi,
>
> 2011/6/1 Måns Rullgård <[email protected]>:
>> "Ronald S. Bultje" <[email protected]> writes:
>>> On Wed, Jun 1, 2011 at 2:57 AM, Diego Biurrun <[email protected]> wrote:
>>>> This fixes the warning:
>>>> libavformat/options.c:62: warning: missing braces around initializer
>>>> libavformat/options.c:62: warning: (near initialization for 
>>>> ‘options[17].default_val’)
>>>> ---
>>>>  libavformat/options.c |    2 +-
>>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/libavformat/options.c b/libavformat/options.c
>>>> index 6ffd1a7..fe62d57 100644
>>>> --- a/libavformat/options.c
>>>> +++ b/libavformat/options.c
>>>> @@ -59,7 +59,7 @@ static const AVOption options[]={
>>>>  {"fdebug", "print specific debug info", OFFSET(debug), FF_OPT_TYPE_FLAGS, 
>>>> {.dbl = DEFAULT }, 0, INT_MAX, E|D, "fdebug"},
>>>>  {"ts", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_FDEBUG_TS }, INT_MIN, 
>>>> INT_MAX, E|D, "fdebug"},
>>>>  {"max_delay", "maximum muxing or demuxing delay in microseconds", 
>>>> OFFSET(max_delay), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E|D},
>>>> -{"fpsprobesize", "number of frames used to probe fps", 
>>>> OFFSET(fps_probe_size), FF_OPT_TYPE_INT, -1, -1, INT_MAX-1, D},
>>>> +{"fpsprobesize", "number of frames used to probe fps", 
>>>> OFFSET(fps_probe_size), FF_OPT_TYPE_INT, { -1 }, -1, INT_MAX-1, D},
>>>
>>> { .dbl = -1 }? That's fine with me.
>>
>> Why the explicit .dbl?  That line is long enough anyway (same goes for
>> the entire table).
>
> Because we do it like that everywhere else.

Invalid excuse.  Designated initialisers for structs are usually good,
but in this case all it does is clutter an already hard to read table
even more.  Don't forget that each line there is a struct initialiser.
By your logic, every entry there should have a field name.  Imagine what
that would look like.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to