diff mbox series

[FFmpeg-devel] avformat/mov_chan: Use anonymous union

Message ID GV1P250MB073783D8F2D02C16E0A4FB138F362@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 316239096b15ed193056aada1555e84cce402b3a
Headers show
Series [FFmpeg-devel] avformat/mov_chan: Use anonymous union | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt March 25, 2024, 2:53 p.m. UTC
Fixes many -Wenum-conversion warnings with Clang caused by
e6c2c8703732bc46395c65c530038c8146df0deb.
See e.g.
https://fate.ffmpeg.org/log.cgi?time=20240325033545&slot=aarch64-linux-clang-10&log=compile

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/mov_chan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Almer March 25, 2024, 2:56 p.m. UTC | #1
On 3/25/2024 11:53 AM, Andreas Rheinhardt wrote:
> Fixes many -Wenum-conversion warnings with Clang caused by
> e6c2c8703732bc46395c65c530038c8146df0deb.
> See e.g.
> https://fate.ffmpeg.org/log.cgi?time=20240325033545&slot=aarch64-linux-clang-10&log=compile

Anonymous union, or enum (Re: subject)?

> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>   libavformat/mov_chan.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
> index d5225acddf..287059d65b 100644
> --- a/libavformat/mov_chan.c
> +++ b/libavformat/mov_chan.c
> @@ -30,7 +30,7 @@
>   #include "libavcodec/codec_id.h"
>   #include "mov_chan.h"
>   
> -enum ShortChannelName {
> +enum {
>       c_L      = AV_CHAN_FRONT_LEFT,
>       c_R      = AV_CHAN_FRONT_RIGHT,
>       c_C      = AV_CHAN_FRONT_CENTER,
Andreas Rheinhardt March 25, 2024, 3 p.m. UTC | #2
James Almer:
> On 3/25/2024 11:53 AM, Andreas Rheinhardt wrote:
>> Fixes many -Wenum-conversion warnings with Clang caused by
>> e6c2c8703732bc46395c65c530038c8146df0deb.
>> See e.g.
>> https://fate.ffmpeg.org/log.cgi?time=20240325033545&slot=aarch64-linux-clang-10&log=compile
> 
> Anonymous union, or enum (Re: subject)?
> 

Right, it is an anonymous enum, not union. Amended locally.

- Andreas
Henrik Gramner March 25, 2024, 4:38 p.m. UTC | #3
On Mon, Mar 25, 2024 at 4:01 PM Andreas Rheinhardt
<andreas.rheinhardt@outlook.com> wrote:
>
> Right, it is an anonymous enum, not union. Amended locally.
>
> - Andreas

Can confirm this eliminates the warnings, lgtm.
diff mbox series

Patch

diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index d5225acddf..287059d65b 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -30,7 +30,7 @@ 
 #include "libavcodec/codec_id.h"
 #include "mov_chan.h"
 
-enum ShortChannelName {
+enum {
     c_L      = AV_CHAN_FRONT_LEFT,
     c_R      = AV_CHAN_FRONT_RIGHT,
     c_C      = AV_CHAN_FRONT_CENTER,