diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2018-10-31 17:20:46 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2018-11-01 13:02:26 +0100 |
commit | 26ccd00bc96c585b7065af0dcce246b5bfaae5e1 (patch) | |
tree | 960e163c0041c813e10f567995d648dc9332449d /vcl | |
parent | 0610c4439edf95b4cc4e16ee625b60ba606f7528 (diff) |
clang-tidy: (WIP) bugprone-too-small-loop-variable findings
Change-Id: Iaa255b39928ac45dec1ed37e368c149d6027f561
Reviewed-on: https://gerrit.libreoffice.org/62701
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/backendtest/outputdevice/common.cxx | 4 | ||||
-rw-r--r-- | vcl/headless/svpgdi.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/impvect.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl2.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/regionband.cxx | 2 | ||||
-rw-r--r-- | vcl/win/gdi/salgdi2.cxx | 2 |
6 files changed, 14 insertions, 10 deletions
diff --git a/vcl/backendtest/outputdevice/common.cxx b/vcl/backendtest/outputdevice/common.cxx index 9f69a28fabd3..8124676d93aa 100644 --- a/vcl/backendtest/outputdevice/common.cxx +++ b/vcl/backendtest/outputdevice/common.cxx @@ -111,7 +111,7 @@ TestResult checkHorizontalVerticalDiagonalLines(Bitmap& rBitmap, Color aExpected checkValue(pAccess, startX, y, aExpectedColor, nNumberOfQuirks, nNumberOfErrors, true, nColorThresh); checkValue(pAccess, endX, y, aExpectedColor, nNumberOfQuirks, nNumberOfErrors, true, nColorThresh); - for (int x = startX + 1; x <= endX - 1; x++) + for (long x = startX + 1; x <= endX - 1; x++) { checkValue(pAccess, x, y, aExpectedColor, nNumberOfQuirks, nNumberOfErrors, false, nColorThresh); } @@ -127,7 +127,7 @@ TestResult checkHorizontalVerticalDiagonalLines(Bitmap& rBitmap, Color aExpected checkValue(pAccess, x, startY, aExpectedColor, nNumberOfQuirks, nNumberOfErrors, true, nColorThresh); checkValue(pAccess, x, endY, aExpectedColor, nNumberOfQuirks, nNumberOfErrors, true, nColorThresh); - for (int y = startY + 1; y <= endY - 1; y++) + for (long y = startY + 1; y <= endY - 1; y++) { checkValue(pAccess, x, y, aExpectedColor, nNumberOfQuirks, nNumberOfErrors, false, nColorThresh); } diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index e42eb3ed3eaa..1921cde62cef 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -1657,11 +1657,11 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR, } sal_Int32 nStride; unsigned char *mask_data = aSurface.getBits(nStride); - for (sal_Int32 y = rTR.mnSrcY ; y < rTR.mnSrcY + rTR.mnSrcHeight; ++y) + for (long y = rTR.mnSrcY ; y < rTR.mnSrcY + rTR.mnSrcHeight; ++y) { unsigned char *row = mask_data + (nStride*y); unsigned char *data = row + (rTR.mnSrcX * 4); - for (sal_Int32 x = rTR.mnSrcX; x < rTR.mnSrcX + rTR.mnSrcWidth; ++x) + for (long x = rTR.mnSrcX; x < rTR.mnSrcX + rTR.mnSrcWidth; ++x) { sal_uInt8 b = unpremultiply(data[SVP_CAIRO_BLUE], data[SVP_CAIRO_ALPHA]); sal_uInt8 g = unpremultiply(data[SVP_CAIRO_GREEN], data[SVP_CAIRO_ALPHA]); diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index e785aae0aeb7..4a027134402b 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -330,7 +330,8 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag ) nFirstY = nLastY = maStartPt.Y(); aArr.ImplSetSize( mnCount << 1 ); - sal_uInt16 i, nPolyPos; + sal_uInt16 nPolyPos; + sal_uLong i; for( i = 0, nPolyPos = 0; i < ( mnCount - 1 ); i++ ) { const sal_uInt8 cMove = mpCodes[ i ]; @@ -437,7 +438,8 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag ) nFirstY = nLastY = maStartPt.Y(); aArr.ImplSetSize( mnCount << 1 ); - sal_uInt16 i, nPolyPos; + sal_uInt16 nPolyPos; + sal_uLong i; for( i = 0, nPolyPos = 0; i < ( mnCount - 1 ); i++ ) { const sal_uInt8 cMove = mpCodes[ i ]; diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 660795082c94..82f99a33cd00 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -1398,7 +1398,8 @@ bool PDFWriterImpl::computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPass //Step 7, only if 128 bit if( i_nKeyLength == SECUR_128BIT_KEY ) { - sal_uInt32 i, y; + sal_uInt32 i; + size_t y; sal_uInt8 nLocalKey[ SECUR_128BIT_KEY ]; // 16 = 128 bit key for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1 @@ -1472,7 +1473,8 @@ bool PDFWriterImpl::computeUDictionaryValue( EncHashTransporter* i_pTransporter, rtl_cipher_encodeARCFOUR( aCipher, nMD5Sum.data(), nMD5Sum.size(), // the data to be encrypted &io_rProperties.UValue[0], SECUR_128BIT_KEY ); //encrypted data, stored in class data member //step 5 - sal_uInt32 i, y; + sal_uInt32 i; + size_t y; sal_uInt8 nLocalKey[SECUR_128BIT_KEY]; for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1 diff --git a/vcl/source/gdi/regionband.cxx b/vcl/source/gdi/regionband.cxx index 4cfee2a8d503..28ff3fc79945 100644 --- a/vcl/source/gdi/regionband.cxx +++ b/vcl/source/gdi/regionband.cxx @@ -419,7 +419,7 @@ void RegionBand::CreateBandRange(long nYTop, long nYBottom) mpLastCheckedBand = mpFirstBand; ImplRegionBand* pBand = mpFirstBand; - for ( int i = nYTop; i <= nYBottom+1; i++ ) + for ( long i = nYTop; i <= nYBottom+1; i++ ) { // create new band ImplRegionBand* pNewBand = new ImplRegionBand( i, i ); diff --git a/vcl/win/gdi/salgdi2.cxx b/vcl/win/gdi/salgdi2.cxx index 2e2d3469e8bd..4167d1a78c39 100644 --- a/vcl/win/gdi/salgdi2.cxx +++ b/vcl/win/gdi/salgdi2.cxx @@ -100,7 +100,7 @@ public: void convertScanline(sal_uInt8* pSource, sal_uInt8* pDestination) { - for (int x = 0; x < mnScanlineSize; x += mnComponentSize) + for (long x = 0; x < mnScanlineSize; x += mnComponentSize) { for (int i = 0; i < mnComponentSize; ++i) { |