diff mbox

[FFmpeg-devel] configure: Add -Wno-main

Message ID CAB0OVGqgQ+mdJ_mHuaLKHC+-DEo6hrCx_he+4__etvB1OogQDw@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Oct. 7, 2017, 2:02 p.m. UTC
One possibility attached.

Please comment, Carl Eugen

Comments

James Almer Oct. 7, 2017, 2:04 p.m. UTC | #1
On 10/7/2017 11:02 AM, Carl Eugen Hoyos wrote:
> One possibility attached.
> 
> Please comment, Carl Eugen
> 
> 
> 0001-lavfi-Rename-local-variables-main-as-master.patch
> 
> 
> From 0876a93917c8fe06a3d9b748c39e4f643c2ecd02 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
> Date: Sat, 7 Oct 2017 15:59:22 +0200
> Subject: [PATCH] lavfi: Rename local variables "main" as "master".
> 
> Silences several warnings:
> main is usually a function
> ---
>  libavfilter/vf_lut3d.c      |    8 ++++----
>  libavfilter/vf_paletteuse.c |   10 +++++-----
>  libavfilter/vf_psnr.c       |   14 +++++++-------
>  libavfilter/vf_ssim.c       |   12 ++++++------
>  4 files changed, 22 insertions(+), 22 deletions(-)

LGTM
Carl Eugen Hoyos Oct. 7, 2017, 6:52 p.m. UTC | #2
2017-10-07 16:04 GMT+02:00 James Almer <jamrial@gmail.com>:
> On 10/7/2017 11:02 AM, Carl Eugen Hoyos wrote:
>> One possibility attached.
>>
>> Please comment, Carl Eugen
>>
>>
>> 0001-lavfi-Rename-local-variables-main-as-master.patch
>>
>>
>> From 0876a93917c8fe06a3d9b748c39e4f643c2ecd02 Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
>> Date: Sat, 7 Oct 2017 15:59:22 +0200
>> Subject: [PATCH] lavfi: Rename local variables "main" as "master".
>>
>> Silences several warnings:
>> main is usually a function
>> ---
>>  libavfilter/vf_lut3d.c      |    8 ++++----
>>  libavfilter/vf_paletteuse.c |   10 +++++-----
>>  libavfilter/vf_psnr.c       |   14 +++++++-------
>>  libavfilter/vf_ssim.c       |   12 ++++++------
>>  4 files changed, 22 insertions(+), 22 deletions(-)
>
> LGTM

Patch applied.

Thank you, Carl Eugen
diff mbox

Patch

From 0876a93917c8fe06a3d9b748c39e4f643c2ecd02 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Sat, 7 Oct 2017 15:59:22 +0200
Subject: [PATCH] lavfi: Rename local variables "main" as "master".

Silences several warnings:
main is usually a function
---
 libavfilter/vf_lut3d.c      |    8 ++++----
 libavfilter/vf_paletteuse.c |   10 +++++-----
 libavfilter/vf_psnr.c       |   14 +++++++-------
 libavfilter/vf_ssim.c       |   12 ++++++------
 4 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index 39cd73f..c9b7224 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -752,16 +752,16 @@  static int update_apply_clut(FFFrameSync *fs)
 {
     AVFilterContext *ctx = fs->parent;
     AVFilterLink *inlink = ctx->inputs[0];
-    AVFrame *main, *second, *out;
+    AVFrame *master, *second, *out;
     int ret;
 
-    ret = ff_framesync_dualinput_get(fs, &main, &second);
+    ret = ff_framesync_dualinput_get(fs, &master, &second);
     if (ret < 0)
         return ret;
     if (!second)
-        return ff_filter_frame(ctx->outputs[0], main);
+        return ff_filter_frame(ctx->outputs[0], master);
     update_clut(ctx->priv, second);
-    out = apply_lut(inlink, main);
+    out = apply_lut(inlink, master);
     return ff_filter_frame(ctx->outputs[0], out);
 }
 
diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
index ffd37bf..79a0672 100644
--- a/libavfilter/vf_paletteuse.c
+++ b/libavfilter/vf_paletteuse.c
@@ -967,25 +967,25 @@  static int load_apply_palette(FFFrameSync *fs)
     AVFilterContext *ctx = fs->parent;
     AVFilterLink *inlink = ctx->inputs[0];
     PaletteUseContext *s = ctx->priv;
-    AVFrame *main, *second, *out;
+    AVFrame *master, *second, *out;
     int ret;
 
     // writable for error diffusal dithering
-    ret = ff_framesync_dualinput_get_writable(fs, &main, &second);
+    ret = ff_framesync_dualinput_get_writable(fs, &master, &second);
     if (ret < 0)
         return ret;
-    if (!main || !second) {
+    if (!master || !second) {
         ret = AVERROR_BUG;
         goto error;
     }
     if (!s->palette_loaded) {
         load_palette(s, second);
     }
-    out = apply_palette(inlink, main);
+    out = apply_palette(inlink, master);
     return ff_filter_frame(ctx->outputs[0], out);
 
 error:
-    av_frame_free(&main);
+    av_frame_free(&master);
     av_frame_free(&second);
     return ret;
 }
diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c
index adf1644..493a501 100644
--- a/libavfilter/vf_psnr.c
+++ b/libavfilter/vf_psnr.c
@@ -146,21 +146,21 @@  static int do_psnr(FFFrameSync *fs)
 {
     AVFilterContext *ctx = fs->parent;
     PSNRContext *s = ctx->priv;
-    AVFrame *main, *ref;
+    AVFrame *master, *ref;
     double comp_mse[4], mse = 0;
     int ret, j, c;
     AVDictionary **metadata;
 
-    ret = ff_framesync_dualinput_get(fs, &main, &ref);
+    ret = ff_framesync_dualinput_get(fs, &master, &ref);
     if (ret < 0)
         return ret;
     if (!ref)
-        return ff_filter_frame(ctx->outputs[0], main);
-    metadata = &main->metadata;
+        return ff_filter_frame(ctx->outputs[0], master);
+    metadata = &master->metadata;
 
-    compute_images_mse(s, (const uint8_t **)main->data, main->linesize,
+    compute_images_mse(s, (const uint8_t **)master->data, master->linesize,
                           (const uint8_t **)ref->data, ref->linesize,
-                          main->width, main->height, comp_mse);
+                          master->width, master->height, comp_mse);
 
     for (j = 0; j < s->nb_components; j++)
         mse += comp_mse[j] * s->planeweight[j];
@@ -222,7 +222,7 @@  static int do_psnr(FFFrameSync *fs)
         fprintf(s->stats_file, "\n");
     }
 
-    return ff_filter_frame(ctx->outputs[0], main);
+    return ff_filter_frame(ctx->outputs[0], master);
 }
 
 static av_cold int init(AVFilterContext *ctx)
diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c
index 40f09ad..4dcdc05 100644
--- a/libavfilter/vf_ssim.c
+++ b/libavfilter/vf_ssim.c
@@ -286,22 +286,22 @@  static int do_ssim(FFFrameSync *fs)
 {
     AVFilterContext *ctx = fs->parent;
     SSIMContext *s = ctx->priv;
-    AVFrame *main, *ref;
+    AVFrame *master, *ref;
     AVDictionary **metadata;
     float c[4], ssimv = 0.0;
     int ret, i;
 
-    ret = ff_framesync_dualinput_get(fs, &main, &ref);
+    ret = ff_framesync_dualinput_get(fs, &master, &ref);
     if (ret < 0)
         return ret;
     if (!ref)
-        return ff_filter_frame(ctx->outputs[0], main);
-    metadata = &main->metadata;
+        return ff_filter_frame(ctx->outputs[0], master);
+    metadata = &master->metadata;
 
     s->nb_frames++;
 
     for (i = 0; i < s->nb_components; i++) {
-        c[i] = s->ssim_plane(&s->dsp, main->data[i], main->linesize[i],
+        c[i] = s->ssim_plane(&s->dsp, master->data[i], master->linesize[i],
                              ref->data[i], ref->linesize[i],
                              s->planewidth[i], s->planeheight[i], s->temp,
                              s->max);
@@ -328,7 +328,7 @@  static int do_ssim(FFFrameSync *fs)
         fprintf(s->stats_file, "All:%f (%f)\n", ssimv, ssim_db(ssimv, 1.0));
     }
 
-    return ff_filter_frame(ctx->outputs[0], main);
+    return ff_filter_frame(ctx->outputs[0], master);
 }
 
 static av_cold int init(AVFilterContext *ctx)
-- 
1.7.10.4