From 9fd89a5952a48b473cee03a2681eb5d4cd6d1742 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hryniuk Date: Sun, 4 Jan 2015 22:50:05 +0100 Subject: fdo#39440 reduce scope of local variables Beside scope changes, it fixes lack of initialization in a few places. Change-Id: Ia09fdb9845d8ac17256330a5ec5168401c84f0f2 Reviewed-on: https://gerrit.libreoffice.org/13755 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- basegfx/source/workbench/gauss.hxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'basegfx') diff --git a/basegfx/source/workbench/gauss.hxx b/basegfx/source/workbench/gauss.hxx index b6a784cbfc6c..fc352fe7e675 100644 --- a/basegfx/source/workbench/gauss.hxx +++ b/basegfx/source/workbench/gauss.hxx @@ -49,14 +49,14 @@ bool eliminate( Matrix& matrix, const BaseType& minPivot ) { BaseType temp; - int max, i, j, k; /* *must* be signed, when looping like: j>=0 ! */ + /* i, j, k *must* be signed, when looping like: j>=0 ! */ /* eliminate below main diagonal */ - for(i=0; i fabs(matrix[ max*cols + i ]) ) max = j; @@ -65,7 +65,7 @@ bool eliminate( Matrix& matrix, return false; /* pivot too small! */ /* interchange rows 'max' and 'i' */ - for(k=0; k=i; --k) + for(int j=i+1; j=i; --k) matrix[ j*cols + k ] -= matrix[ i*cols + k ] * matrix[ j*cols + i ] / matrix[ i*cols + i ]; } @@ -110,13 +110,13 @@ bool substitute( const Matrix& matrix, Vector& result ) { BaseType temp; - int j,k; /* *must* be signed, when looping like: j>=0 ! */ + /* j, k *must* be signed, when looping like: j>=0 ! */ /* substitute backwards */ - for(j=rows-1; j>=0; --j) + for(int j=rows-1; j>=0; --j) { temp = 0.0; - for(k=j+1; k