diff mbox series

[FFmpeg-devel] avcodec/cbs_vp8: Don't leave out ... in calls to variadic macros

Message ID AS8P250MB074470A0694FD2E9D5ABDEC78F512@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit fe08058f24ca61b277548b5b7aa272b925c90ae9
Headers show
Series [FFmpeg-devel] avcodec/cbs_vp8: Don't leave out ... in calls to variadic macros | 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 Feb. 19, 2024, 1:37 p.m. UTC
It is undefined behaviour (see C11, 6.10.3 (4); see also
14dd0a9057019e97ff9438f6cc1502f6922acb85).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/cbs_vp8.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Andreas Rheinhardt Feb. 21, 2024, 5:04 p.m. UTC | #1
Andreas Rheinhardt:
> It is undefined behaviour (see C11, 6.10.3 (4); see also
> 14dd0a9057019e97ff9438f6cc1502f6922acb85).
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/cbs_vp8.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/cbs_vp8.c b/libavcodec/cbs_vp8.c
> index eabdef358f..1f7e81cfe6 100644
> --- a/libavcodec/cbs_vp8.c
> +++ b/libavcodec/cbs_vp8.c
> @@ -223,19 +223,19 @@ static int cbs_vp8_read_unsigned_le(CodedBitstreamContext *ctx, GetBitContext *g
>  #define SUBSCRIPTS(subs, ...) \
>      (subs > 0 ? ((int[subs + 1]){subs, __VA_ARGS__}) : NULL)
>  
> -#define f(width, name) xf(width, name, 0)
> +#define f(width, name) xf(width, name, 0, )
>  
>  // bool [de|en]coder methods.
> -#define bc_f(width, name) bc_unsigned_subs(width, DEFAULT_PROB, true, name, 0)
> -#define bc_s(width, name) bc_signed_subs(width, DEFAULT_PROB, name, 0)
> +#define bc_f(width, name) bc_unsigned_subs(width, DEFAULT_PROB, true, name, 0, )
> +#define bc_s(width, name) bc_signed_subs(width, DEFAULT_PROB, name, 0, )
>  #define bc_fs(width, name, subs, ...) \
>      bc_unsigned_subs(width, DEFAULT_PROB, true, name, subs, __VA_ARGS__)
>  #define bc_ss(width, name, subs, ...) \
>      bc_signed_subs(width, DEFAULT_PROB, name, subs, __VA_ARGS__)
>  
>  // bool [de|en]coder methods for boolean value and disable tracing.
> -#define bc_b(name) bc_unsigned_subs(1, DEFAULT_PROB, false, name, 0)
> -#define bc_b_prob(prob, name) bc_unsigned_subs(1, prob, false, name, 0)
> +#define bc_b(name) bc_unsigned_subs(1, DEFAULT_PROB, false, name, 0, )
> +#define bc_b_prob(prob, name) bc_unsigned_subs(1, prob, false, name, 0, )
>  
>  #define READ
>  #define READWRITE read

Will apply this patch tomorrow unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/cbs_vp8.c b/libavcodec/cbs_vp8.c
index eabdef358f..1f7e81cfe6 100644
--- a/libavcodec/cbs_vp8.c
+++ b/libavcodec/cbs_vp8.c
@@ -223,19 +223,19 @@  static int cbs_vp8_read_unsigned_le(CodedBitstreamContext *ctx, GetBitContext *g
 #define SUBSCRIPTS(subs, ...) \
     (subs > 0 ? ((int[subs + 1]){subs, __VA_ARGS__}) : NULL)
 
-#define f(width, name) xf(width, name, 0)
+#define f(width, name) xf(width, name, 0, )
 
 // bool [de|en]coder methods.
-#define bc_f(width, name) bc_unsigned_subs(width, DEFAULT_PROB, true, name, 0)
-#define bc_s(width, name) bc_signed_subs(width, DEFAULT_PROB, name, 0)
+#define bc_f(width, name) bc_unsigned_subs(width, DEFAULT_PROB, true, name, 0, )
+#define bc_s(width, name) bc_signed_subs(width, DEFAULT_PROB, name, 0, )
 #define bc_fs(width, name, subs, ...) \
     bc_unsigned_subs(width, DEFAULT_PROB, true, name, subs, __VA_ARGS__)
 #define bc_ss(width, name, subs, ...) \
     bc_signed_subs(width, DEFAULT_PROB, name, subs, __VA_ARGS__)
 
 // bool [de|en]coder methods for boolean value and disable tracing.
-#define bc_b(name) bc_unsigned_subs(1, DEFAULT_PROB, false, name, 0)
-#define bc_b_prob(prob, name) bc_unsigned_subs(1, prob, false, name, 0)
+#define bc_b(name) bc_unsigned_subs(1, DEFAULT_PROB, false, name, 0, )
+#define bc_b_prob(prob, name) bc_unsigned_subs(1, prob, false, name, 0, )
 
 #define READ
 #define READWRITE read