diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-27 16:33:44 +0200 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-02-05 23:03:06 -0500 |
commit | d36729353fcd91266a208ed12749512eabdd4339 (patch) | |
tree | 4c19d9a2cb8a84ec5f5329188e4de6742d6a5829 /vcl/source/window/splitwin.cxx | |
parent | b43233d4a1fe38e1758a170460bb34526ec64df7 (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
(cherry picked from commit d5129a9dd68978f9eccdd4597b5b6834557c422a)
Diffstat (limited to 'vcl/source/window/splitwin.cxx')
-rw-r--r-- | vcl/source/window/splitwin.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index ceaa757dda0c..fa18d3d01eb5 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -2421,7 +2421,7 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) { ImplSplitItems& pItems = mpSplitSet->mpItems; size_t nItems = pItems.size(); - for ( sal_uInt16 i = 0; i < nItems; i++ ) + for ( size_t i = 0; i < nItems; i++ ) { pItems[i]->mnSize = mpLastSizes[i*2]; pItems[i]->mnPixSize = mpLastSizes[i*2+1]; @@ -2807,7 +2807,7 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, // calculate area, which could be affected by splitting sal_uInt16 nMin = 0; sal_uInt16 nMax = nItems; - for (sal_uInt16 i = 0; i < nItems; ++i) + for (size_t i = 0; i < nItems; ++i) { if ( pItems[i]->mbFixed ) { @@ -3140,7 +3140,7 @@ sal_uInt16 SplitWindow::GetItemPos( sal_uInt16 nId, sal_uInt16 nSetId ) const if ( pSet ) { - for ( sal_uInt16 i = 0; i < pSet->mpItems.size(); i++ ) + for ( size_t i = 0; i < pSet->mpItems.size(); i++ ) { if ( pSet->mpItems[i]->mnId == nId ) { |