From 9a342458fad9a4c6a0db938becb8e4b64d7b43ec Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 26 Mar 2022 16:10:41 +0100 Subject: [PATCH] Fix a few Coverity and compil warnings. --- eeschema/dialogs/dialog_netlist.cpp | 2 +- pcbnew/dialogs/dialog_footprint_checker.cpp | 4 ++-- thirdparty/potrace/src/decompose.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eeschema/dialogs/dialog_netlist.cpp b/eeschema/dialogs/dialog_netlist.cpp index 882c8819b1..b132194ee2 100644 --- a/eeschema/dialogs/dialog_netlist.cpp +++ b/eeschema/dialogs/dialog_netlist.cpp @@ -260,7 +260,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : SetupStandardButtons( { { wxID_OK, _( "Export Netlist" ) }, { wxID_CANCEL, _( "Close" ) } } ); - for( int ii = 0; m_PanelNetType[ii] && ii < 4 + CUSTOMPANEL_COUNTMAX; ++ii ) + for( int ii = 0; (ii < 4 + CUSTOMPANEL_COUNTMAX) && m_PanelNetType[ii]; ++ii ) { if( m_PanelNetType[ii]->GetPageNetFmtName() == settings.m_NetFormatName ) { diff --git a/pcbnew/dialogs/dialog_footprint_checker.cpp b/pcbnew/dialogs/dialog_footprint_checker.cpp index 967fb02473..478f1b6ba8 100644 --- a/pcbnew/dialogs/dialog_footprint_checker.cpp +++ b/pcbnew/dialogs/dialog_footprint_checker.cpp @@ -127,9 +127,9 @@ void DIALOG_FOOTPRINT_CHECKER::runChecks() footprint->BuildPolyCourtyards( &outlineErrorHandler ); footprint->CheckFootprintAttributes( - [&]( const wxString& msg ) + [&]( const wxString& aMsg ) { - errorHandler( footprint, nullptr, DRCE_FOOTPRINT_TYPE_MISMATCH, msg, { 0, 0 } ); + errorHandler( footprint, nullptr, DRCE_FOOTPRINT_TYPE_MISMATCH, aMsg, { 0, 0 } ); } ); footprint->CheckPads( diff --git a/thirdparty/potrace/src/decompose.cpp b/thirdparty/potrace/src/decompose.cpp index cb34f29eba..ee4c630849 100644 --- a/thirdparty/potrace/src/decompose.cpp +++ b/thirdparty/potrace/src/decompose.cpp @@ -293,7 +293,7 @@ static path_t* findpath( potrace_bitmap_t* bm, int x0, int y0, int sign, int tur /* move to next point */ x += dirx; y += diry; - area += x * diry; + area += uint64_t( x ) * uint64_t( diry ); /* path complete? */ if( x == x0 && y == y0 )