diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-21 10:26:48 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-04-21 10:27:17 +0200 |
commit | 8762aa986dbca42e61cc8fb1b2c1d2ca66bcfcbe (patch) | |
tree | af1f197feb0a40e819cc4ed74efce934935c9cae /basic | |
parent | b19ac3c4c6b4a41a1f3acac68b299fd676428a87 (diff) |
clang-tidy modernize-loop-convert in b*
Change-Id: I8ac6eb59e213eafa78e3dc4578738b53e8adef5b
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/comp/parser.cxx | 4 | ||||
-rw-r--r-- | basic/source/comp/symtbl.cxx | 7 | ||||
-rw-r--r-- | basic/source/runtime/ddectrl.cxx | 4 | ||||
-rw-r--r-- | basic/source/runtime/iosys.cxx | 4 |
4 files changed, 8 insertions, 11 deletions
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index a26f5e6e0e62..87af41228bce 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -133,8 +133,8 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm ) bClassModule = ( pm->GetModuleType() == css::script::ModuleType::CLASS ); OSL_TRACE("Parser - %s, bClassModule %d", OUStringToOString( pm->GetName(), RTL_TEXTENCODING_UTF8 ).getStr(), bClassModule ); pPool = &aPublics; - for( short i = 0; i < 26; i++ ) - eDefTypes[ i ] = SbxVARIANT; // no explicit default type + for(SbxDataType & eDefType : eDefTypes) + eDefType = SbxVARIANT; // no explicit default type aPublics.SetParent( &aGlobals ); aGlobals.SetParent( &aRtlSyms ); diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index 7d9692634b26..94f1be350434 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -245,12 +245,11 @@ sal_uInt32 SbiSymPool::Reference( const OUString& rName ) void SbiSymPool::CheckRefs() { - for (size_t i = 0; i < m_Data.size(); ++i) + for (std::unique_ptr<SbiSymDef> & r : m_Data) { - SbiSymDef &r = *m_Data[ i ]; - if( !r.IsDefined() ) + if( !r->IsDefined() ) { - pParser->Error( ERRCODE_BASIC_UNDEF_LABEL, r.GetName() ); + pParser->Error( ERRCODE_BASIC_UNDEF_LABEL, r->GetName() ); } } } diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx index 4e965d3c9a84..384d19dd8ade 100644 --- a/basic/source/runtime/ddectrl.cxx +++ b/basic/source/runtime/ddectrl.cxx @@ -138,10 +138,8 @@ SbError SbiDdeControl::Terminate( size_t nChannel ) SbError SbiDdeControl::TerminateAll() { - for (size_t nChannel = 0; nChannel < aConvList.size(); ++nChannel) + for (DdeConnection* conv : aConvList) { - DdeConnection *conv = aConvList[nChannel]; - if (conv != DDE_FREECHANNEL) { delete conv; diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index 8e72688392fc..f08edc8d0061 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -657,9 +657,9 @@ SbError SbiStream::Write( const OString& rBuf ) SbiIoSystem::SbiIoSystem() { - for( short i = 0; i < CHANNELS; i++ ) + for(SbiStream* & i : pChan) { - pChan[ i ] = nullptr; + i = nullptr; } nChan = 0; nError = 0; |