From ca499b80e1f91af7967b90c0774c7dbd8a110401 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 25 Aug 2016 09:24:43 +0200 Subject: [PATCH] Fixed wxLogTrace() calls in PNS Fixes: lp:1616702 * https://bugs.launchpad.net/kicad/+bug/1616702 --- pcbnew/router/pns_diff_pair_placer.cpp | 6 +++--- pcbnew/router/pns_dragger.cpp | 2 +- pcbnew/router/pns_kicad_iface.cpp | 10 +++++----- pcbnew/router/pns_line.cpp | 6 +++--- pcbnew/router/pns_line_placer.cpp | 6 +++--- pcbnew/router/pns_logger.cpp | 2 +- pcbnew/router/pns_node.cpp | 10 +++++----- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pcbnew/router/pns_diff_pair_placer.cpp b/pcbnew/router/pns_diff_pair_placer.cpp index 48930dc6af..f55a62ba2f 100644 --- a/pcbnew/router/pns_diff_pair_placer.cpp +++ b/pcbnew/router/pns_diff_pair_placer.cpp @@ -472,7 +472,7 @@ bool PNS_DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, PNS_ITEM* aI { 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 ); @@ -482,12 +482,12 @@ bool PNS_DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, PNS_ITEM* aI int refNet = aItem->Net(); int coupledNet = ( refNet == netP ) ? netN : netP; - wxLogTrace( "PNS", "result %d\n", !!result ); + wxLogTrace( "PNS", "result %d", !!result ); OPT_VECTOR2I refAnchor = getDanglingAnchor( m_currentNode, aItem ); PNS_ITEM* primRef = aItem; - wxLogTrace( "PNS", "refAnchor %p\n", aItem ); + wxLogTrace( "PNS", "refAnchor %p", aItem ); if( !refAnchor ) return false; diff --git a/pcbnew/router/pns_dragger.cpp b/pcbnew/router/pns_dragger.cpp index 42bc9a05fe..7089ddb6da 100644 --- a/pcbnew/router/pns_dragger.cpp +++ b/pcbnew/router/pns_dragger.cpp @@ -112,7 +112,7 @@ bool PNS_DRAGGER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem ) 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() ) { diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index a4b37724b6..e9251f6422 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -120,7 +120,7 @@ PNS_PCBNEW_RULE_RESOLVER::PNS_PCBNEW_RULE_RESOLVER( BOARD* aBoard, PNS_ROUTER* a ent.clearance = clearance; 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; @@ -702,7 +702,7 @@ PNS_ITEM* PNS_KICAD_IFACE::syncVia( VIA* aVia ) void PNS_KICAD_IFACE::SetBoard( 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 ) { - wxLogTrace( "PNS", "DisplayItem %p\n", aItem ); + wxLogTrace( "PNS", "DisplayItem %p", aItem ); 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 ) { - wxLogTrace( "PNS", "SetView %p\n", aView ); + wxLogTrace( "PNS", "SetView %p", aView ); if( m_previewItems ) { @@ -900,7 +900,7 @@ void PNS_KICAD_IFACE::SetView( KIGFX::VIEW *aView ) 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() diff --git a/pcbnew/router/pns_line.cpp b/pcbnew/router/pns_line.cpp index 7d54679a8c..512ab1b4c5 100644 --- a/pcbnew/router/pns_line.cpp +++ b/pcbnew/router/pns_line.cpp @@ -341,14 +341,14 @@ void PNS_LINE::ShowLinks() { if( !m_segmentRefs ) { - wxLogTrace( "PNS", "line %p: no links\n", this ); + wxLogTrace( "PNS", "line %p: no links", this ); 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++ ) - 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 ) diff --git a/pcbnew/router/pns_line_placer.cpp b/pcbnew/router/pns_line_placer.cpp index 2453c7cb9b..c099619689 100644 --- a/pcbnew/router/pns_line_placer.cpp +++ b/pcbnew/router/pns_line_placer.cpp @@ -597,7 +597,7 @@ void PNS_LINE_PLACER::routeStep( const VECTOR2I& aP ) 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() ); for( i = 0; i < n_iter; i++ ) @@ -786,7 +786,7 @@ void PNS_LINE_PLACER::initPlacement() 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_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 ) diff --git a/pcbnew/router/pns_logger.cpp b/pcbnew/router/pns_logger.cpp index 64911203c4..255bffcabf 100644 --- a/pcbnew/router/pns_logger.cpp +++ b/pcbnew/router/pns_logger.cpp @@ -196,7 +196,7 @@ void PNS_LOGGER::Save( const std::string& aFilename ) EndGroup(); 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(); fwrite( s.c_str(), 1, s.length(), f ); fclose( f ); diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index a0bda083ef..13922eef8c 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -66,14 +66,14 @@ PNS_NODE::~PNS_NODE() 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 ); } #ifdef DEBUG 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 ); } @@ -130,8 +130,8 @@ PNS_NODE* PNS_NODE::Branch() child->m_override = m_override; } - wxLogTrace( "PNS", "%d items, %lu joints, %lu overrides", - child->m_index->Size(), child->m_joints.size(), child->m_override.size() ); + wxLogTrace( "PNS", "%d items, %d joints, %d overrides", + child->m_index->Size(), (int) child->m_joints.size(), (int) child->m_override.size() ); return child; } @@ -1022,7 +1022,7 @@ PNS_JOINT& PNS_NODE::touchJoint( const VECTOR2I& aPos, const PNS_LAYERSET& aLaye 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() ); }