Fix a few compil and Coverity warnings.

This commit is contained in:
jean-pierre charras 2022-08-19 10:42:47 +02:00
parent 3a718385cf
commit e0fbe2542f
3 changed files with 9 additions and 5 deletions

View File

@ -35,10 +35,13 @@
BITMAP_BUTTON::BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, const wxPoint& aPos,
const wxSize& aSize, int aStyles ) :
wxPanel( aParent, aId, aPos, aSize, aStyles ),
m_isRadioButton( false ), m_buttonState( 0 ), m_padding( 0 ),
m_acceptDraggedInClicks( false ), m_showBadge( false ),
m_isRadioButton( false ),
m_showBadge( false ),
m_badgeColor( wxColor( 210, 0, 0, 0 ) ), // dark red
m_badgeTextColor( wxColor( wxT( "white" ) ) )
m_badgeTextColor( wxColor( wxT( "white" ) ) ),
m_buttonState( 0 ),
m_padding( 0 ),
m_acceptDraggedInClicks( false )
{
if( aSize == wxDefaultSize )
SetMinSize( wxButton::GetDefaultSize() + wxSize( m_padding * 2, m_padding * 2) );
@ -53,6 +56,7 @@ BITMAP_BUTTON::BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, const wxBitmap&
const wxPoint& aPos, const wxSize& aSize, int aStyles ) :
wxPanel( aParent, aId, aPos, aSize, aStyles ),
m_isRadioButton( false ),
m_showBadge( false ),
m_buttonState( 0 ),
m_padding( 5 ),
m_acceptDraggedInClicks( false )

View File

@ -86,7 +86,7 @@ struct PACKAGE_VERSION
// Not serialized fields
std::tuple<int, int, int, int> parsed_version; // Full version tuple for sorting
bool compatible;
bool compatible = true;
};

View File

@ -1596,7 +1596,7 @@ int PCB_SELECTION_TOOL::selectSameSheet( const TOOL_EVENT& aEvent )
FOOTPRINT* footprint = dynamic_cast<FOOTPRINT*>( item );
if( footprint->GetPath().empty() )
if( !footprint || footprint->GetPath().empty() )
return 0;
ClearSelection( true /*quiet mode*/ );