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

Alexander Strasser eclipse7 at gmx.net
Sun Nov 25 16:15:53 CET 2012


Hello Diego!

Diego Biurrun wrote:
> 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.

  Not sure I understand what you are aiming at, but I just wanted to
note that it is not only shorter but possibly easier to read.

  But I do not really care, so I will maybe drop that line completely.

> > --- 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...

  Will not do this now because it is a bit of hassle to maintain and I
will probably add some more fields there soon.

  @all: I plan to commit this series tonight or tomorrow (Monday).
        Please object if you see any problems!

  Alexander


More information about the MPlayer-dev-eng mailing list