[FFmpeg-devel] [PATCH] Mark AVFilterPad[] compound literals as const.
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sat Nov 5 15:35:03 CET 2011
On Sat, Nov 05, 2011 at 03:21:49PM +0100, Clément Bœsch wrote:
> On Sat, Nov 05, 2011 at 03:11:40PM +0100, Nicolas George wrote:
> > Le quintidi 15 brumaire, an CCXX, Clément Bœsch a écrit :
> > > > + .inputs = (const AVFilterPad[]) {{ .name = "default",
> > > > .type = AVMEDIA_TYPE_AUDIO,
> > > > .filter_samples = filter_samples,
> > > > .min_perms = AV_PERM_READ, },
> > > > { .name = NULL}},
> > >
> > > Do you mind keeping the vertical alignment? :)
> >
> > Usually, this is done in a separate patch.
> >
> > And the lines will go beyond 80 columns. Better write it as:
> >
> > .inputs = (const AVFilterPad[]) {
> > { .name = "default",
> > .type = AVMEDIA_TYPE_AUDIO,
> > .filter_samples = filter_samples,
> > .min_perms = AV_PERM_READ, },
> > { .name = NULL}
> > },
> >
>
> I was thinking of just aligning the '=' after the .name attribute (line is
> already changed anyway) and avoid a huge reindent patch.
As you see that's a big bikeshed issue, it is additional work,
and I couldn't decide on how to do it (personally I think it would
be nicer to put .name on a separate line and reduce the amount of
indentation).
So, yes I do in fact mind.
However I tried to read up a bit in there might be a bit of
an issue in so far as compound literals are not considered constant
by C99 in general it seems, which would make them rather unsuitable
for that kind of usage.
More information about the ffmpeg-devel
mailing list