Clean up warnings from exception handlers

The exception objects caught are either not referenced at all, or only in
debug builds. This avoids the warnings for the unused variables.
This commit is contained in:
Simon Richter 2016-10-10 17:04:48 +02:00 committed by Wayne Stambaugh
parent 6d27087053
commit b0f9864bc4
18 changed files with 29 additions and 29 deletions

View File

@ -140,7 +140,7 @@ bool LIB_ALIAS::SaveDoc( OUTPUTFORMATTER& aFormatter )
aFormatter.Print( 0, "$ENDCMP\n" );
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& )
{
return false;
}

View File

@ -655,7 +655,7 @@ bool PART_LIB::Save( OUTPUTFORMATTER& aFormatter )
aFormatter.Print( 0, "#\n#End Library\n" );
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& )
{
success = false;
}
@ -680,7 +680,7 @@ bool PART_LIB::SaveDocs( OUTPUTFORMATTER& aFormatter )
aFormatter.Print( 0, "#\n#End Doc Library\n" );
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& )
{
success = false;
}

View File

@ -210,7 +210,7 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
{
backAnnotateFootprints( payload );
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& DBG( ioe ) )
{
DBG( printf( "%s: ioe:%s\n", __func__, TO_UTF8( ioe.What() ) );)
}

View File

@ -300,7 +300,7 @@ void DIALOG_BOM::installPluginsList()
{
cfg_parser.Parse();
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& )
{
// wxLogMessage( ioe.What() );
}

View File

@ -138,7 +138,7 @@ void LIB_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
{
PART_LIBS::LibNamesAndPaths( prj, false, &lib_paths, &lib_names );
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& DBG( ioe ) )
{
DBG(printf( "%s: %s\n", __func__, TO_UTF8( ioe.What() ) );)
return;
@ -198,7 +198,7 @@ void SCH_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
{
PART_LIBS::LibNamesAndPaths( prj, false, &lib_paths, &lib_names );
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& DBG( ioe ) )
{
DBG(printf( "%s: %s\n", __func__, TO_UTF8( ioe.What() ) );)
return;
@ -659,7 +659,7 @@ void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
{
m_TemplateFieldNames.Parse( &lexer );
}
catch( const IO_ERROR& e )
catch( const IO_ERROR& DBG( e ) )
{
// @todo show error msg
DBG( printf( "templatefieldnames parsing error: '%s'\n",

View File

@ -66,7 +66,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event )
std::unique_ptr<PART_LIB> new_lib( PART_LIB::LoadLibrary( fn.GetFullPath() ) );
lib = std::move( new_lib );
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& )
{
wxString msg = wxString::Format( _(
"Unable to import library '%s'. Error:\n"

View File

@ -113,7 +113,7 @@ static bool insert_library( PROJECT *aProject, PART_LIB *aLibrary, size_t aIndex
libNames.Insert( libName, aIndex );
PART_LIBS::LibNamesAndPaths( aProject, true, &libPaths, &libNames );
}
catch( const IO_ERROR& e )
catch( const IO_ERROR& )
{
// Could not get or save the current libraries.
return false;
@ -131,12 +131,12 @@ static bool insert_library( PROJECT *aProject, PART_LIB *aLibrary, size_t aIndex
{
libs->LoadAllLibraries( aProject );
}
catch( const PARSE_ERROR& e )
catch( const PARSE_ERROR& )
{
// Some libraries were not found. There's no point in showing the error,
// because it was already shown. Just don't do anything.
}
catch( const IO_ERROR& e )
catch( const IO_ERROR& )
{
// Restore the old list
libs->clear();

View File

@ -115,7 +115,7 @@ SEARCH_STACK* PROJECT::SchSearchS()
{
PART_LIBS::LibNamesAndPaths( this, false, &libDir );
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& DBG( ioe ) )
{
DBG(printf( "%s: %s\n", __func__, TO_UTF8( ioe.What() ) );)
}

View File

@ -233,7 +233,7 @@ void LIB_EDIT_FRAME::SaveOneSymbol()
formatter.Print( 0, "ENDDRAW\n" );
formatter.Print( 0, "ENDDEF\n" );
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& )
{
msg.Printf( _( "An error occurred attempting to save symbol file '%s'" ),
GetChars( fn.GetFullPath() ) );

View File

@ -103,7 +103,7 @@ bool PCB_CALCULATOR_FRAME::WriteDataFile()
while( nestlevel-- )
formatter.Print( nestlevel, ")\n" );
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& )
{
return false;
}

View File

@ -820,7 +820,7 @@ void MODULE::RunOnChildren( std::function<void (BOARD_ITEM*)> aFunction )
aFunction( static_cast<BOARD_ITEM*>( m_Reference ) );
aFunction( static_cast<BOARD_ITEM*>( m_Value ) );
}
catch( std::bad_function_call& e )
catch( std::bad_function_call& )
{
DisplayError( NULL, wxT( "Error running MODULE::RunOnChildren" ) );
}

View File

@ -255,7 +255,7 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
KICAD_NETLIST_READER netlistReader( lineReader, &netlist );
netlistReader.LoadNetlist();
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& )
{
assert( false ); // should never happen
}

View File

@ -178,7 +178,7 @@ bool WIZARD_FPLIB_TABLE::LIBRARY::Test()
{
footprints = p->FootprintEnumerate( m_path );
}
catch( IO_ERROR& e )
catch( IO_ERROR& )
{
m_status = LIBRARY::INVALID;
return false;

View File

@ -1740,7 +1740,7 @@ BOARD* PCB_IO::Load( const wxString& aFileName, BOARD* aAppendToMe, const PROPER
{
board = dynamic_cast<BOARD*>( m_parser->Parse() );
}
catch( const FUTURE_FORMAT_ERROR& parse_error )
catch( const FUTURE_FORMAT_ERROR& )
{
// Don't wrap a FUTURE_FORMAT_ERROR in another
throw;

View File

@ -366,7 +366,7 @@ const wxString FOOTPRINT_EDIT_FRAME::getLibPath()
return row->GetFullURI( true );
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& )
{
return wxEmptyString;
}
@ -409,12 +409,12 @@ void FOOTPRINT_EDIT_FRAME::restoreLastFootprint()
{
module = (MODULE*) pcb_io.Parse( pretty );
}
catch( const PARSE_ERROR& pe )
catch( const PARSE_ERROR& )
{
// unlikely to be a problem, since we produced the pretty string.
wxLogError( wxT( "PARSE_ERROR" ) );
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& )
{
// unlikely to be a problem, since we produced the pretty string.
wxLogError( wxT( "IO_ERROR" ) );
@ -767,7 +767,7 @@ void FOOTPRINT_EDIT_FRAME::updateTitle()
nickname_display = nickname;
}
catch( const IO_ERROR& ioe )
catch( const IO_ERROR& )
{
// user may be bewildered as to why after selecting a library it is not showing up
// in the title, we could show an error message, but that should have been done at time

View File

@ -60,7 +60,7 @@ CONTEXT_MENU* CONDITIONAL_MENU::Generate( SELECTION& aSelection )
if( !cond( aSelection ) )
continue;
}
catch( std::exception& e )
catch( std::exception& )
{
continue;
}

View File

@ -186,7 +186,7 @@ SCENEGRAPH* LoadVRML( const wxString& aFileName, bool useInline )
// longer lines then perhaps it shouldn't be used
modelFile = new FILE_LINE_READER( aFileName, 0, 8388608 );
}
catch( IO_ERROR &e )
catch( IO_ERROR & )
{
wxLogError( _( " * [INFO] load failed: input line too long\n" ) );
return NULL;

View File

@ -2381,7 +2381,7 @@ void IDF3_BOARD::readBoardFile( const std::string& aFileName, bool aNoSubstitute
}
}
}
catch( const std::exception& e )
catch( const std::exception& )
{
brd.exceptions ( std::ios_base::goodbit );
@ -2699,7 +2699,7 @@ void IDF3_BOARD::readLibFile( const std::string& aFileName )
while( lib.good() ) readLibSection( lib, state, this );
}
catch( const std::exception& e )
catch( const std::exception& )
{
lib.exceptions ( std::ios_base::goodbit );
@ -2853,7 +2853,7 @@ bool IDF3_BOARD::writeLibFile( const std::string& aFileName )
}
}
catch( const std::exception& e )
catch( const std::exception& )
{
lib.exceptions( std::ios_base::goodbit );
@ -3120,7 +3120,7 @@ void IDF3_BOARD::writeBoardFile( const std::string& aFileName )
}
}
catch( const std::exception& e )
catch( const std::exception& )
{
brd.exceptions( std::ios_base::goodbit );