From 1a7e99ed07cf4bd946245015d60d6b5076b25acc Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 27 Apr 2023 11:49:54 +0100 Subject: [PATCH] Formatting. --- eeschema/sch_connection.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/eeschema/sch_connection.cpp b/eeschema/sch_connection.cpp index 2f1792562d..5d22580689 100644 --- a/eeschema/sch_connection.cpp +++ b/eeschema/sch_connection.cpp @@ -281,16 +281,16 @@ void SCH_CONNECTION::Clone( const SCH_CONNECTION& aOther ) else { // TODO: refactor this once we support deep nesting - for( size_t i = 0; i < m_members.size(); ++i ) + for( std::shared_ptr& member : m_members ) { auto it = std::find_if( otherMembers.begin(), otherMembers.end(), [&]( const std::shared_ptr& aTest ) { - return aTest->LocalName() == m_members[i]->LocalName(); + return aTest->LocalName() == member->LocalName(); } ); if( it != otherMembers.end() ) - m_members[i]->Clone( **it ); + member->Clone( **it ); } } } @@ -317,7 +317,7 @@ bool SCH_CONNECTION::IsDriver() const case SCH_PIN_T: { - auto pin = static_cast( Parent() ); + SCH_PIN* pin = static_cast( Parent() ); // Only annotated symbols should drive nets. return pin->IsGlobalPower() || pin->GetParentSymbol()->IsAnnotated( &m_sheet ); @@ -351,8 +351,8 @@ wxString SCH_CONNECTION::Name( bool aIgnoreSheet ) const void SCH_CONNECTION::recacheName() { - m_cached_name = - m_name.IsEmpty() ? wxString( wxT( "" ) ) : wxString( m_prefix ) << m_name << m_suffix; + m_cached_name = m_name.IsEmpty() ? wxString( wxT( "" ) ) + : wxString( m_prefix ) << m_name << m_suffix; bool prepend_path = true; @@ -375,8 +375,8 @@ void SCH_CONNECTION::recacheName() } } - m_cached_name_with_path = - prepend_path ? m_sheet.PathHumanReadable() << m_cached_name : m_cached_name; + m_cached_name_with_path = prepend_path ? m_sheet.PathHumanReadable() << m_cached_name + : m_cached_name; } @@ -386,7 +386,7 @@ void SCH_CONNECTION::SetPrefix( const wxString& aPrefix ) recacheName(); - for( const auto& m : Members() ) + for( const std::shared_ptr& m : Members() ) m->SetPrefix( aPrefix ); } @@ -397,7 +397,7 @@ void SCH_CONNECTION::SetSuffix( const wxString& aSuffix ) recacheName(); - for( const auto& m : Members() ) + for( const std::shared_ptr& m : Members() ) m->SetSuffix( aSuffix ); } @@ -467,9 +467,11 @@ const std::vector< std::shared_ptr< SCH_CONNECTION > > SCH_CONNECTION::AllMember { std::vector< std::shared_ptr< SCH_CONNECTION > > ret( m_members ); - for( const auto& member : m_members ) + for( const std::shared_ptr& member : m_members ) + { if( member->IsBus() ) ret.insert( ret.end(), member->Members().begin(), member->Members().end() ); + } return ret; } @@ -543,7 +545,7 @@ bool SCH_CONNECTION::IsSubsetOf( SCH_CONNECTION* aOther ) const if( !aOther->IsBus() ) return false; - for( const auto& member : aOther->Members() ) + for( const std::shared_ptr& member : aOther->Members() ) { if( member->FullLocalName() == FullLocalName() ) return true; @@ -558,11 +560,13 @@ bool SCH_CONNECTION::IsMemberOfBus( SCH_CONNECTION* aOther ) const if( !aOther->IsBus() ) return false; - auto me = Name( true ); + wxString me = Name( true ); - for( const auto& m : aOther->Members() ) + for( const std::shared_ptr& m : aOther->Members() ) + { if( m->Name( true ) == me ) return true; + } return false; }