From 265f28afe128c16985aef8d29037090ff3df9212 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 30 Jul 2020 10:40:51 +0200 Subject: [PATCH] Fix a minor compil warning and a Coverity warning --- libs/kimath/src/geometry/shape_compound.cpp | 3 +++ utils/kicad2step/pcb/oce_utils.cpp | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/kimath/src/geometry/shape_compound.cpp b/libs/kimath/src/geometry/shape_compound.cpp index 49ab038dd2..14995d100e 100644 --- a/libs/kimath/src/geometry/shape_compound.cpp +++ b/libs/kimath/src/geometry/shape_compound.cpp @@ -52,6 +52,8 @@ SHAPE_COMPOUND::SHAPE_COMPOUND( const SHAPE_COMPOUND& aOther ) { for ( auto shape : aOther.Shapes() ) m_shapes.push_back( shape->Clone() ); + + m_dirty = true; } @@ -95,6 +97,7 @@ void SHAPE_COMPOUND::Move ( const VECTOR2I& aVector ) int SHAPE_COMPOUND::Distance( const SEG& aSeg ) const { assert(false); + return 0; // Make compiler happy } diff --git a/utils/kicad2step/pcb/oce_utils.cpp b/utils/kicad2step/pcb/oce_utils.cpp index 9ef7c3c043..769cc46772 100644 --- a/utils/kicad2step/pcb/oce_utils.cpp +++ b/utils/kicad2step/pcb/oce_utils.cpp @@ -898,7 +898,12 @@ bool PCBMODEL::WriteSTEP( const wxString& aFileName ) if( success ) { - wxRenameFile( tmpfname, fn.GetFullName(), true ); + if( !wxRenameFile( tmpfname, fn.GetFullName(), true ) ) + { + ReportMessage( wxString::Format( "Cannot rename temporary file '%s' to '%s'\n", + tmpfname, fn.GetFullName() ) ); + success = false; + } } wxSetWorkingDirectory( currCWD );