[vlc-devel] [PATCH 2/2] v4l2: Change to C99 style of for loop incrementer declaration

Devin Heitmueller dheitmueller at kernellabs.com
Sun Oct 21 22:52:48 CEST 2012


Define the incrementer for the for loop in the for() statement
itself.

Based on suggestion from Jean-Baptiste Kempf.
---
 modules/access/v4l2/demux.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/modules/access/v4l2/demux.c b/modules/access/v4l2/demux.c
index bb2309a..644e37e 100644
--- a/modules/access/v4l2/demux.c
+++ b/modules/access/v4l2/demux.c
@@ -475,7 +475,6 @@ static int InitVideo (demux_t *demux, int fd, uint32_t caps, v4l2_std_id *std)
 #ifdef ZVBI_COMPILED
 static int InitVBI (demux_t *demux)
 {
-    int i;
     demux_sys_t *sys = demux->p_sys;
     vbi_raw_decoder *par;
     
@@ -491,7 +490,7 @@ static int InitVBI (demux_t *demux)
         sys->vbi_sliced = malloc (sys->vbi_sliced_size);
     }
 
-    for (i = 0; i < 4; i++)
+    for (int i = 0; i < 4; i++)
     {
         es_format_t fmt;
         char buf[5];
@@ -638,8 +637,7 @@ static void *UserPtrThread (void *data)
                                          sys->vbi_raw );
             if( p_block )
             {
-                int i;
-                for (i = 0; i < 4; i++)
+                for (int i = 0; i < 4; i++)
                 {
                     if (i == 3)
                         es_out_Send( demux->out, sys->p_es_subt[i], p_block );
@@ -712,8 +710,7 @@ static void *MmapThread (void *data)
                                          sys->vbi_raw );
             if( p_block )
             {
-                int i;
-                for (i = 0; i < 4; i++)
+                for (int i = 0; i < 4; i++)
                 {
                     if (i == 3)
                         es_out_Send( demux->out, sys->p_es_subt[i], p_block );
@@ -797,8 +794,7 @@ static void *ReadThread (void *data)
                                          sys->vbi_raw );
             if( p_block )
             {
-                int i;
-                for (i = 0; i < 4; i++)
+                for (int i = 0; i < 4; i++)
                 {
                     if (i == 3)
                         es_out_Send( demux->out, sys->p_es_subt[i], p_block );
-- 
1.7.9.5




More information about the vlc-devel mailing list