vf_hqdn3d: Don't declare the loop variable within the for loop

Message ID 1346066123-3754-1-git-send-email-martin@martin.st
State Committed
Commit 2bd67175c7e16c1f5da15c9e55ae6db4ab1d23fd
Headers show

Commit Message

Martin Storsjö Aug. 27, 2012, 11:15 a.m.
This C99 feature is generally not used in the libav codebase,
since it breaks building with some fringe compilers (GCC 2.95,
MSVC).
---
 libavfilter/vf_hqdn3d.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Luca Barbato Aug. 27, 2012, 11:26 a.m. | #1
On 8/27/12 1:15 PM, Martin Storsjö wrote:
> This C99 feature is generally not used in the libav codebase,
> since it breaks building with some fringe compilers (GCC 2.95,
> MSVC).
> ---
>   libavfilter/vf_hqdn3d.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)

Ok.

Patch

diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c
index 535657a..5bb896c 100644
--- a/libavfilter/vf_hqdn3d.c
+++ b/libavfilter/vf_hqdn3d.c
@@ -295,6 +295,7 @@  static int query_formats(AVFilterContext *ctx)
 static int config_input(AVFilterLink *inlink)
 {
     HQDN3DContext *hqdn3d = inlink->dst->priv;
+    int i;
 
     hqdn3d->hsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_w;
     hqdn3d->vsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_h;
@@ -304,7 +305,7 @@  static int config_input(AVFilterLink *inlink)
     if (!hqdn3d->line)
         return AVERROR(ENOMEM);
 
-    for (int i=0; i<4; i++) {
+    for (i = 0; i < 4; i++) {
         hqdn3d->coefs[i] = precalc_coefs(hqdn3d->strength[i], hqdn3d->depth);
         if (!hqdn3d->coefs[i])
             return AVERROR(ENOMEM);