Changed format specifiers of some printf involved with size_t values to %zu to avoid runtime assertions.

This commit is contained in:
Lorenzo Marcantonio 2013-04-14 13:02:19 +02:00
parent 2cad7a52ad
commit 70dc51d1f9
2 changed files with 7 additions and 8 deletions

View File

@ -119,7 +119,7 @@ void FOOTPRINTS_LISTBOX::SetFootprintFullList( FOOTPRINT_LIST& list )
for( unsigned ii = 0; ii < list.GetCount(); ii++ ) for( unsigned ii = 0; ii < list.GetCount(); ii++ )
{ {
FOOTPRINT_INFO & footprint = list.GetItem(ii); FOOTPRINT_INFO & footprint = list.GetItem(ii);
msg.Printf( wxT( "%3d %s" ), (int) m_FullFootprintList.GetCount() + 1, msg.Printf( wxT( "%3zu %s" ), m_FullFootprintList.GetCount() + 1,
GetChars(footprint.m_Module) ); GetChars(footprint.m_Module) );
m_FullFootprintList.Add( msg ); m_FullFootprintList.Add( msg );
} }
@ -154,7 +154,7 @@ void FOOTPRINTS_LISTBOX::SetFootprintFilteredList( COMPONENT_INFO* Component,
candidate = Component->m_FootprintFilter[jj].Upper(); candidate = Component->m_FootprintFilter[jj].Upper();
if( !module.Matches( candidate ) ) if( !module.Matches( candidate ) )
continue; continue;
msg.Printf( wxT( "%3d %s" ), m_FilteredFootprintList.GetCount() + 1, msg.Printf( wxT( "%3zu %s" ), m_FilteredFootprintList.GetCount() + 1,
footprint.m_Module.GetData() ); footprint.m_Module.GetData() );
m_FilteredFootprintList.Add( msg ); m_FilteredFootprintList.Add( msg );
hasItem = true; hasItem = true;
@ -186,7 +186,7 @@ void FOOTPRINTS_LISTBOX::SetFootprintFilteredByPinCount( COMPONENT_INFO* Compone
if( Component->m_pinCount == footprint.m_padCount ) if( Component->m_pinCount == footprint.m_padCount )
{ {
msg.Printf( wxT( "%3d %s" ), m_FilteredFootprintList.GetCount() + 1, msg.Printf( wxT( "%3zu %s" ), m_FilteredFootprintList.GetCount() + 1,
footprint.m_Module.GetData() ); footprint.m_Module.GetData() );
m_FilteredFootprintList.Add( msg ); m_FilteredFootprintList.Add( msg );
hasItem = true; hasItem = true;

View File

@ -146,11 +146,10 @@ void SCH_EDIT_FRAME::BuildNetListBase()
if( g_NetObjectslist.size() == 0 ) if( g_NetObjectslist.size() == 0 )
return; // no objects return; // no objects
/* Here wx gives its best... depending on the build option size can /* The new %zu specification is needed to properly format a size_t
be unsigned int or unsigned long (probably even size_t, but it doesn't * value (returned by size(), here) */
support the %z specifier). So the cast is for platform compability */ activity += wxString::Format( _( " net count = %zu" ),
activity += wxString::Format( _( " net count = %lu" ), g_NetObjectslist.size() );
(unsigned long)( g_NetObjectslist.size() ) );
SetStatusText( activity ); SetStatusText( activity );
/* Sort objects by Sheet */ /* Sort objects by Sheet */