[FFmpeg-cvslog] lavfi/aformat: use do..while(0) form for macro.

Clément Bœsch git at videolan.org
Thu Feb 2 14:41:13 CET 2012


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Thu Jan 26 09:43:17 2012 +0100| [9f0b0db0d3cb2fac71b5cdf4149bae103e7fd7ab] | committer: Clément Bœsch

lavfi/aformat: use do..while(0) form for macro.

This avoids some empty statements.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f0b0db0d3cb2fac71b5cdf4149bae103e7fd7ab
---

 libavfilter/af_aformat.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/af_aformat.c b/libavfilter/af_aformat.c
index e892635..e7ef7f0 100644
--- a/libavfilter/af_aformat.c
+++ b/libavfilter/af_aformat.c
@@ -42,7 +42,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
     if (!args)
         goto arg_fail;
 
-#define ADD_FORMATS(all_formats, fmt_name, fmt_type, fmts_list)         \
+#define ADD_FORMATS(all_formats, fmt_name, fmt_type, fmts_list) do {    \
     fmts_str = av_get_token(&args, ":");                                \
     if (!fmts_str || !*fmts_str)                                        \
         goto arg_fail;                                                  \
@@ -61,7 +61,8 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
     }                                                                   \
     av_freep(&fmts_str);                                                \
     if (*args)                                                          \
-        args++;
+        args++;                                                         \
+} while (0)
 
     ADD_FORMATS(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO), sample_format, int, formats);
     ADD_FORMATS(avfilter_make_all_channel_layouts(), channel_layout, int64_t, chlayouts);



More information about the ffmpeg-cvslog mailing list