Browse Source

Fix a few Coverity warnings.

pull/16/head
Wayne Stambaugh 6 years ago
parent
commit
9c99286385
  1. 6
      eeschema/files-io.cpp
  2. 1
      eeschema/sch_sexpr_plugin.cpp
  3. 2
      eeschema/tools/sch_editor_control.cpp
  4. 3
      pcbnew/pcbnew_settings.cpp

6
eeschema/files-io.cpp

@ -470,8 +470,10 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
"new file format cannot be opened with previous versions of KiCad." ) );
newFileFormatDlg.ShowCheckBox( _( "Do not show this dialog again." ) );
newFileFormatDlg.ShowModal();
cfg->m_Appearance.show_sexpr_file_convert_warning =
!newFileFormatDlg.IsCheckBoxChecked();
if( cfg )
cfg->m_Appearance.show_sexpr_file_convert_warning =
!newFileFormatDlg.IsCheckBoxChecked();
}
// Allow the schematic to be saved to new file format without making any edits.

1
eeschema/sch_sexpr_plugin.cpp

@ -471,6 +471,7 @@ SCH_SHEET* SCH_SEXPR_PLUGIN::Load( const wxString& aFileName, KIWAY* aKiway,
// If we got here, the schematic loaded successfully.
sheet = newSheet.release();
m_rootSheet = nullptr; // Quiet Coverity warning.
}
else
{

2
eeschema/tools/sch_editor_control.cpp

@ -854,7 +854,7 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
{
SCH_CONNECTION* pin_conn = comp->GetConnectionForPin( pin, *g_CurrentSheet );
if( pin_conn && pin_conn->Name( false ) == selectedNetName )
if( comp && pin_conn && pin_conn->Name( false ) == selectedNetName )
{
comp->BrightenPin( pin );
redraw = true;

3
pcbnew/pcbnew_settings.cpp

@ -46,6 +46,7 @@ const int pcbnewSchemaVersion = 0;
PCBNEW_SETTINGS::PCBNEW_SETTINGS() : APP_SETTINGS_BASE( "pcbnew", pcbnewSchemaVersion ),
m_Use45DegreeGraphicSegments( false ),
m_FlipLeftRight( false ),
m_ShowPageLimits( true ),
m_MagneticPads( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ),
m_MagneticTracks( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ),
m_MagneticGraphics( true ),
@ -666,4 +667,4 @@ bool PCBNEW_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
viewer3d->Load();
return ret;
}
}
Loading…
Cancel
Save