Fix a few compil and Coverity warnings.

This commit is contained in:
jean-pierre charras 2020-04-25 08:49:16 +02:00
parent 9af88d79ea
commit 4f369801f2
4 changed files with 8 additions and 3 deletions

View File

@ -492,6 +492,7 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE
return _( "cu. in" );
}
}
break; // Make compil happy.
case EDA_UNITS::MILLIMETRES:
switch( aType )
@ -503,6 +504,7 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE
case EDA_DATA_TYPE::VOLUME:
return _( "cu. mm" );
}
break; // Make compil happy.
case EDA_UNITS::PERCENT:
return _( "%" );
@ -514,8 +516,10 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE
return _( "deg" );
default:
return wxT( "??" );
break;
}
return wxT( "??" );
}

View File

@ -89,6 +89,7 @@ EDA_TEXT::EDA_TEXT( const wxString& text ) :
{
int sz = Mils2iu( DEFAULT_SIZE_TEXT );
SetTextSize( wxSize( sz, sz ) );
m_shown_text_has_text_var_refs = false;
if( !text.IsEmpty() )
{

View File

@ -568,7 +568,7 @@ const wxPoint SCH_FIELD::GetPosition() const
wxPoint SCH_FIELD::GetParentPosition() const
{
return m_Parent->GetPosition();
return m_Parent ? m_Parent->GetPosition() : wxPoint( 0, 0 );
}

View File

@ -214,7 +214,7 @@ void PCB_DRAW_PANEL_GAL::UpdateColors()
else
cs = Pgm().GetSettingsManager().GetColorSettings();
wxASSERT( cs );
wxCHECK_RET( cs, "null COLOR_SETTINGS" );
if( frame && frame->IsType( FRAME_FOOTPRINT_EDITOR ) )
cs->SetColorContext( COLOR_CONTEXT::FOOTPRINT );