diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-27 16:33:44 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-28 12:49:54 +0200 |
commit | d5129a9dd68978f9eccdd4597b5b6834557c422a (patch) | |
tree | df43250172f784f3048ce42ce1c3410d1d449c1e /vcl/source/edit/textdata.cxx | |
parent | f3331f7694e74f349375c223ce7ed84838e92d89 (diff) |
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
Diffstat (limited to 'vcl/source/edit/textdata.cxx')
-rw-r--r-- | vcl/source/edit/textdata.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx index 30eb44e05f28..80d1680d14e5 100644 --- a/vcl/source/edit/textdata.cxx +++ b/vcl/source/edit/textdata.cxx @@ -74,7 +74,7 @@ sal_uInt16 TETextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPor { // find left portion at nCharPos at portion border sal_uInt16 nTmpPos = 0; - for ( sal_uInt16 nPortion = 0; nPortion < size(); nPortion++ ) + for ( size_t nPortion = 0; nPortion < size(); nPortion++ ) { TETextPortion* pPortion = operator[]( nPortion ); nTmpPos = nTmpPos + pPortion->GetLen(); @@ -161,7 +161,7 @@ void TEParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /*nEnd*/ sal_uInt16 TEParaPortion::GetLineNumber( sal_uInt16 nChar, bool bInclEnd ) { - for ( sal_uInt16 nLine = 0; nLine < maLines.size(); nLine++ ) + for ( size_t nLine = 0; nLine < maLines.size(); nLine++ ) { TextLine& pLine = maLines[ nLine ]; if ( ( bInclEnd && ( pLine.GetEnd() >= nChar ) ) || |