diff mbox series

[FFmpeg-devel,1/3] avfilter/formats: Don't typedef structure a second time

Message ID 20200910234911.12891-1-andreas.rheinhardt@gmail.com
State Accepted
Commit 5616942220a74d1e201d2eab9f022b0d0fa4c66d
Headers show
Series [FFmpeg-devel,1/3] avfilter/formats: Don't typedef structure a second time | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 10, 2020, 11:49 p.m. UTC
Before commit 2f76476549a01ae2c4ec2a440e4b14c5aba64869, avfilter.h
contained no typedef for AVFilterChannelLayouts; all references to it
were done using its struct tag. formats.h meanwhile contained the
definition of the struct and a typedef for it. Said commit now added a
typedef in avfilter.h, too, bringing it in line with AVFilterFormats;
yet this means that there are two typedefs for AVFilterChannelLayouts
(in contrast to AVFilterFormats which is only typedef'ed in avfilter.h).

The problem is that older versions of GCC don't like this and error out:
http://fate.ffmpeg.org/history.cgi?slot=x86_64-openbsd5.6-gcc4.2-conf2
is one of the FATE boxes that now fail to compile. So just remove the
typedef in formats.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavfilter/formats.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Paul B Mahol Sept. 11, 2020, 9:13 a.m. UTC | #1
On Fri, Sep 11, 2020 at 01:49:09AM +0200, Andreas Rheinhardt wrote:
> Before commit 2f76476549a01ae2c4ec2a440e4b14c5aba64869, avfilter.h
> contained no typedef for AVFilterChannelLayouts; all references to it
> were done using its struct tag. formats.h meanwhile contained the
> definition of the struct and a typedef for it. Said commit now added a
> typedef in avfilter.h, too, bringing it in line with AVFilterFormats;
> yet this means that there are two typedefs for AVFilterChannelLayouts
> (in contrast to AVFilterFormats which is only typedef'ed in avfilter.h).
> 
> The problem is that older versions of GCC don't like this and error out:
> http://fate.ffmpeg.org/history.cgi?slot=x86_64-openbsd5.6-gcc4.2-conf2
> is one of the FATE boxes that now fail to compile. So just remove the
> typedef in formats.h.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavfilter/formats.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

ok
Nicolas George Sept. 11, 2020, 9:24 a.m. UTC | #2
Andreas Rheinhardt (12020-09-11):
> Before commit 2f76476549a01ae2c4ec2a440e4b14c5aba64869, avfilter.h
> contained no typedef for AVFilterChannelLayouts; all references to it
> were done using its struct tag. formats.h meanwhile contained the
> definition of the struct and a typedef for it. Said commit now added a
> typedef in avfilter.h, too, bringing it in line with AVFilterFormats;
> yet this means that there are two typedefs for AVFilterChannelLayouts
> (in contrast to AVFilterFormats which is only typedef'ed in avfilter.h).
> 
> The problem is that older versions of GCC don't like this and error out:
> http://fate.ffmpeg.org/history.cgi?slot=x86_64-openbsd5.6-gcc4.2-conf2
> is one of the FATE boxes that now fail to compile. So just remove the
> typedef in formats.h.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavfilter/formats.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

LGTM, thanks.

Regards,
diff mbox series

Patch

diff --git a/libavfilter/formats.h b/libavfilter/formats.h
index 8378be4b9b..0520bf42a9 100644
--- a/libavfilter/formats.h
+++ b/libavfilter/formats.h
@@ -83,7 +83,7 @@  struct AVFilterFormats {
  *   channel count with unknown disposition with the same number of channels
  *   (e.g. AV_CH_LAYOUT_STEREO and FF_COUNT2LAYOUT(2).
  */
-typedef struct AVFilterChannelLayouts {
+struct AVFilterChannelLayouts {
     uint64_t *channel_layouts;  ///< list of channel layouts
     int    nb_channel_layouts;  ///< number of channel layouts
     char all_layouts;           ///< accept any known channel layout
@@ -91,7 +91,7 @@  typedef struct AVFilterChannelLayouts {
 
     unsigned refcount;          ///< number of references to this list
     struct AVFilterChannelLayouts ***refs; ///< references to this list
-} AVFilterChannelLayouts;
+};
 
 /**
  * Encode a channel count as a channel layout.