From d5129a9dd68978f9eccdd4597b5b6834557c422a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 27 May 2015 16:33:44 +0200 Subject: new clang plugin: loopvartoosmall Idea from bubli - look for loops where the index variable is of such size that it cannot cover the range revealed by examining the length part of the condition. So far, I have only run the plugin up till the VCL module. Also the plugin deliberately excludes anything more complicated than a straightforward incrementing for loop. Change-Id: Ifced18b01c03ea537c64168465ce0b8287a42015 --- vcl/source/opengl/OpenGLHelper.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl/source/opengl/OpenGLHelper.cxx') diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index 3acb0c667a94..33cea5c7189b 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -231,11 +231,11 @@ BitmapEx OpenGLHelper::ConvertBGRABufferToBitmapEx(const sal_uInt8* const pBuffe AlphaMask::ScopedWriteAccess pAlphaWriteAccess( aAlpha ); size_t nCurPos = 0; - for( int y = 0; y < nHeight; ++y) + for( long y = 0; y < nHeight; ++y) { Scanline pScan = pWriteAccess->GetScanline(y); Scanline pAlphaScan = pAlphaWriteAccess->GetScanline(y); - for( int x = 0; x < nWidth; ++x ) + for( long x = 0; x < nWidth; ++x ) { *pScan++ = pBuffer[nCurPos]; *pScan++ = pBuffer[nCurPos+1]; -- cgit