Clean up some compiler warnings.

This commit is contained in:
Jeff Young 2020-10-03 21:40:36 +01:00
parent d9fd6e549b
commit 44580acee2
7 changed files with 19 additions and 23 deletions

View File

@ -1194,7 +1194,7 @@ int SCH_EDIT_FRAME::RecomputeIntersheetsRefs()
iref = new SCH_IREF();
gLabel->SetIref( iref );
iref->SetParent( gLabel );
iref->SetParentLabel( gLabel );
iref->SetFlags( IS_NEW );
iref->SetScreen( screen );

View File

@ -35,9 +35,8 @@ SCH_IREF::SCH_IREF( const wxPoint& pos, const wxString& text, SCH_GLOBALLABEL* a
SCH_TEXT( pos, text, SCH_IREF_T )
{
m_Layer = LAYER_GLOBLABEL;
m_parent = aParent;
m_parentLabel = aParent;
SetMultilineAllowed( false );
m_ownPageNumber = 0;
m_screen = nullptr;
}
@ -46,9 +45,9 @@ void SCH_IREF::PlaceAtDefaultPosition()
{
wxPoint offset;
int labelLen = m_parent->GetBoundingBox().GetSizeMax();
int labelLen = m_parentLabel->GetBoundingBox().GetSizeMax();
switch( m_parent->GetLabelSpinStyle() )
switch( m_parentLabel->GetLabelSpinStyle() )
{
default:
case LABEL_SPIN_STYLE::LEFT: offset.x -= labelLen; break;
@ -57,12 +56,12 @@ void SCH_IREF::PlaceAtDefaultPosition()
case LABEL_SPIN_STYLE::BOTTOM: offset.y += labelLen; break;
}
SetTextPos( m_parent->GetPosition() + offset );
SetTextPos( m_parentLabel->GetPosition() + offset );
}
wxPoint SCH_IREF::GetSchematicTextOffset( RENDER_SETTINGS* aSettings ) const
{
return m_parent->GetSchematicTextOffset( aSettings );
return m_parentLabel->GetSchematicTextOffset( aSettings );
}
@ -115,11 +114,11 @@ void SCH_IREF::SetIrefOrientation( LABEL_SPIN_STYLE aSpinStyle )
void SCH_IREF::CopyParentStyle()
{
SetTextSize( m_parent->GetTextSize() );
SetItalic( m_parent->IsItalic() );
SetBold( m_parent->IsBold() );
SetTextThickness( m_parent->GetTextThickness() );
SetIrefOrientation( m_parent->GetLabelSpinStyle() );
SetTextSize( m_parentLabel->GetTextSize() );
SetItalic( m_parentLabel->IsItalic() );
SetBold( m_parentLabel->IsBold() );
SetTextThickness( m_parentLabel->GetTextThickness() );
SetIrefOrientation( m_parentLabel->GetLabelSpinStyle() );
}

View File

@ -64,9 +64,9 @@ public:
wxPoint GetSchematicTextOffset( RENDER_SETTINGS* aSettings ) const override;
SCH_GLOBALLABEL* GetParent() { return m_parent; }
SCH_GLOBALLABEL* GetParentLabel() { return m_parentLabel; }
void SetParent( SCH_GLOBALLABEL* parent ) { m_parent = parent; }
void SetParentLabel( SCH_GLOBALLABEL* parent ) { m_parentLabel = parent; }
SCH_SCREEN* GetScreen() { return m_screen; }
@ -82,8 +82,7 @@ private:
using EDA_ITEM::SetParent;
std::vector<int> m_refTable;
SCH_GLOBALLABEL* m_parent;
int m_ownPageNumber;
SCH_GLOBALLABEL* m_parentLabel;
SCH_SCREEN* m_screen;
};

View File

@ -77,10 +77,10 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
&m_IntersheetsRefFormatShort, defaultIntersheetsRefFormatShort ) );
m_params.emplace_back( new PARAM<wxString>( "drawing.intersheets_ref_prefix",
&m_IntersheetsRefPrefix, "[" ) );
&m_IntersheetsRefPrefix, defaultIntersheetsRefPrefix ) );
m_params.emplace_back( new PARAM<wxString>( "drawing.intersheets_ref_suffix",
&m_IntersheetsRefSuffix, "]" ) );
&m_IntersheetsRefSuffix, defaultIntersheetsRefSuffix ) );
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.default_line_thickness",
&m_DefaultLineWidth, Mils2iu( defaultLineThickness ),

View File

@ -721,7 +721,7 @@ void SCH_MOVE_TOOL::moveItem( EDA_ITEM* aItem, const VECTOR2I& aDelta )
SCH_IREF* iref = static_cast<SCH_IREF*>( aItem );
wxPoint pt = (wxPoint) aDelta;
int style = iref->GetParent()->GetLabelSpinStyle();
int style = iref->GetParentLabel()->GetLabelSpinStyle();
if( iref->GetParent()->IsSelected() )
break;

View File

@ -377,7 +377,6 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
return true;
};
int numItems =
forEachGeometryItem( { PCB_TRACE_T, PCB_VIA_T, PCB_PAD_T, PCB_ZONE_AREA_T, PCB_ARC_T },
LSET::AllCuMask(), addToTree );

View File

@ -221,7 +221,6 @@ bool DRC_TEST_PROVIDER_HOLE_CLEARANCE::doPadToPadHoleDrc( int aRefPadIdx,
const static LSET all_cu = LSET::AllCuMask();
D_PAD* refPad = aSortedPadsList[aRefPadIdx];
LSET layerMask = refPad->GetLayerSet() & all_cu;
for( int idx = aRefPadIdx; idx < (int)aSortedPadsList.size(); ++idx )
{