lavfi/aformat: use do..while(0) form for macro.
authorClément Bœsch <ubitux@gmail.com>
Thu, 26 Jan 2012 08:43:17 +0000 (09:43 +0100)
committerClément Bœsch <ubitux@gmail.com>
Thu, 2 Feb 2012 13:31:17 +0000 (14:31 +0100)
This avoids some empty statements.

libavfilter/af_aformat.c

index e892635..e7ef7f0 100644 (file)
@@ -42,7 +42,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
     if (!args)
         goto arg_fail;
 
     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;                                                  \
     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)                                                          \
     }                                                                   \
     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);
 
     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);