From b05b33a9ff91f74ef4c678f4a183f564c731e2a3 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 21 Feb 2023 11:54:38 +0100 Subject: [PATCH] Fix a compil issue with gcc12.2 and Coverity warnings. --- common/page_info.cpp | 6 +++--- eeschema/sim/sim_plot_frame.cpp | 4 +++- eeschema/tools/simulator_control.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/common/page_info.cpp b/common/page_info.cpp index 0d3b01a9ec..61a651d65d 100644 --- a/common/page_info.cpp +++ b/common/page_info.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 2012 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 * modify it under the terms of the GNU General Public License @@ -171,7 +171,7 @@ bool PAGE_INFO::SetType( const wxString& aType, bool aIsPortrait ) if( aIsPortrait ) { // all private PAGE_INFOs are landscape, must swap x and y - m_size = VECTOR2I( m_size.y, m_size.x ); + std::swap( m_size.y, m_size.x ); updatePortrait(); } @@ -190,7 +190,7 @@ void PAGE_INFO::SetPortrait( bool aIsPortrait ) if( m_portrait != aIsPortrait ) { // swap x and y in m_size - m_size = VECTOR2I( m_size.y, m_size.x ); + std::swap( m_size.y, m_size.x ); m_portrait = aIsPortrait; diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index 91f1199dc9..1c3a56ebd6 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -278,7 +278,9 @@ class MEASUREMENTS_GRID_TRICKS : public GRID_TRICKS public: MEASUREMENTS_GRID_TRICKS( SIM_PLOT_FRAME* aParent, WX_GRID* aGrid ) : GRID_TRICKS( aGrid ), - m_parent( aParent ) + m_parent( aParent ), + m_menuRow( 0 ), + m_menuCol( 0 ) {} protected: diff --git a/eeschema/tools/simulator_control.cpp b/eeschema/tools/simulator_control.cpp index 9429c854c9..f292b72c2d 100644 --- a/eeschema/tools/simulator_control.cpp +++ b/eeschema/tools/simulator_control.cpp @@ -389,7 +389,7 @@ int SIMULATOR_CONTROL::ShowNetlist( const TOOL_EVENT& aEvent ) m_circuitModel->SetSimOptions( m_plotFrame->GetCurrentOptions() ); m_circuitModel->GetNetlist( &formatter, reporter ); - NETLIST_VIEW_DIALOG dlg( m_plotFrame, errors.IsEmpty() ? formatter.GetString() : errors ); + NETLIST_VIEW_DIALOG dlg( m_plotFrame, errors.IsEmpty() ? wxString( formatter.GetString() ) : errors ); dlg.ShowModal(); return 0;