Fix a few minor compil and Coverity warnings.

This commit is contained in:
jean-pierre charras 2023-08-17 17:32:11 +02:00
parent 43fe1eec84
commit a7e74bf4bc
4 changed files with 7 additions and 11 deletions

View File

@ -476,7 +476,6 @@ void DIALOG_ERC::testErc()
SCHEMATIC* sch = &m_parent->Schematic();
SCH_SCREENS screens( sch->Root() );
ERC_SETTINGS& settings = sch->ErcSettings();
ERC_TESTER tester( sch );
{

View File

@ -133,9 +133,7 @@ FOOTPRINT* FOOTPRINT_EDIT_FRAME::ImportFootprint( const wxString& aName )
if( !fn.IsOk() )
return nullptr;
FILE* fp = wxFopen( fn.GetFullPath(), wxT( "rt" ) );
if( !fp )
if( !wxFileExists( fn.GetFullPath() ) )
{
wxString msg = wxString::Format( _( "File '%s' not found." ), fn.GetFullPath() );
DisplayError( this, msg );

View File

@ -67,9 +67,9 @@ bool PLUGIN::CanReadBoard( const wxString& aFileName ) const
wxString fileExt = wxFileName( aFileName ).GetExt().MakeLower();
for( const wxString& ext : exts )
for( const std::string& ext : exts )
{
if( fileExt == ext.Lower() )
if( fileExt == wxString( ext ).Lower() )
return true;
}
@ -83,9 +83,9 @@ bool PLUGIN::CanReadFootprint( const wxString& aFileName ) const
wxString fileExt = wxFileName( aFileName ).GetExt().MakeLower();
for( const wxString& ext : exts )
for( const std::string& ext : exts )
{
if( fileExt == ext.Lower() )
if( fileExt == wxString( ext ).Lower() )
return true;
}
@ -103,9 +103,9 @@ bool PLUGIN::CanReadFootprintLib( const wxString& aFileName ) const
wxString fileExt = wxFileName( aFileName ).GetExt().MakeLower();
for( const wxString& ext : exts )
for( const std::string& ext : exts )
{
if( fileExt == ext.Lower() )
if( fileExt == wxString( ext ).Lower() )
return true;
}
}

View File

@ -437,7 +437,6 @@ bool LEGACY_PLUGIN::CanReadFootprint( const wxString& aFileName ) const
FILE_LINE_READER freader( aFileName );
WHITESPACE_FILTER_READER reader( freader );
IO_MGR::PCB_FILE_T file_type;
reader.ReadLine();
char* line = reader.Line();