Fix some minor compil and Coverity warnings.

This commit is contained in:
jean-pierre charras 2023-08-17 10:06:02 +02:00
parent 953cf0d680
commit 53b2fda184
10 changed files with 13 additions and 9 deletions

View File

@ -396,7 +396,7 @@ void EDA_3D_VIEWER_FRAME::NewDisplay( bool aForceImmediateRedraw )
// After the ReloadRequest call, the refresh often takes a bit of time,
// and it is made here only on request.
if( aForceImmediateRedraw )
if( m_canvas && aForceImmediateRedraw )
m_canvas->Refresh();
}

View File

@ -81,7 +81,8 @@ APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent,
wxWindow* aFocusOwner ) :
APPEARANCE_CONTROLS_3D_BASE( aParent ),
m_frame( aParent ),
m_focusOwner( aFocusOwner )
m_focusOwner( aFocusOwner ),
m_lastSelectedViewport( nullptr )
{
DPI_SCALING dpi( nullptr, m_frame );

View File

@ -27,6 +27,7 @@
JOB_DISPATCHER::JOB_DISPATCHER()
{
m_reporter = &NULL_REPORTER::GetInstance();
m_progressReporter = nullptr;
}

View File

@ -344,7 +344,7 @@ bool LIB_TABLE::RemoveRow( const LIB_TABLE_ROW* aRow )
if( !found )
{
// Bookkeeping got messed up...
for( size_t i = m_rows.size() - 1; i >= 0; --i )
for( int i = (int)m_rows.size() - 1; i >= 0; --i )
{
if( &m_rows[i] == aRow )
{

View File

@ -73,6 +73,7 @@ TOOL_ACTION::TOOL_ACTION( const TOOL_ACTION_ARGS& aArgs ) :
m_defaultHotKey( aArgs.m_defaultHotKey.value_or( 0 ) ),
m_defaultHotKeyAlt( aArgs.m_defaultHotKeyAlt.value_or( 0 ) ),
m_hotKey( aArgs.m_defaultHotKey.value_or( 0 ) ),
m_hotKeyAlt( 0 ),
m_legacyName( aArgs.m_legacyName.value_or( "" ) ),
m_label( TowxString( aArgs.m_menuText.value_or( "" ) ) ),
m_tooltip( TowxString( aArgs.m_tooltip.value_or( "" ) ) ),

View File

@ -370,12 +370,13 @@ void DIALOG_CHANGE_SYMBOLS::checkAll( bool aCheck )
void DIALOG_CHANGE_SYMBOLS::onOkButtonClicked( wxCommandEvent& aEvent )
{
wxBusyCursor dummy;
SCH_EDIT_FRAME* parent = dynamic_cast<SCH_EDIT_FRAME*>( GetParent() );
SCH_COMMIT commit( parent );
wxCHECK( parent, /* void */ );
wxBusyCursor dummy;
SCH_COMMIT commit( parent );
m_messagePanel->Clear();
m_messagePanel->Flush( false );

View File

@ -28,6 +28,7 @@ struct DATA_MODEL_ROW
{
DATA_MODEL_ROW( const SCH_REFERENCE& aFirstReference, GROUP_TYPE aType )
{
m_ItemNumber = 0;
m_Refs.push_back( aFirstReference );
m_Flag = aType;
}

View File

@ -129,7 +129,7 @@ struct ERULES
class EAGLE_PLUGIN : public PLUGIN, public LAYER_REMAPPABLE_PLUGIN
{
public:
const wxString PluginName() const { return wxT( "Eagle" ); }
const wxString PluginName() const override { return wxT( "Eagle" ); }
PLUGIN_FILE_DESC GetBoardFileDesc() const override
{

View File

@ -842,7 +842,6 @@ FOOTPRINT* GPCB_PLUGIN::ImportFootprint( const wxString& aFootprintPath,
FILE_LINE_READER freader( aFootprintPath );
WHITESPACE_FILTER_READER reader( freader );
IO_MGR::PCB_FILE_T file_type;
reader.ReadLine();
char* line = reader.Line();

View File

@ -38,9 +38,9 @@ public:
PCAD_PLUGIN();
~PCAD_PLUGIN();
const wxString PluginName() const { return wxT( "P-Cad" ); }
const wxString PluginName() const override { return wxT( "P-Cad" ); }
PLUGIN_FILE_DESC GetBoardFileDesc() const
PLUGIN_FILE_DESC GetBoardFileDesc() const override
{
return PLUGIN_FILE_DESC( _HKI( "P-Cad 200x ASCII PCB files" ), { "pcb" } );
}