[vlc-commits] video output: use ARRAY_SIZE()

Rémi Denis-Courmont git at videolan.org
Thu Jun 28 06:50:08 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jun 28 07:44:23 2012 +0300| [605d047f09a1df1cf2b0ad4fb5711e24f8eba09f] | committer: Rémi Denis-Courmont

video output: use ARRAY_SIZE()

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

 src/video_output/vout_intf.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index e53f41e..2bc3fd9 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -84,7 +84,7 @@ static const struct
     { 0.5, N_("1:2 Half") },
     { 1, N_("1:1 Original") },
     { 2, N_("2:1 Double") },
-    { 0, NULL } };
+};
 
 static const struct
 {
@@ -102,7 +102,7 @@ static const struct
     { "4:3", "4:3" },
     { "5:4", "5:4" },
     { "1:1", "1:1" },
-    { NULL, NULL } };
+};
 
 static const struct
 {
@@ -118,7 +118,7 @@ static const struct
     { "235:100", "2.35:1" },
     { "239:100", "2.39:1" },
     { "5:4", "5:4" },
-    { NULL, NULL } };
+};
 
 static void AddCustomRatios( vout_thread_t *p_vout, const char *psz_var,
                              char *psz_list )
@@ -147,7 +147,6 @@ void vout_IntfInit( vout_thread_t *p_vout )
 {
     vlc_value_t val, text, old_val;
     char *psz_buf;
-    int i;
 
     /* Create a few object variables we'll need later on */
     var_Create( p_vout, "snapshot-path", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
@@ -184,7 +183,7 @@ void vout_IntfInit( vout_thread_t *p_vout )
 
     var_Get( p_vout, "zoom", &old_val );
 
-    for( i = 0; p_zoom_values[i].f_value; i++ )
+    for( size_t i = 0; i < ARRAY_SIZE(p_zoom_values); i++ )
     {
         if( old_val.f_float == p_zoom_values[i].f_value )
             var_Change( p_vout, "zoom", VLC_VAR_DELCHOICE, &old_val, NULL );
@@ -218,7 +217,7 @@ void vout_IntfInit( vout_thread_t *p_vout )
     val.psz_string = (char*)"";
     var_Change( p_vout, "crop", VLC_VAR_DELCHOICE, &val, 0 );
 
-    for( i = 0; p_crop_values[i].psz_value; i++ )
+    for( size_t i = 0; i < ARRAY_SIZE(p_crop_values); i++ )
     {
         val.psz_string = (char*)p_crop_values[i].psz_value;
         text.psz_string = _( p_crop_values[i].psz_label );
@@ -252,7 +251,7 @@ void vout_IntfInit( vout_thread_t *p_vout )
     val.psz_string = (char*)"";
     var_Change( p_vout, "aspect-ratio", VLC_VAR_DELCHOICE, &val, 0 );
 
-    for( i = 0; p_aspect_ratio_values[i].psz_value; i++ )
+    for( size_t i = 0; i < ARRAY_SIZE(p_aspect_ratio_values); i++ )
     {
         val.psz_string = (char*)p_aspect_ratio_values[i].psz_value;
         text.psz_string = _( p_aspect_ratio_values[i].psz_label );



More information about the vlc-commits mailing list