From dac78d2562076c5f33e22ee92a9a3db548e313d4 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 10 Apr 2020 18:28:12 +0200 Subject: [PATCH] fix a few minor Coverity warnings. --- eeschema/sch_sexpr_parser.cpp | 5 +++-- pcbnew/altium2kicadpcb_plugin/altium_parser_pcb.cpp | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_sexpr_parser.cpp b/eeschema/sch_sexpr_parser.cpp index 3a80205ea1..51dceb4ac1 100644 --- a/eeschema/sch_sexpr_parser.cpp +++ b/eeschema/sch_sexpr_parser.cpp @@ -63,6 +63,7 @@ using namespace TSCHEMATIC_T; SCH_SEXPR_PARSER::SCH_SEXPR_PARSER( LINE_READER* aLineReader ) : SCHEMATIC_LEXER( aLineReader ), m_requiredVersion( 0 ), + m_fieldId( 0 ), m_unit( 1 ), m_convert( 1 ) { @@ -1801,7 +1802,7 @@ void SCH_SEXPR_PARSER::parseSchSymbolInstances( std::unique_ptr& { NeedSYMBOL(); - int unit; + int unit = 1; wxString reference; KIID_PATH path( FromUTF8() ); @@ -1932,7 +1933,7 @@ SCH_COMPONENT* SCH_SEXPR_PARSER::parseSchematicSymbol() wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a symbol." ) ); T token; - int orientation; + int orientation = CMP_ORIENT_0; wxString tmp; SCH_FIELD* field; std::unique_ptr symbol( new SCH_COMPONENT() ); diff --git a/pcbnew/altium2kicadpcb_plugin/altium_parser_pcb.cpp b/pcbnew/altium2kicadpcb_plugin/altium_parser_pcb.cpp index 081a83e736..8c4f104f12 100644 --- a/pcbnew/altium2kicadpcb_plugin/altium_parser_pcb.cpp +++ b/pcbnew/altium2kicadpcb_plugin/altium_parser_pcb.cpp @@ -130,7 +130,7 @@ ALTIUM_LAYER altium_layer_from_name( const wxString& aName ) if( it == hash_map.end() ) { wxLogError( wxString::Format( - _( "Unknown mapping of the Altium layer '%s'. Please report as issue." ), aName ) ); + "Unknown mapping of the Altium layer '%s'. Please report as issue.", aName ) ); return ALTIUM_LAYER::UNKNOWN; } else @@ -450,6 +450,12 @@ APOLYGON6::APOLYGON6( ALTIUM_PARSER& aReader ) ARULE6::ARULE6( ALTIUM_PARSER& aReader ) { + // Initalize all variables and make Coverity happy + planeclearanceClearance = 0; + polygonconnectAirgapwidth = 0; + polygonconnectReliefconductorwidth = 0; + polygonconnectReliefentries = 0; + aReader.Skip( 2 ); std::map properties = aReader.ReadProperties();