Minor fixes: Coverity and compil minor warnings.

This commit is contained in:
jean-pierre charras 2023-02-18 13:04:30 +01:00
parent 2315111f29
commit 07f79208b9
6 changed files with 17 additions and 13 deletions

View File

@ -213,6 +213,7 @@ EXPORT_NETLIST_PAGE::EXPORT_NETLIST_PAGE( wxNotebook* aParent, const wxString& a
m_SaveAllVoltages = nullptr; m_SaveAllVoltages = nullptr;
m_SaveAllCurrents = nullptr; m_SaveAllCurrents = nullptr;
m_SaveAllDissipations = nullptr; m_SaveAllDissipations = nullptr;
m_RunExternalSpiceCommand = nullptr;
m_custom = aCustom; m_custom = aCustom;
aParent->AddPage( this, aTitle, false ); aParent->AddPage( this, aTitle, false );

View File

@ -926,8 +926,8 @@ void SCH_SEXPR_PLUGIN::saveBitmap( SCH_BITMAP* aBitmap, int aNestLevel )
// Let's keep compatibility by changing image scale. // Let's keep compatibility by changing image scale.
if( SEXPR_SCHEMATIC_FILE_VERSION <= 20230121 ) if( SEXPR_SCHEMATIC_FILE_VERSION <= 20230121 )
{ {
BITMAP_BASE* image = aBitmap->GetImage(); BITMAP_BASE* bm_image = aBitmap->GetImage();
scale = scale * 300.0 / image->GetPPI(); scale = scale * 300.0 / bm_image->GetPPI();
} }
if( scale != 1.0 ) if( scale != 1.0 )

View File

@ -219,7 +219,9 @@ class CURSORS_GRID_TRICKS : public GRID_TRICKS
public: public:
CURSORS_GRID_TRICKS( SIM_PLOT_FRAME* aParent, WX_GRID* aGrid ) : CURSORS_GRID_TRICKS( SIM_PLOT_FRAME* aParent, WX_GRID* aGrid ) :
GRID_TRICKS( aGrid ), GRID_TRICKS( aGrid ),
m_parent( aParent ) m_parent( aParent ),
m_menuRow( 0 ),
m_menuCol( 0 )
{} {}
protected: protected:

View File

@ -74,12 +74,16 @@ void SIM_PLOT_FRAME::ReCreateHToolbar()
void SIM_PLOT_FRAME::doReCreateMenuBar() void SIM_PLOT_FRAME::doReCreateMenuBar()
{ {
COMMON_CONTROL* tool = m_toolManager->GetTool<COMMON_CONTROL>(); COMMON_CONTROL* tool = m_toolManager->GetTool<COMMON_CONTROL>();
EDA_BASE_FRAME* base_frame = dynamic_cast<EDA_BASE_FRAME*>( this );
// base_frame == nullptr should not happen, but it makes Coverity happy
wxCHECK( base_frame, /* void */ );
// wxWidgets handles the OSX Application menu behind the scenes, but that means // wxWidgets handles the OSX Application menu behind the scenes, but that means
// we always have to start from scratch with a new wxMenuBar. // we always have to start from scratch with a new wxMenuBar.
wxMenuBar* oldMenuBar = dynamic_cast<EDA_BASE_FRAME*>( this )->GetMenuBar(); wxMenuBar* oldMenuBar = base_frame->GetMenuBar();
WX_MENUBAR* menuBar = new WX_MENUBAR(); WX_MENUBAR* menuBar = new WX_MENUBAR();
//-- File menu ----------------------------------------------------------- //-- File menu -----------------------------------------------------------
// //
ACTION_MENU* fileMenu = new ACTION_MENU( false, tool ); ACTION_MENU* fileMenu = new ACTION_MENU( false, tool );
@ -153,8 +157,8 @@ void SIM_PLOT_FRAME::doReCreateMenuBar()
menuBar->Append( viewMenu, _( "&View" ) ); menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( simulationMenu, _( "&Simulation" ) ); menuBar->Append( simulationMenu, _( "&Simulation" ) );
menuBar->Append( prefsMenu, _( "&Preferences" ) ); menuBar->Append( prefsMenu, _( "&Preferences" ) );
dynamic_cast<EDA_BASE_FRAME*>( this )->AddStandardHelpMenu( menuBar ); base_frame->AddStandardHelpMenu( menuBar );
dynamic_cast<EDA_BASE_FRAME*>( this )->SetMenuBar( menuBar ); base_frame->SetMenuBar( menuBar );
delete oldMenuBar; delete oldMenuBar;
} }

View File

@ -1,5 +0,0 @@
(kicad_sch (version 20220820) (generator eeschema)
(paper "A4")
(lib_symbols)
(symbol_instances)
)

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2022 KiCad Developers, see AUTHORS.TXT for contributors. * Copyright (C) 2023 KiCad Developers, see AUTHORS.TXT for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -157,11 +157,13 @@ public:
// Debug info. // Debug info.
// Display all vectors. // Display all vectors.
*m_log << "\n";
ngspice->Command( "echo Available Vectors" ); ngspice->Command( "echo Available Vectors" );
ngspice->Command( "echo -----------------" ); ngspice->Command( "echo -----------------" );
ngspice->Command( "display" ); ngspice->Command( "display" );
// Display the original netlist. // Display the original netlist.
*m_log << "\n";
*m_log << "Original Netlist\n"; *m_log << "Original Netlist\n";
*m_log << "----------------\n"; *m_log << "----------------\n";
*m_log << netlist << "\n"; *m_log << netlist << "\n";