[MPlayer-dev-eng] [PATCH 4/4] stream ftp: Use C99 designated initializers

Diego Biurrun diego at biurrun.de
Fri Nov 23 19:37:27 CET 2012


On Thu, Nov 22, 2012 at 10:30:12PM +0100, Alexander Strasser wrote:
> Simplify the initialization of the stream private struct's defaults.
> 
> It should also be easier to read for most people.

This line is kind of redundant.

> --- a/stream/stream_ftp.c
> +++ b/stream/stream_ftp.c
> @@ -54,17 +54,10 @@ static struct stream_priv_s {
>    char *buf;
>    char *cmd_buf;
>  } stream_priv_dflts = {
> -  "anonymous","no at spam",
> -  NULL,
> -  21,
> -  NULL,
> -  NULL,
> -  NULL,
> -
> -  -1,
> -  0,0,
> -  NULL,
> -  NULL,
> +  .user = "anonymous",
> +  .pass = "no at spam",
> +  .port = 21,
> +  .handle = -1,
>  };

OK - you may want to align the = while you're at it...

Diego


More information about the MPlayer-dev-eng mailing list