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:
parent
6d27087053
commit
b0f9864bc4
|
@ -140,7 +140,7 @@ bool LIB_ALIAS::SaveDoc( OUTPUTFORMATTER& aFormatter )
|
||||||
|
|
||||||
aFormatter.Print( 0, "$ENDCMP\n" );
|
aFormatter.Print( 0, "$ENDCMP\n" );
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -655,7 +655,7 @@ bool PART_LIB::Save( OUTPUTFORMATTER& aFormatter )
|
||||||
|
|
||||||
aFormatter.Print( 0, "#\n#End Library\n" );
|
aFormatter.Print( 0, "#\n#End Library\n" );
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& )
|
||||||
{
|
{
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
@ -680,7 +680,7 @@ bool PART_LIB::SaveDocs( OUTPUTFORMATTER& aFormatter )
|
||||||
|
|
||||||
aFormatter.Print( 0, "#\n#End Doc Library\n" );
|
aFormatter.Print( 0, "#\n#End Doc Library\n" );
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& )
|
||||||
{
|
{
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,7 +210,7 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
||||||
{
|
{
|
||||||
backAnnotateFootprints( payload );
|
backAnnotateFootprints( payload );
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& DBG( ioe ) )
|
||||||
{
|
{
|
||||||
DBG( printf( "%s: ioe:%s\n", __func__, TO_UTF8( ioe.What() ) );)
|
DBG( printf( "%s: ioe:%s\n", __func__, TO_UTF8( ioe.What() ) );)
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,7 +300,7 @@ void DIALOG_BOM::installPluginsList()
|
||||||
{
|
{
|
||||||
cfg_parser.Parse();
|
cfg_parser.Parse();
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& )
|
||||||
{
|
{
|
||||||
// wxLogMessage( ioe.What() );
|
// wxLogMessage( ioe.What() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ void LIB_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
PART_LIBS::LibNamesAndPaths( prj, false, &lib_paths, &lib_names );
|
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() ) );)
|
DBG(printf( "%s: %s\n", __func__, TO_UTF8( ioe.What() ) );)
|
||||||
return;
|
return;
|
||||||
|
@ -198,7 +198,7 @@ void SCH_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
PART_LIBS::LibNamesAndPaths( prj, false, &lib_paths, &lib_names );
|
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() ) );)
|
DBG(printf( "%s: %s\n", __func__, TO_UTF8( ioe.What() ) );)
|
||||||
return;
|
return;
|
||||||
|
@ -659,7 +659,7 @@ void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
|
||||||
{
|
{
|
||||||
m_TemplateFieldNames.Parse( &lexer );
|
m_TemplateFieldNames.Parse( &lexer );
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& e )
|
catch( const IO_ERROR& DBG( e ) )
|
||||||
{
|
{
|
||||||
// @todo show error msg
|
// @todo show error msg
|
||||||
DBG( printf( "templatefieldnames parsing error: '%s'\n",
|
DBG( printf( "templatefieldnames parsing error: '%s'\n",
|
||||||
|
|
|
@ -66,7 +66,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event )
|
||||||
std::unique_ptr<PART_LIB> new_lib( PART_LIB::LoadLibrary( fn.GetFullPath() ) );
|
std::unique_ptr<PART_LIB> new_lib( PART_LIB::LoadLibrary( fn.GetFullPath() ) );
|
||||||
lib = std::move( new_lib );
|
lib = std::move( new_lib );
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _(
|
wxString msg = wxString::Format( _(
|
||||||
"Unable to import library '%s'. Error:\n"
|
"Unable to import library '%s'. Error:\n"
|
||||||
|
|
|
@ -113,7 +113,7 @@ static bool insert_library( PROJECT *aProject, PART_LIB *aLibrary, size_t aIndex
|
||||||
libNames.Insert( libName, aIndex );
|
libNames.Insert( libName, aIndex );
|
||||||
PART_LIBS::LibNamesAndPaths( aProject, true, &libPaths, &libNames );
|
PART_LIBS::LibNamesAndPaths( aProject, true, &libPaths, &libNames );
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& e )
|
catch( const IO_ERROR& )
|
||||||
{
|
{
|
||||||
// Could not get or save the current libraries.
|
// Could not get or save the current libraries.
|
||||||
return false;
|
return false;
|
||||||
|
@ -131,12 +131,12 @@ static bool insert_library( PROJECT *aProject, PART_LIB *aLibrary, size_t aIndex
|
||||||
{
|
{
|
||||||
libs->LoadAllLibraries( aProject );
|
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,
|
// Some libraries were not found. There's no point in showing the error,
|
||||||
// because it was already shown. Just don't do anything.
|
// because it was already shown. Just don't do anything.
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& e )
|
catch( const IO_ERROR& )
|
||||||
{
|
{
|
||||||
// Restore the old list
|
// Restore the old list
|
||||||
libs->clear();
|
libs->clear();
|
||||||
|
|
|
@ -115,7 +115,7 @@ SEARCH_STACK* PROJECT::SchSearchS()
|
||||||
{
|
{
|
||||||
PART_LIBS::LibNamesAndPaths( this, false, &libDir );
|
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() ) );)
|
DBG(printf( "%s: %s\n", __func__, TO_UTF8( ioe.What() ) );)
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,7 +233,7 @@ void LIB_EDIT_FRAME::SaveOneSymbol()
|
||||||
formatter.Print( 0, "ENDDRAW\n" );
|
formatter.Print( 0, "ENDDRAW\n" );
|
||||||
formatter.Print( 0, "ENDDEF\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'" ),
|
msg.Printf( _( "An error occurred attempting to save symbol file '%s'" ),
|
||||||
GetChars( fn.GetFullPath() ) );
|
GetChars( fn.GetFullPath() ) );
|
||||||
|
|
|
@ -103,7 +103,7 @@ bool PCB_CALCULATOR_FRAME::WriteDataFile()
|
||||||
while( nestlevel-- )
|
while( nestlevel-- )
|
||||||
formatter.Print( nestlevel, ")\n" );
|
formatter.Print( nestlevel, ")\n" );
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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_Reference ) );
|
||||||
aFunction( static_cast<BOARD_ITEM*>( m_Value ) );
|
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" ) );
|
DisplayError( NULL, wxT( "Error running MODULE::RunOnChildren" ) );
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,7 +255,7 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
||||||
KICAD_NETLIST_READER netlistReader( lineReader, &netlist );
|
KICAD_NETLIST_READER netlistReader( lineReader, &netlist );
|
||||||
netlistReader.LoadNetlist();
|
netlistReader.LoadNetlist();
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& )
|
||||||
{
|
{
|
||||||
assert( false ); // should never happen
|
assert( false ); // should never happen
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,7 +178,7 @@ bool WIZARD_FPLIB_TABLE::LIBRARY::Test()
|
||||||
{
|
{
|
||||||
footprints = p->FootprintEnumerate( m_path );
|
footprints = p->FootprintEnumerate( m_path );
|
||||||
}
|
}
|
||||||
catch( IO_ERROR& e )
|
catch( IO_ERROR& )
|
||||||
{
|
{
|
||||||
m_status = LIBRARY::INVALID;
|
m_status = LIBRARY::INVALID;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1740,7 +1740,7 @@ BOARD* PCB_IO::Load( const wxString& aFileName, BOARD* aAppendToMe, const PROPER
|
||||||
{
|
{
|
||||||
board = dynamic_cast<BOARD*>( m_parser->Parse() );
|
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
|
// Don't wrap a FUTURE_FORMAT_ERROR in another
|
||||||
throw;
|
throw;
|
||||||
|
|
|
@ -366,7 +366,7 @@ const wxString FOOTPRINT_EDIT_FRAME::getLibPath()
|
||||||
|
|
||||||
return row->GetFullURI( true );
|
return row->GetFullURI( true );
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& )
|
||||||
{
|
{
|
||||||
return wxEmptyString;
|
return wxEmptyString;
|
||||||
}
|
}
|
||||||
|
@ -409,12 +409,12 @@ void FOOTPRINT_EDIT_FRAME::restoreLastFootprint()
|
||||||
{
|
{
|
||||||
module = (MODULE*) pcb_io.Parse( pretty );
|
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.
|
// unlikely to be a problem, since we produced the pretty string.
|
||||||
wxLogError( wxT( "PARSE_ERROR" ) );
|
wxLogError( wxT( "PARSE_ERROR" ) );
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& )
|
||||||
{
|
{
|
||||||
// unlikely to be a problem, since we produced the pretty string.
|
// unlikely to be a problem, since we produced the pretty string.
|
||||||
wxLogError( wxT( "IO_ERROR" ) );
|
wxLogError( wxT( "IO_ERROR" ) );
|
||||||
|
@ -767,7 +767,7 @@ void FOOTPRINT_EDIT_FRAME::updateTitle()
|
||||||
|
|
||||||
nickname_display = nickname;
|
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
|
// 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
|
// in the title, we could show an error message, but that should have been done at time
|
||||||
|
|
|
@ -60,7 +60,7 @@ CONTEXT_MENU* CONDITIONAL_MENU::Generate( SELECTION& aSelection )
|
||||||
if( !cond( aSelection ) )
|
if( !cond( aSelection ) )
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
catch( std::exception& e )
|
catch( std::exception& )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,7 +186,7 @@ SCENEGRAPH* LoadVRML( const wxString& aFileName, bool useInline )
|
||||||
// longer lines then perhaps it shouldn't be used
|
// longer lines then perhaps it shouldn't be used
|
||||||
modelFile = new FILE_LINE_READER( aFileName, 0, 8388608 );
|
modelFile = new FILE_LINE_READER( aFileName, 0, 8388608 );
|
||||||
}
|
}
|
||||||
catch( IO_ERROR &e )
|
catch( IO_ERROR & )
|
||||||
{
|
{
|
||||||
wxLogError( _( " * [INFO] load failed: input line too long\n" ) );
|
wxLogError( _( " * [INFO] load failed: input line too long\n" ) );
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -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 );
|
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 );
|
while( lib.good() ) readLibSection( lib, state, this );
|
||||||
}
|
}
|
||||||
catch( const std::exception& e )
|
catch( const std::exception& )
|
||||||
{
|
{
|
||||||
lib.exceptions ( std::ios_base::goodbit );
|
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 );
|
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 );
|
brd.exceptions( std::ios_base::goodbit );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue