Common: Fix -Wcatch-value warnings (catching exceptions by value)
This fixes some warnings on GCC 8.1:
warning: catching polymorphic type ‘class std::out_of_range’ by value [-Wcatch-value=]
catch( std::out_of_range )
^~~~~~~~~~~~
This fix is along the same lines as:
* ff1802d7a
"Fix Coverity "Big parameter passed by value" warnings"
This commit is contained in:
parent
f95b77b61a
commit
58814e838d
|
@ -207,7 +207,7 @@ private:
|
||||||
{
|
{
|
||||||
new_layer = aReorderMap.at( orig_layer );
|
new_layer = aReorderMap.at( orig_layer );
|
||||||
}
|
}
|
||||||
catch( std::out_of_range ) {}
|
catch( const std::out_of_range& ) {}
|
||||||
|
|
||||||
m_groups[i].first = new_layer;
|
m_groups[i].first = new_layer;
|
||||||
}
|
}
|
||||||
|
@ -665,7 +665,7 @@ void VIEW::ReorderLayerData( std::unordered_map<int, int> aReorderMap )
|
||||||
{
|
{
|
||||||
new_idx = aReorderMap.at( orig_idx );
|
new_idx = aReorderMap.at( orig_idx );
|
||||||
}
|
}
|
||||||
catch( std::out_of_range )
|
catch( const std::out_of_range& )
|
||||||
{
|
{
|
||||||
new_idx = orig_idx;
|
new_idx = orig_idx;
|
||||||
}
|
}
|
||||||
|
|
|
@ -590,7 +590,7 @@ public:
|
||||||
{
|
{
|
||||||
return m_layers.at( aLayer ).target == TARGET_CACHED;
|
return m_layers.at( aLayer ).target == TARGET_CACHED;
|
||||||
}
|
}
|
||||||
catch( std::out_of_range )
|
catch( const std::out_of_range& )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,7 +165,7 @@ void KICAD_MANAGER_FRAME::OnImportEagleFiles( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
pcbframe = Kiway.Player( FRAME_PCB, true );
|
pcbframe = Kiway.Player( FRAME_PCB, true );
|
||||||
}
|
}
|
||||||
catch( IO_ERROR err )
|
catch( const IO_ERROR& err )
|
||||||
{
|
{
|
||||||
wxMessageBox( _( "Pcbnew failed to load:\n" ) + err.What(), _( "KiCad Error" ),
|
wxMessageBox( _( "Pcbnew failed to load:\n" ) + err.What(), _( "KiCad Error" ),
|
||||||
wxOK | wxICON_ERROR, this );
|
wxOK | wxICON_ERROR, this );
|
||||||
|
|
Loading…
Reference in New Issue