[vlc-commits] video_filter:ball: fix variable shadowing warning

Steve Lhomme git at videolan.org
Fri Feb 8 14:00:44 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Feb  8 13:27:13 2019 +0100| [0119a69beb444d0892c4c6b273a9b9ce1140b026] | committer: Steve Lhomme

video_filter:ball: fix variable shadowing warning

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0119a69beb444d0892c4c6b273a9b9ce1140b026
---

 modules/video_filter/ball.c | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/modules/video_filter/ball.c b/modules/video_filter/ball.c
index 0766bbbf2f..d4d8c26f55 100644
--- a/modules/video_filter/ball.c
+++ b/modules/video_filter/ball.c
@@ -613,44 +613,44 @@ static void FilterBall( filter_t *p_filter, picture_t *p_inpic,
        | -2 0 2 | and |  0  0  0 |
        | -1 0 1 |     | -1 -2 -1 | */
 
-    for( int y = 1; y < i_numLines - 1; y++ )
+    for( int line = 1; line < i_numLines - 1; line++ )
     {
-        for( int x = 1; x < i_numCols - 1; x++ )
+        for( int col = 1; col < i_numCols - 1; col++ )
         {
 
-            p_grad_x[ y * i_numCols + x ] =
-                    ( p_smooth[(y-1)*i_numCols+x-1]
-                    - p_smooth[(y+1)*i_numCols+x-1] )
-                    + ( ( p_smooth[(y-1)*i_numCols+x]
-                    - p_smooth[(y+1)*i_numCols+x] ) <<1 )
-                    + ( p_smooth[(y-1)*i_numCols+x+1]
-                    - p_smooth[(y+1)*i_numCols+x+1] );
-            p_grad_y[ y * i_numCols + x ] =
-                    ( p_smooth[(y-1)*i_numCols+x-1]
-                    - p_smooth[(y-1)*i_numCols+x+1] )
-                    + ( ( p_smooth[y*i_numCols+x-1]
-                    - p_smooth[y*i_numCols+x+1] ) <<1 )
-                    + ( p_smooth[(y+1)*i_numCols+x-1]
-                    - p_smooth[(y+1)*i_numCols+x+1] );
+            p_grad_x[ line * i_numCols + col ] =
+                    ( p_smooth[(line-1)*i_numCols+col-1]
+                    - p_smooth[(line+1)*i_numCols+col-1] )
+                    + ( ( p_smooth[(line-1)*i_numCols+col]
+                    - p_smooth[(line+1)*i_numCols+col] ) <<1 )
+                    + ( p_smooth[(line-1)*i_numCols+col+1]
+                    - p_smooth[(line+1)*i_numCols+col+1] );
+            p_grad_y[ line * i_numCols + col ] =
+                    ( p_smooth[(line-1)*i_numCols+col-1]
+                    - p_smooth[(line-1)*i_numCols+col+1] )
+                    + ( ( p_smooth[line*i_numCols+col-1]
+                    - p_smooth[line*i_numCols+col+1] ) <<1 )
+                    + ( p_smooth[(line+1)*i_numCols+col-1]
+                    - p_smooth[(line+1)*i_numCols+col+1] );
         }
     }
 
     if( p_sys->b_edgeVisible )
     {
         /* Display the edges. */
-        for( int y = 1; y < i_numLines - 1; y++ )
+        for( int line = 1; line < i_numLines - 1; line++ )
         {
-            for( int x = 1; x < i_numCols - 1; x++ )
+            for( int col = 1; col < i_numCols - 1; col++ )
             {
-                if( abs( p_grad_x[ y * i_numCols + x ] )
-                    + abs( p_grad_y[ y * i_numCols + x ] )
+                if( abs( p_grad_x[ line * i_numCols + col ] )
+                    + abs( p_grad_y[ line * i_numCols + col ] )
                     > p_sys->i_gradThresh )
                 {
                     ( *p_sys->drawingPixelFunction )( p_sys, p_outpic,
                                                       p_sys->colorList[ WHITE ].comp1,
                                                       p_sys->colorList[ WHITE ].comp2,
                                                       p_sys->colorList[ WHITE ].comp3,
-                                                      x, y, 0 );
+                                                      col, line, 0 );
                 }
             }
         }



More information about the vlc-commits mailing list