From 7ec2c004a2c4c9069acdec08ea436b90b1cdcf8b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 29 Dec 2013 16:12:27 +0100 Subject: [PATCH] fix bugs 1264240, 1264247, 1264239, 1264233 (clang report errors) --- common/basicframe.cpp | 3 ++- common/fp_lib_table.cpp | 12 ++++++++---- eeschema/schematic_undo_redo.cpp | 8 ++------ pcbnew/drc.cpp | 3 ++- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/common/basicframe.cpp b/common/basicframe.cpp index 702a4d2654..e04663c91e 100644 --- a/common/basicframe.cpp +++ b/common/basicframe.cpp @@ -221,7 +221,8 @@ void EDA_BASE_FRAME::LoadSettings() // Once this is fully implemented, wxAuiManager will be used to maintain the persistance of // the main frame and all it's managed windows and all of the legacy frame persistence // position code can be removed. - config->Read( m_FrameName + entryPerspective, &m_perspective ); + if( config ) + config->Read( m_FrameName + entryPerspective, &m_perspective ); } diff --git a/common/fp_lib_table.cpp b/common/fp_lib_table.cpp index 09bcf826e9..5ee2c3a2bf 100644 --- a/common/fp_lib_table.cpp +++ b/common/fp_lib_table.cpp @@ -828,10 +828,14 @@ bool FP_LIB_TABLE::ConvertFromLegacy( NETLIST& aNetList, const wxArrayString& aL if( !newFPID.IsValid() ) { - msg.Printf( _( "Component `%s` FPID <%s> is not valid.\n" ), - GetChars( component->GetReference() ), - GetChars( FROM_UTF8( newFPID.Format().c_str() ) ) ); - aReporter->Report( msg ); + if( aReporter ) + { + msg.Printf( _( "Component `%s` FPID <%s> is not valid.\n" ), + GetChars( component->GetReference() ), + GetChars( FROM_UTF8( newFPID.Format().c_str() ) ) ); + aReporter->Report( msg ); + } + retv = false; } else diff --git a/eeschema/schematic_undo_redo.cpp b/eeschema/schematic_undo_redo.cpp index 4481e8cce0..2d6dbba449 100644 --- a/eeschema/schematic_undo_redo.cpp +++ b/eeschema/schematic_undo_redo.cpp @@ -269,19 +269,15 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed for( int ii = aList->GetCount() - 1; ii >= 0; ii-- ) { item = (SCH_ITEM*) aList->GetPickedItem( ii ); + wxAssert( item ); - if( item ) - item->ClearFlags(); + item->ClearFlags(); SCH_ITEM* image = (SCH_ITEM*) aList->GetPickedItemLink( ii ); switch( aList->GetPickedItemStatus( ii ) ) { case UR_CHANGED: /* Exchange old and new data for each item */ - // tmp = item->Clone(); - // *item = *image; - // *image = *tmp; - // delete tmp; item->SwapData( image ); break; diff --git a/pcbnew/drc.cpp b/pcbnew/drc.cpp index bd08a55e20..49961cc581 100644 --- a/pcbnew/drc.cpp +++ b/pcbnew/drc.cpp @@ -224,7 +224,8 @@ void DRC::RunTests( wxTextCtrl* aMessages ) wxSafeYield(); } - m_mainWindow->Fill_All_Zones( aMessages->GetParent(), false ); + m_mainWindow->Fill_All_Zones( aMessages ? aMessages->GetParent() : m_mainWindow, + false ); // test zone clearances to other zones if( aMessages )