diff options
author | Pierre-André Jacquod <pjacquod@alumni.ethz.ch> | 2011-09-24 17:41:04 +0200 |
---|---|---|
committer | Pierre-André Jacquod <pjacquod@alumni.ethz.ch> | 2011-09-26 22:02:42 +0200 |
commit | 764b47e8a1cf2db19b21aa5ebc8cf6492af31bc4 (patch) | |
tree | 4895510433c17339d4bd1b4ce22ff40f6ff91805 /vcl | |
parent | 9e1966d9ac537ac23d96e8bf28059fe60a40b92d (diff) |
cppcheck: reduce scope of var in vcl bitmap3.cxx
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 0ae8e63d2519..28ab1b168d84 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -1933,7 +1933,6 @@ void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal, const long nRLen = nR2 - nR1; const long nGLen = nG2 - nG1; const long nBLen = nB2 - nB1; - long nR, nG, nB; sal_uLong* pBuf = pColBuf; if( !nRLen && !nGLen && !nBLen ) @@ -1952,11 +1951,11 @@ void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal, { long nPixSum = 0, nRSum = 0, nGSum = 0, nBSum = 0; - for( nR = nR1; nR <= nR2; nR++ ) + for( long nR = nR1; nR <= nR2; nR++ ) { - for( nG = nG1; nG <= nG2; nG++ ) + for( long nG = nG1; nG <= nG2; nG++ ) { - for( nB = nB1; nB <= nB2; nB++ ) + for( long nB = nB1; nB <= nB2; nB++ ) { nPixSum = pBuf[ RGB15( nR, nG, nB ) ]; @@ -1983,13 +1982,13 @@ void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal, if( nBLen > nGLen && nBLen > nRLen ) { - nB = nB1 - 1; + long nB = nB1 - 1; while( nPixNew < nTest ) { nB++, nPixOld = nPixNew; - for( nR = nR1; nR <= nR2; nR++ ) - for( nG = nG1; nG <= nG2; nG++ ) + for( long nR = nR1; nR <= nR2; nR++ ) + for( long nG = nG1; nG <= nG2; nG++ ) nPixNew += pBuf[ RGB15( nR, nG, nB ) ]; } @@ -2006,13 +2005,13 @@ void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal, } else if( nGLen > nRLen ) { - nG = nG1 - 1; + long nG = nG1 - 1; while( nPixNew < nTest ) { nG++, nPixOld = nPixNew; - for( nR = nR1; nR <= nR2; nR++ ) - for( nB = nB1; nB <= nB2; nB++ ) + for( long nR = nR1; nR <= nR2; nR++ ) + for( long nB = nB1; nB <= nB2; nB++ ) nPixNew += pBuf[ RGB15( nR, nG, nB ) ]; } @@ -2029,13 +2028,13 @@ void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal, } else { - nR = nR1 - 1; + long nR = nR1 - 1; while( nPixNew < nTest ) { nR++, nPixOld = nPixNew; - for( nG = nG1; nG <= nG2; nG++ ) - for( nB = nB1; nB <= nB2; nB++ ) + for( long nG = nG1; nG <= nG2; nG++ ) + for( long nB = nB1; nB <= nB2; nB++ ) nPixNew += pBuf[ RGB15( nR, nG, nB ) ]; } |