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 --- unotools/source/config/searchopt.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'unotools') diff --git a/unotools/source/config/searchopt.cxx b/unotools/source/config/searchopt.cxx index 3c442ab4ad53..87dc3e0ab9b4 100644 --- a/unotools/source/config/searchopt.cxx +++ b/unotools/source/config/searchopt.cxx @@ -177,7 +177,7 @@ bool SvtSearchOptions_Impl::Load() bSucc = true; const Any* pValues = aValues.getConstArray(); - for (sal_uInt16 i = 0; i < nProps; ++i) + for (sal_Int32 i = 0; i < nProps; ++i) { const Any &rVal = pValues[i]; DBG_ASSERT( rVal.hasValue(), "property value missing" ); @@ -227,7 +227,7 @@ bool SvtSearchOptions_Impl::Save() "unexpected size of index" ); if (nProps && nProps == MAX_FLAGS_OFFSET + 1) { - for (sal_uInt16 i = 0; i < nProps; ++i) + for (sal_Int32 i = 0; i < nProps; ++i) pValue[i] <<= GetFlag(i); bSucc |= PutProperties( aNames, aValues ); } -- cgit