diff mbox series

[FFmpeg-devel,2/3] avcodec/v4l2_m2m_enc: Avoid ;;

Message ID 20200601113237.15114-2-andreas.rheinhardt@gmail.com
State Accepted
Commit d29aaf12f4f6af4490604852b066ff8cd58104ed
Headers show
Series [FFmpeg-devel,1/3] avcodec/encode: Remove ff_alloc_packet | expand

Checks

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

Commit Message

Andreas Rheinhardt June 1, 2020, 11:32 a.m. UTC
Inside a function, the second ; in a double ;; is a null statement, but
outside of functions a double ;; is simply invalid C that compilers
happen to accept. v4l2_m2m_enc.c contained several ;; as a result of
macro-expansion. So change the underlying macro so that it doesn't
happen any longer.

This fixes warnings when compiling with -pedantic: "ISO C does not allow
extra ‘;’ outside of a function".

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

Comments

Andriy Gelman June 1, 2020, 6:49 p.m. UTC | #1
On Mon, 01. Jun 13:32, Andreas Rheinhardt wrote:
> Inside a function, the second ; in a double ;; is a null statement, but
> outside of functions a double ;; is simply invalid C that compilers
> happen to accept. v4l2_m2m_enc.c contained several ;; as a result of
> macro-expansion. So change the underlying macro so that it doesn't
> happen any longer.
> 
> This fixes warnings when compiling with -pedantic: "ISO C does not allow
> extra ‘;’ outside of a function".
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/v4l2_m2m_enc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
> index a21a7b6c65..32321f392f 100644
> --- a/libavcodec/v4l2_m2m_enc.c
> +++ b/libavcodec/v4l2_m2m_enc.c
> @@ -417,7 +417,7 @@ static const AVCodecDefault v4l2_m2m_defaults[] = {
>          .defaults       = v4l2_m2m_defaults, \
>          .capabilities   = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \
>          .wrapper_name   = "v4l2m2m", \
> -    };
> +    }
>  
>  M2MENC(mpeg4,"MPEG4", mpeg4_options, AV_CODEC_ID_MPEG4);
>  M2MENC(h263, "H.263", options,       AV_CODEC_ID_H263);
> -- 
> 2.20.1
> 

lgtm

Thanks,
diff mbox series

Patch

diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index a21a7b6c65..32321f392f 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -417,7 +417,7 @@  static const AVCodecDefault v4l2_m2m_defaults[] = {
         .defaults       = v4l2_m2m_defaults, \
         .capabilities   = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \
         .wrapper_name   = "v4l2m2m", \
-    };
+    }
 
 M2MENC(mpeg4,"MPEG4", mpeg4_options, AV_CODEC_ID_MPEG4);
 M2MENC(h263, "H.263", options,       AV_CODEC_ID_H263);