Fix compiler warnings.

This commit is contained in:
Jeff Young 2023-08-24 11:59:13 +01:00
parent 6040f49272
commit 7fcce5224d
1 changed files with 5 additions and 7 deletions

View File

@ -1063,17 +1063,15 @@ bool FOOTPRINT_VIEWER_FRAME::ShowModal( wxString* aFootprint, wxWindow* aParent
if( fpid.IsValid() ) if( fpid.IsValid() )
{ {
wxString libraryName = fpid.GetLibNickname(); wxString libraryName = fpid.GetLibNickname();
WX_INFOBAR* infobar;
wxHyperlinkCtrl* button; wxHyperlinkCtrl* button;
bool hasInfobar = false;
if( !fpTable->HasLibrary( fpid.GetLibNickname(), false ) if( !fpTable->HasLibrary( fpid.GetLibNickname(), false )
|| !fpTable->HasLibrary( fpid.GetLibNickname(), true ) ) || !fpTable->HasLibrary( fpid.GetLibNickname(), true ) )
{ {
CreateInfoBar(); CreateInfoBar();
if( infobar = GetInfoBar() )
if( WX_INFOBAR* infobar = GetInfoBar() )
{ {
hasInfobar = true;
button = new wxHyperlinkCtrl( infobar, wxID_ANY, button = new wxHyperlinkCtrl( infobar, wxID_ANY,
_( "Manage symol libraries" ), _( "Manage symol libraries" ),
wxEmptyString ); wxEmptyString );
@ -1087,7 +1085,7 @@ bool FOOTPRINT_VIEWER_FRAME::ShowModal( wxString* aFootprint, wxWindow* aParent
if( !fpTable->HasLibrary( fpid.GetLibNickname(), false ) ) if( !fpTable->HasLibrary( fpid.GetLibNickname(), false ) )
{ {
if( hasInfobar ) if( WX_INFOBAR* infobar = GetInfoBar() )
{ {
msg.Printf( _( "Footprint library not found. The current configuration does " msg.Printf( _( "Footprint library not found. The current configuration does "
"not include library '%s'." ), libraryName ); "not include library '%s'." ), libraryName );
@ -1099,7 +1097,7 @@ bool FOOTPRINT_VIEWER_FRAME::ShowModal( wxString* aFootprint, wxWindow* aParent
} }
else if ( !fpTable->HasLibrary( fpid.GetLibNickname(), true ) ) else if ( !fpTable->HasLibrary( fpid.GetLibNickname(), true ) )
{ {
if( hasInfobar ) if( WX_INFOBAR* infobar = GetInfoBar() )
{ {
msg.Printf( _( "Footprint library not enabled. Library '%s' is not enabled " msg.Printf( _( "Footprint library not enabled. Library '%s' is not enabled "
"in the current configuration." ), libraryName ); "in the current configuration." ), libraryName );