[vlc-commits] access/dtv: narrow scope of iteration variable

Filip Roséen git at videolan.org
Wed Oct 12 10:04:38 CEST 2016


vlc | branch: master | Filip Roséen <filip at atch.se> | Tue Oct 11 20:06:16 2016 +0200| [ba81ce9d29350f0f4cc7e90e5083ac34bf548e12] | committer: Thomas Guillem

access/dtv: narrow scope of iteration variable

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/access/dtv/en50221.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/modules/access/dtv/en50221.c b/modules/access/dtv/en50221.c
index cff984a..a31f4fa 100644
--- a/modules/access/dtv/en50221.c
+++ b/modules/access/dtv/en50221.c
@@ -145,10 +145,9 @@ static uint8_t *GetLength( uint8_t *p_data, int *pi_length )
     if ( (*pi_length & SIZE_INDICATOR) != 0 )
     {
         int l = *pi_length & ~SIZE_INDICATOR;
-        int i;
 
         *pi_length = 0;
-        for ( i = 0; i < l; i++ )
+        for ( int i = 0; i < l; i++ )
             *pi_length = (*pi_length << 8) | *p_data++;
     }
 
@@ -218,10 +217,9 @@ static uint8_t *SetLength( uint8_t *p_data, int i_length )
 static void Dump( bool b_outgoing, uint8_t *p_data, int i_size )
 {
 #ifdef DEBUG_TPDU
-    int i;
 #define MAX_DUMP 256
     fprintf(stderr, "%s ", b_outgoing ? "-->" : "<--");
-    for ( i = 0; i < i_size && i < MAX_DUMP; i++)
+    for ( int i = 0; i < i_size && i < MAX_DUMP; i++)
         fprintf(stderr, "%02X ", p_data[i]);
     fprintf(stderr, "%s\n", i_size >= MAX_DUMP ? "..." : "");
 #else



More information about the vlc-commits mailing list