[vlc-devel] [PATCH] cmdline enhancements

Alexandre Janniaux ajanni at videolabs.io
Fri Sep 18 20:20:44 CEST 2020


Hi

In patch: cmdline: simplify, use memset

> -    i_shortopts = 0;
> -    for( i_index = 0; i_index < 256; i_index++ )
> -    {
> -        pp_shortopts[i_index] = NULL;
> -    }
> +    memset(&pp_shortopts, 0, 256 * sizeof(pp_shortopts[0]));

You should not use memset to initialize pointers.

In patch: cmdline: use color error/warn labels

Why not just check for --color/--no-color in the options first
before parsing them? It's not like there would be 3000 of them.
If I'm not wrong this would also be called on libvlc app too.

Regards,
--
Alexandre Janniaux
Videolabs

On Thu, Sep 17, 2020 at 11:41:09PM +0100, Lyndon Brown wrote:
> set of 14 patches enhancing cmdline experience:
> https://code.videolan.org/jnqnfe/vlc/-/tree/cmdline
>
> notable highlights:
>  - adds unknown long option suggestion matching (i.e. when possible,
> alongside an unknown long option error, a suggestion is given of the
> available option that most closely matches it, helping users when they
> make typos).
>  - colour error/warn labels.
>  - distinction made between unknown option and missing data value error
> conditions.
>  - other minor fixes/improvements.
>
> (had to bundle the FLT_MIN fix just separately submitted).
>
> _______________________________________________
> 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