From 35ddad2193f08c8b9feeaf3051bbd159eb6735d3 Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Thu, 16 Feb 2012 00:17:01 -0600 Subject: [PATCH] wxWidgets Debug builds apparently have some tricky technique to validate the match between wxString::Format() or wxString::Printf() format strings with passed arguments, but does this at runtime, not compile time. Fix some mismatches. size_t is a 64 bit type on x86_64 whereas int and unsigned are 32 bit types. On 32 bit machines they are all 32 bits so this error is probably not triggered. --- eeschema/eeschema_config.cpp | 8 ++++---- pcbnew/drc_clearance_test_functions.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 466d0f7ab3..b492effc8e 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -573,7 +573,7 @@ void SCH_EDIT_FRAME::LoadSettings() m_findReplaceData->SetReplaceString( cfg->Read( ReplaceStringEntry, wxEmptyString ) ); // Load the find and replace string history list. - for ( size_t i = 0; i < FR_HISTORY_LIST_CNT; i++ ) + for( int i = 0; i < FR_HISTORY_LIST_CNT; ++i ) { wxString tmpHistory; wxString entry; @@ -652,17 +652,17 @@ void SCH_EDIT_FRAME::SaveSettings() cfg->Write( ReplaceStringEntry, m_findReplaceData->GetReplaceString() ); // Save the find and replace string history list. - size_t i; + unsigned i; wxString tmpHistory; wxString entry; // invoke constructor outside of any loops - for ( i = 0; i < m_findStringHistoryList.GetCount() && i < FR_HISTORY_LIST_CNT; i++ ) + for( i = 0; i < m_findStringHistoryList.GetCount() && i < FR_HISTORY_LIST_CNT; i++ ) { entry.Printf( FindStringHistoryEntry, i ); cfg->Write( entry, m_findStringHistoryList[ i ] ); } - for ( i = 0; i < m_replaceStringHistoryList.GetCount() && i < FR_HISTORY_LIST_CNT; i++ ) + for( i = 0; i < m_replaceStringHistoryList.GetCount() && i < FR_HISTORY_LIST_CNT; i++ ) { entry.Printf( ReplaceStringHistoryEntry, i ); cfg->Write( entry, m_replaceStringHistoryList[ i ] ); diff --git a/pcbnew/drc_clearance_test_functions.cpp b/pcbnew/drc_clearance_test_functions.cpp index 2a3a0964af..0f905d93a1 100644 --- a/pcbnew/drc_clearance_test_functions.cpp +++ b/pcbnew/drc_clearance_test_functions.cpp @@ -701,10 +701,11 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad ) if( !trapezoid2trapezoidDRC( polyref, polycompare, dist_min ) ) diag = false; } - else // Should not occurs, because aPad and aRefPad are swapped - // to have only aPad shape RECT or TRAP and aRefPad shape TRAP or RECT. + else { - wxLogDebug( wxT( "unexpected pad shape" ) ); + // Should not occur, because aPad and aRefPad are swapped + // to have only aPad shape RECT or TRAP and aRefPad shape TRAP or RECT. + wxLogDebug( wxT( "unexpected pad shape %d") , aPad->GetShape() ); } break;