From 4134db3c4749e9a225a9abfdc043bbb6e96bb9cc Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Fri, 2 Dec 2022 22:38:15 -0500 Subject: [PATCH] GCC fixes --- common/libeval/numeric_evaluator.cpp | 3 +++ common/properties/pg_editors.cpp | 2 +- common/widgets/unit_binder.cpp | 4 ++-- pcbnew/zone.cpp | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/common/libeval/numeric_evaluator.cpp b/common/libeval/numeric_evaluator.cpp index b28d4f2f73..aaf243ca97 100644 --- a/common/libeval/numeric_evaluator.cpp +++ b/common/libeval/numeric_evaluator.cpp @@ -336,6 +336,7 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken() case Unit::Mil: retval.value.dValue = 25.4 / 1000.0; break; case Unit::MM: retval.value.dValue = 1.0; break; case Unit::CM: retval.value.dValue = 10.0; break; + default: case Unit::Invalid: break; } } @@ -347,6 +348,7 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken() case Unit::Mil: retval.value.dValue = 1.0 / 1000.0; break; case Unit::MM: retval.value.dValue = 1.0 / 25.4; break; case Unit::CM: retval.value.dValue = 1.0 / 2.54; break; + default: case Unit::Invalid: break; } } @@ -358,6 +360,7 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken() case Unit::Mil: retval.value.dValue = 1.0; break; case Unit::MM: retval.value.dValue = 1000.0 / 25.4; break; case Unit::CM: retval.value.dValue = 1000.0 / 2.54; break; + default: case Unit::Invalid: break; } } diff --git a/common/properties/pg_editors.cpp b/common/properties/pg_editors.cpp index f7e12bc09a..e104e164ee 100644 --- a/common/properties/pg_editors.cpp +++ b/common/properties/pg_editors.cpp @@ -70,7 +70,7 @@ wxPGWindowList PG_UNIT_EDITOR::CreateControls( wxPropertyGrid* aPropGrid, wxPGPr if( PGPROPERTY_DISTANCE* prop = dynamic_cast( aProperty ) ) m_unitBinder->SetCoordType( prop->CoordType() ); - else if( PGPROPERTY_ANGLE* prop = dynamic_cast( aProperty ) ) + else if( dynamic_cast( aProperty ) ) m_unitBinder->SetUnits( EDA_UNITS::DEGREES ); return ret; diff --git a/common/widgets/unit_binder.cpp b/common/widgets/unit_binder.cpp index 0524e42160..d706f4d1e5 100644 --- a/common/widgets/unit_binder.cpp +++ b/common/widgets/unit_binder.cpp @@ -58,9 +58,9 @@ UNIT_BINDER::UNIT_BINDER( EDA_BASE_FRAME* aParent, const EDA_IU_SCALE& aIUScale, m_dataType( EDA_DATA_TYPE::DISTANCE ), m_precision( 0 ), m_eval( aParent->GetUserUnits() ), + m_unitsInValue( false ), m_originTransforms( aParent->GetOriginTransforms() ), - m_coordType( ORIGIN_TRANSFORMS::NOT_A_COORD ), - m_unitsInValue( false ) + m_coordType( ORIGIN_TRANSFORMS::NOT_A_COORD ) { init(); m_allowEval = allowEval && ( !m_valueCtrl || dynamic_cast( m_valueCtrl ) ); diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index 205d569cf0..dd6f143b4c 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -1392,6 +1392,8 @@ static struct ZONE_DESC { if( ZONE* zone = dynamic_cast( aItem ) ) return !zone->GetIsRuleArea() && IsCopperLayer( zone->GetFirstLayer() ); + + return false; }; auto layer = new PROPERTY_ENUM( _HKI( "Layer" ),