[vlc-commits] Use C99 style loop variable declarations
Kaarlo Räihä
git at videolan.org
Thu Aug 27 19:01:25 CEST 2015
vlc | branch: master | Kaarlo Räihä <kaarlo.raiha at gmail.com> | Sat Aug 22 14:01:34 2015 +0300| [28124a8f20bfc676f7d1475bccf6ca34f398ef63] | committer: Jean-Baptiste Kempf
Use C99 style loop variable declarations
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=28124a8f20bfc676f7d1475bccf6ca34f398ef63
---
modules/video_filter/gaussianblur.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/modules/video_filter/gaussianblur.c b/modules/video_filter/gaussianblur.c
index 5c85bba..1504599 100644
--- a/modules/video_filter/gaussianblur.c
+++ b/modules/video_filter/gaussianblur.c
@@ -108,9 +108,8 @@ static void gaussianblur_InitDistribution( filter_sys_t *p_sys )
double f_sigma = p_sys->f_sigma;
int i_dim = (int)(3.*f_sigma);
type_t *pt_distribution = xmalloc( (2*i_dim+1) * sizeof( type_t ) );
- int x;
- for( x = -i_dim; x <= i_dim; x++ )
+ for( int x = -i_dim; x <= i_dim; x++ )
{
const float f_distribution = sqrt( exp(-(x*x)/(f_sigma*f_sigma) ) / (2.*M_PI*f_sigma*f_sigma) );
#ifdef DONT_USE_FLOATS
@@ -191,7 +190,6 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
{
picture_t *p_outpic;
filter_sys_t *p_sys = p_filter->p_sys;
- int i_plane;
const int i_dim = p_sys->i_dim;
type_t *pt_buffer;
type_t *pt_scale;
@@ -218,23 +216,21 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
const int i_visible_lines = p_pic->p[Y_PLANE].i_visible_lines;
const int i_visible_pitch = p_pic->p[Y_PLANE].i_visible_pitch;
const int i_pitch = p_pic->p[Y_PLANE].i_pitch;
- int i_col, i_line;
p_sys->pt_scale = xmalloc( i_visible_lines * i_pitch * sizeof( type_t ) );
pt_scale = p_sys->pt_scale;
- for( i_line = 0 ; i_line < i_visible_lines ; i_line++ )
+ for( int i_line = 0 ; i_line < i_visible_lines ; i_line++ )
{
- for( i_col = 0; i_col < i_visible_pitch ; i_col++ )
+ for( int i_col = 0; i_col < i_visible_pitch ; i_col++ )
{
- int x, y;
type_t t_value = 0;
- for( y = __MAX( -i_dim, -i_line );
+ for( int y = __MAX( -i_dim, -i_line );
y <= __MIN( i_dim, i_visible_lines - i_line - 1 );
y++ )
{
- for( x = __MAX( -i_dim, -i_col );
+ for( int x = __MAX( -i_dim, -i_col );
x <= __MIN( i_dim, i_visible_pitch - i_col + 1 );
x++ )
{
@@ -248,7 +244,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
}
pt_scale = p_sys->pt_scale;
- for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
+ for( int i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
{
uint8_t *p_in = p_pic->p[i_plane].p_pixels;
More information about the vlc-commits
mailing list