From d6c7f4684280d9a6a11121a75f7ba1d7be8b04f8 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 6 Oct 2022 20:30:34 +0100 Subject: [PATCH] Formatting. --- .../drc_test_provider_diff_pair_coupling.cpp | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp b/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp index 8a30471d43..efd20e090c 100644 --- a/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp +++ b/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp @@ -272,16 +272,14 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run() { m_board = m_drcEngine->GetBoard(); - - std::map dpRuleMatches; auto evaluateDpConstraints = [&]( BOARD_ITEM *item ) -> bool { - DIFF_PAIR_KEY key; + DIFF_PAIR_KEY key; BOARD_CONNECTED_ITEM* citem = static_cast( item ); - NETINFO_ITEM* refNet = citem->GetNet(); + NETINFO_ITEM* refNet = citem->GetNet(); if( refNet && DRC_ENGINE::IsNetADiffPair( m_board, refNet, key.netP, key.netN ) ) { @@ -294,8 +292,9 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run() for( int i = 0; i < 2; i++ ) { - auto constraint = m_drcEngine->EvalRules( constraintsToCheck[ i ], item, - nullptr, item->GetLayer() ); + DRC_CONSTRAINT constraint = m_drcEngine->EvalRules( constraintsToCheck[ i ], + item, nullptr, + item->GetLayer() ); if( constraint.IsNull() || constraint.GetSeverity() == RPT_SEVERITY_IGNORE ) continue; @@ -321,7 +320,6 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run() drc_dbg( 10, wxT( "dp rule matches %d\n" ), (int) dpRuleMatches.size() ); - reportAux( wxT( "DPs evaluated:" ) ); for( auto& [ key, itemSet ] : dpRuleMatches ) @@ -378,7 +376,7 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run() dp.computedGap = gap; - auto overlay = m_drcEngine->GetDebugOverlay(); + std::shared_ptr overlay = m_drcEngine->GetDebugOverlay(); if( overlay ) { @@ -398,8 +396,8 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run() if( gapConstraint ) { - auto val = gapConstraint->GetValue(); - bool insideRange = true; + const MINOPTMAX& val = gapConstraint->GetValue(); + bool insideRange = true; if( val.HasMin() && gap < val.Min() ) insideRange = false; @@ -427,7 +425,7 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run() bool uncoupledViolation = false; - if( maxUncoupledConstraint && ( !itemSet.itemsP.empty() || ! itemSet.itemsN.empty() ) ) + if( maxUncoupledConstraint && ( !itemSet.itemsP.empty() || !itemSet.itemsN.empty() ) ) { const MINOPTMAX& val = maxUncoupledConstraint->GetValue(); @@ -475,7 +473,7 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run() } } - if ( gapConstraint && ( uncoupledViolation || !maxUncoupledConstraint ) ) + if( gapConstraint && ( uncoupledViolation || !maxUncoupledConstraint ) ) { for( DIFF_PAIR_COUPLED_SEGMENTS& dp : itemSet.coupled ) { @@ -489,12 +487,16 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run() gapConstraint->GetParentRule()->m_Name + wxS( " " ); if( val.HasMin() ) + { msg += wxString::Format( _( "minimum gap: %s; " ), - MessageTextFromValue( val.Min() ) ); + MessageTextFromValue( val.Min() ) ); + } if( val.HasMax() ) + { msg += wxString::Format( _( "maximum gap: %s; " ), - MessageTextFromValue( val.Max() ) ); + MessageTextFromValue( val.Max() ) ); + } msg += wxString::Format( _( "actual: %s)" ), MessageTextFromValue( dp.computedGap ) );