Fixed wxLogTrace() calls in PNS

Fixes: lp:1616702
* https://bugs.launchpad.net/kicad/+bug/1616702
This commit is contained in:
Maciej Suminski 2016-08-25 09:24:43 +02:00
parent 91e953868a
commit ca499b80e1
7 changed files with 21 additions and 21 deletions

View File

@ -472,7 +472,7 @@ bool PNS_DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, PNS_ITEM* aI
{ {
int netP, netN; int netP, netN;
wxLogTrace( "PNS", "world %p\n", m_world ); wxLogTrace( "PNS", "world %p", m_world );
bool result = m_world->GetRuleResolver()->DpNetPair( aItem, netP, netN ); bool result = m_world->GetRuleResolver()->DpNetPair( aItem, netP, netN );
@ -482,12 +482,12 @@ bool PNS_DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, PNS_ITEM* aI
int refNet = aItem->Net(); int refNet = aItem->Net();
int coupledNet = ( refNet == netP ) ? netN : netP; int coupledNet = ( refNet == netP ) ? netN : netP;
wxLogTrace( "PNS", "result %d\n", !!result ); wxLogTrace( "PNS", "result %d", !!result );
OPT_VECTOR2I refAnchor = getDanglingAnchor( m_currentNode, aItem ); OPT_VECTOR2I refAnchor = getDanglingAnchor( m_currentNode, aItem );
PNS_ITEM* primRef = aItem; PNS_ITEM* primRef = aItem;
wxLogTrace( "PNS", "refAnchor %p\n", aItem ); wxLogTrace( "PNS", "refAnchor %p", aItem );
if( !refAnchor ) if( !refAnchor )
return false; return false;

View File

@ -112,7 +112,7 @@ bool PNS_DRAGGER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem )
aStartItem->Unmark( MK_LOCKED ); aStartItem->Unmark( MK_LOCKED );
wxLogTrace( "PNS", "StartDragging: item %p [kind %d]", aStartItem, aStartItem->Kind() ); wxLogTrace( "PNS", "StartDragging: item %p [kind %d]", aStartItem, (int) aStartItem->Kind() );
switch( aStartItem->Kind() ) switch( aStartItem->Kind() )
{ {

View File

@ -120,7 +120,7 @@ PNS_PCBNEW_RULE_RESOLVER::PNS_PCBNEW_RULE_RESOLVER( BOARD* aBoard, PNS_ROUTER* a
ent.clearance = clearance; ent.clearance = clearance;
m_clearanceCache[i] = ent; m_clearanceCache[i] = ent;
wxLogTrace( "PNS", "Add net %d netclass %s clearance %d", i, netClassName.mb_str(), clearance ); wxLogTrace( "PNS", "Add net %u netclass %s clearance %d", i, netClassName.mb_str(), clearance );
} }
m_overrideEnabled = false; m_overrideEnabled = false;
@ -702,7 +702,7 @@ PNS_ITEM* PNS_KICAD_IFACE::syncVia( VIA* aVia )
void PNS_KICAD_IFACE::SetBoard( BOARD* aBoard ) void PNS_KICAD_IFACE::SetBoard( BOARD* aBoard )
{ {
m_board = aBoard; m_board = aBoard;
wxLogTrace( "PNS", "m_board = %p\n", m_board ); wxLogTrace( "PNS", "m_board = %p", m_board );
} }
@ -772,7 +772,7 @@ void PNS_KICAD_IFACE::EraseView()
void PNS_KICAD_IFACE::DisplayItem( const PNS_ITEM* aItem, int aColor, int aClearance ) void PNS_KICAD_IFACE::DisplayItem( const PNS_ITEM* aItem, int aColor, int aClearance )
{ {
wxLogTrace( "PNS", "DisplayItem %p\n", aItem ); wxLogTrace( "PNS", "DisplayItem %p", aItem );
ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( aItem, m_previewItems ); ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( aItem, m_previewItems );
@ -879,7 +879,7 @@ void PNS_KICAD_IFACE::Commit()
void PNS_KICAD_IFACE::SetView( KIGFX::VIEW *aView ) void PNS_KICAD_IFACE::SetView( KIGFX::VIEW *aView )
{ {
wxLogTrace( "PNS", "SetView %p\n", aView ); wxLogTrace( "PNS", "SetView %p", aView );
if( m_previewItems ) if( m_previewItems )
{ {
@ -900,7 +900,7 @@ void PNS_KICAD_IFACE::SetView( KIGFX::VIEW *aView )
void PNS_KICAD_IFACE::UpdateNet( int aNetCode ) void PNS_KICAD_IFACE::UpdateNet( int aNetCode )
{ {
wxLogTrace( "PNS", "Update-net %d\n", aNetCode ); wxLogTrace( "PNS", "Update-net %d", aNetCode );
} }
PNS_RULE_RESOLVER* PNS_KICAD_IFACE::GetRuleResolver() PNS_RULE_RESOLVER* PNS_KICAD_IFACE::GetRuleResolver()

View File

@ -341,14 +341,14 @@ void PNS_LINE::ShowLinks()
{ {
if( !m_segmentRefs ) if( !m_segmentRefs )
{ {
wxLogTrace( "PNS", "line %p: no links\n", this ); wxLogTrace( "PNS", "line %p: no links", this );
return; return;
} }
wxLogTrace( "PNS", "line %p: %lu linked segs\n", this, (int) m_segmentRefs->size() ); wxLogTrace( "PNS", "line %p: %d linked segs", this, (int) m_segmentRefs->size() );
for( int i = 0; i < (int) m_segmentRefs->size(); i++ ) for( int i = 0; i < (int) m_segmentRefs->size(); i++ )
wxLogTrace( "PNS", "seg %d: %p\n", i, (*m_segmentRefs)[i] ); wxLogTrace( "PNS", "seg %d: %p", i, (*m_segmentRefs)[i] );
} }
SHAPE_LINE_CHAIN dragCornerInternal( const SHAPE_LINE_CHAIN& aOrigin, const VECTOR2I& aP ) SHAPE_LINE_CHAIN dragCornerInternal( const SHAPE_LINE_CHAIN& aOrigin, const VECTOR2I& aP )

View File

@ -597,7 +597,7 @@ void PNS_LINE_PLACER::routeStep( const VECTOR2I& aP )
PNS_LINE new_head; PNS_LINE new_head;
wxLogTrace( "PNS", "INIT-DIR: %s head: %d, tail: %d segs\n", wxLogTrace( "PNS", "INIT-DIR: %s head: %d, tail: %d segs",
m_initial_direction.Format().c_str(), m_head.SegmentCount(), m_tail.SegmentCount() ); m_initial_direction.Format().c_str(), m_head.SegmentCount(), m_tail.SegmentCount() );
for( i = 0; i < n_iter; i++ ) for( i = 0; i < n_iter; i++ )
@ -786,7 +786,7 @@ void PNS_LINE_PLACER::initPlacement()
setWorld( rootNode ); setWorld( rootNode );
wxLogTrace( "PNS", "world %p, intitial-direction %s layer %d\n", wxLogTrace( "PNS", "world %p, intitial-direction %s layer %d",
m_world, m_direction.Format().c_str(), m_currentLayer ); m_world, m_direction.Format().c_str(), m_currentLayer );
m_lastNode = NULL; m_lastNode = NULL;
@ -974,7 +974,7 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE& aLatest )
} }
} }
wxLogTrace( "PNS", "total segs removed: %d/%d\n", removedCount, total ); wxLogTrace( "PNS", "total segs removed: %d/%d", removedCount, total );
} }
for( PNS_SEGMENT *s : toErase ) for( PNS_SEGMENT *s : toErase )

View File

@ -196,7 +196,7 @@ void PNS_LOGGER::Save( const std::string& aFilename )
EndGroup(); EndGroup();
FILE* f = fopen( aFilename.c_str(), "wb" ); FILE* f = fopen( aFilename.c_str(), "wb" );
wxLogTrace( "PNS", "Saving to '%s' [%p]\n", aFilename.c_str(), f ); wxLogTrace( "PNS", "Saving to '%s' [%p]", aFilename.c_str(), f );
const std::string s = m_theLog.str(); const std::string s = m_theLog.str();
fwrite( s.c_str(), 1, s.length(), f ); fwrite( s.c_str(), 1, s.length(), f );
fclose( f ); fclose( f );

View File

@ -66,14 +66,14 @@ PNS_NODE::~PNS_NODE()
if( !m_children.empty() ) if( !m_children.empty() )
{ {
wxLogTrace( "PNS", "attempting to free a node that has kids.\n" ); wxLogTrace( "PNS", "attempting to free a node that has kids." );
assert( false ); assert( false );
} }
#ifdef DEBUG #ifdef DEBUG
if( allocNodes.find( this ) == allocNodes.end() ) if( allocNodes.find( this ) == allocNodes.end() )
{ {
wxLogTrace( "PNS", "attempting to free an already-free'd node.\n" ); wxLogTrace( "PNS", "attempting to free an already-free'd node." );
assert( false ); assert( false );
} }
@ -130,8 +130,8 @@ PNS_NODE* PNS_NODE::Branch()
child->m_override = m_override; child->m_override = m_override;
} }
wxLogTrace( "PNS", "%d items, %lu joints, %lu overrides", wxLogTrace( "PNS", "%d items, %d joints, %d overrides",
child->m_index->Size(), child->m_joints.size(), child->m_override.size() ); child->m_index->Size(), (int) child->m_joints.size(), (int) child->m_override.size() );
return child; return child;
} }
@ -1022,7 +1022,7 @@ PNS_JOINT& PNS_NODE::touchJoint( const VECTOR2I& aPos, const PNS_LAYERSET& aLaye
void PNS_JOINT::Dump() const void PNS_JOINT::Dump() const
{ {
wxLogTrace( "PNS", "joint layers %d-%d, net %d, pos %s, links: %d\n", m_layers.Start(), wxLogTrace( "PNS", "joint layers %d-%d, net %d, pos %s, links: %d", m_layers.Start(),
m_layers.End(), m_tag.net, m_tag.pos.Format().c_str(), LinkCount() ); m_layers.End(), m_tag.net, m_tag.pos.Format().c_str(), LinkCount() );
} }