On Fri, Aug 29, 2014 at 09:29:46PM +0200, Clément Bœsch wrote: > On Fri, Aug 29, 2014 at 06:34:52PM +0200, Reimar Döffinger wrote: > > Signed-off-by: Reimar Döffinger <reimar.doeffin...@gmx.de> > > --- > > libavutil/hash.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/libavutil/hash.c b/libavutil/hash.c > > index 773f29e..979fdd9 100644 > > --- a/libavutil/hash.c > > +++ b/libavutil/hash.c > > @@ -63,7 +63,7 @@ typedef struct AVHashContext { > > struct { > > const char *name; > > int size; > > -} hashdesc[] = { > > +} static const hashdesc[] = { > > [MD5] = {"MD5", 16}, > > [MURMUR3] = {"murmur3", 16}, > > [RIPEMD128] = {"RIPEMD128", 16}, > > shouldn't that be static const struct { } hashdesc[] = { ... } > > as in static const <type> foo[] = { ... };
Reason I prefer this one is that if the struct becomes large it because very non-obvious that the array actually is "static const". It also is much harder to check/filter with grep. So for practical reasons I think it is better to place it here, or alternatively to name the struct and split them... But mostly I care about having it in .rodata, everything else I'm willing to adapt to what others prefer. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel