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 /accessibility | |
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 'accessibility')
6 files changed, 16 insertions, 16 deletions
diff --git a/accessibility/source/extended/accessibletabbar.cxx b/accessibility/source/extended/accessibletabbar.cxx index 5a368d7b4629..74fe20044f2b 100644 --- a/accessibility/source/extended/accessibletabbar.cxx +++ b/accessibility/source/extended/accessibletabbar.cxx @@ -179,7 +179,7 @@ namespace accessibility AccessibleTabBarBase::disposing(); // dispose all children - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XComponent > xComponent( m_aAccessibleChildren[i], UNO_QUERY ); if ( xComponent.is() ) @@ -399,7 +399,7 @@ namespace accessibility OExternalLockGuard aGuard( this ); Reference< XAccessible > xChild; - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XAccessible > xAcc = getAccessibleChild( i ); if ( xAcc.is() ) diff --git a/accessibility/source/extended/accessibletabbarpagelist.cxx b/accessibility/source/extended/accessibletabbarpagelist.cxx index 8ca51866948c..33b5dd518f97 100644 --- a/accessibility/source/extended/accessibletabbarpagelist.cxx +++ b/accessibility/source/extended/accessibletabbarpagelist.cxx @@ -80,7 +80,7 @@ namespace accessibility void AccessibleTabBarPageList::UpdateShowing( bool bShowing ) { - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XAccessible > xChild( m_aAccessibleChildren[i] ); if ( xChild.is() ) @@ -399,7 +399,7 @@ namespace accessibility AccessibleTabBarBase::disposing(); // dispose all children - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XComponent > xComponent( m_aAccessibleChildren[i], UNO_QUERY ); if ( xComponent.is() ) @@ -580,7 +580,7 @@ namespace accessibility OExternalLockGuard aGuard( this ); Reference< XAccessible > xChild; - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XAccessible > xAcc = getAccessibleChild( i ); if ( xAcc.is() ) diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 1a391ce13f04..ca205003f344 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -1416,7 +1416,7 @@ Document::retrieveParagraphBoundaryOfLine( Paragraph const * pParagraph, static_cast< css::uno::XWeak * >( this ) ); ::sal_Int32 nLineStart = 0; ::sal_Int32 nLineEnd = 0; - for ( ::sal_uInt16 nLine = 0; nLine <= nLineNo; ++nLine ) + for ( ::sal_Int32 nLine = 0; nLine <= nLineNo; ++nLine ) { ::sal_Int32 nLineLength = static_cast< ::sal_Int32 >( m_rEngine.GetLineLen( nNumber, nLine ) ); diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx b/accessibility/source/standard/accessiblemenubasecomponent.cxx index 9ab7b0c6849d..47312f7fa914 100644 --- a/accessibility/source/standard/accessiblemenubasecomponent.cxx +++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx @@ -248,7 +248,7 @@ void OAccessibleMenuBaseComponent::UpdateFocused( sal_Int32 i, bool bFocused ) void OAccessibleMenuBaseComponent::UpdateVisible() { SetVisible( IsVisible() ); - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XAccessible > xChild( m_aAccessibleChildren[i] ); if ( xChild.is() ) @@ -489,7 +489,7 @@ bool OAccessibleMenuBaseComponent::IsChildHighlighted() { bool bChildHighlighted = false; - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XAccessible > xChild( m_aAccessibleChildren[i] ); if ( xChild.is() ) @@ -669,7 +669,7 @@ void OAccessibleMenuBaseComponent::ProcessMenuEvent( const VclMenuEvent& rVclMen m_pMenu = NULL; // dispose all menu items - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XComponent > xComponent( m_aAccessibleChildren[i], UNO_QUERY ); if ( xComponent.is() ) @@ -713,7 +713,7 @@ void OAccessibleMenuBaseComponent::disposing() m_pMenu = NULL; // dispose all menu items - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XComponent > xComponent( m_aAccessibleChildren[i], UNO_QUERY ); if ( xComponent.is() ) diff --git a/accessibility/source/standard/vclxaccessiblestatusbar.cxx b/accessibility/source/standard/vclxaccessiblestatusbar.cxx index 42d1db5eb38e..d450f84e8c82 100644 --- a/accessibility/source/standard/vclxaccessiblestatusbar.cxx +++ b/accessibility/source/standard/vclxaccessiblestatusbar.cxx @@ -207,7 +207,7 @@ void VCLXAccessibleStatusBar::ProcessWindowEvent( const VclWindowEvent& rVclWind case VCLEVENT_STATUSBAR_SHOWALLITEMS: case VCLEVENT_STATUSBAR_HIDEALLITEMS: { - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) UpdateShowing( i, rVclWindowEvent.GetId() == VCLEVENT_STATUSBAR_SHOWALLITEMS ); } break; @@ -238,7 +238,7 @@ void VCLXAccessibleStatusBar::ProcessWindowEvent( const VclWindowEvent& rVclWind m_pStatusBar = NULL; // dispose all children - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XComponent > xComponent( m_aAccessibleChildren[i], UNO_QUERY ); if ( xComponent.is() ) @@ -268,7 +268,7 @@ void VCLXAccessibleStatusBar::disposing() m_pStatusBar = NULL; // dispose all children - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XComponent > xComponent( m_aAccessibleChildren[i], UNO_QUERY ); if ( xComponent.is() ) diff --git a/accessibility/source/standard/vclxaccessibletabcontrol.cxx b/accessibility/source/standard/vclxaccessibletabcontrol.cxx index 26ffc8ebd81e..a3425762630c 100644 --- a/accessibility/source/standard/vclxaccessibletabcontrol.cxx +++ b/accessibility/source/standard/vclxaccessibletabcontrol.cxx @@ -59,7 +59,7 @@ VCLXAccessibleTabControl::~VCLXAccessibleTabControl() void VCLXAccessibleTabControl::UpdateFocused() { - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XAccessible > xChild( m_aAccessibleChildren[i] ); if ( xChild.is() ) @@ -243,7 +243,7 @@ void VCLXAccessibleTabControl::ProcessWindowEvent( const VclWindowEvent& rVclWin m_pTabControl = NULL; // dispose all tab pages - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XComponent > xComponent( m_aAccessibleChildren[i], UNO_QUERY ); if ( xComponent.is() ) @@ -326,7 +326,7 @@ void VCLXAccessibleTabControl::disposing() m_pTabControl = NULL; // dispose all tab pages - for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i ) + for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) { Reference< XComponent > xComponent( m_aAccessibleChildren[i], UNO_QUERY ); if ( xComponent.is() ) |