From 127fcfa7c9e5fc86115892e7ad83a1e015c104b5 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 12 Aug 2015 21:12:12 +0200 Subject: [PATCH] Code formatting. --- pcbnew/router/pns_item.h | 7 ++++--- pcbnew/router/pns_itemset.h | 30 +++++++++++++++--------------- pcbnew/router/pns_line.cpp | 20 ++++++++++---------- pcbnew/router/pns_node.cpp | 7 +++---- pcbnew/router/pns_node.h | 8 ++++---- pcbnew/router/pns_via.cpp | 2 +- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/pcbnew/router/pns_item.h b/pcbnew/router/pns_item.h index 339751e2de..eac581437f 100644 --- a/pcbnew/router/pns_item.h +++ b/pcbnew/router/pns_item.h @@ -50,8 +50,9 @@ enum LineMarker { class PNS_OBJECT { public: - PNS_OBJECT (): - m_owner(NULL) {}; + PNS_OBJECT(): + m_owner( NULL ) {} + ~PNS_OBJECT() {}; /** @@ -83,7 +84,7 @@ public: PNS_OBJECT* Owner() const { return m_owner; } protected: - PNS_OBJECT *m_owner; + PNS_OBJECT* m_owner; }; diff --git a/pcbnew/router/pns_itemset.h b/pcbnew/router/pns_itemset.h index f4264c1d67..d758129c8b 100644 --- a/pcbnew/router/pns_itemset.h +++ b/pcbnew/router/pns_itemset.h @@ -142,7 +142,7 @@ public: void Clear() { - BOOST_FOREACH( PNS_ITEM *item, m_items ) + BOOST_FOREACH( PNS_ITEM* item, m_items ) { if( item->BelongsTo( this ) ) delete item; @@ -168,24 +168,24 @@ public: } template - T* FindByKind( PNS_ITEM::PnsKind kind, int index = 0 ) + T* FindByKind( PNS_ITEM::PnsKind kind, int index = 0 ) + { + int n = 0; + + BOOST_FOREACH( PNS_ITEM* item, m_items ) { - int n = 0; - - BOOST_FOREACH( PNS_ITEM* item, m_items ) + if( item->OfKind( kind ) ) { - if( item->OfKind (kind) ) - { - if( index == n ) - return static_cast( item ); - else - n++; - } + if( index == n ) + return static_cast( item ); + else + n++; } - - return NULL; } + return NULL; + } + private: void release(); @@ -193,7 +193,7 @@ private: { release(); - BOOST_FOREACH( PNS_ITEM *item, aOther.m_items ) + BOOST_FOREACH( PNS_ITEM* item, aOther.m_items ) { if( item->BelongsTo( &aOther ) ) m_items.push_back( item->Clone() ); diff --git a/pcbnew/router/pns_line.cpp b/pcbnew/router/pns_line.cpp index 35c839c752..f6f7ec3043 100644 --- a/pcbnew/router/pns_line.cpp +++ b/pcbnew/router/pns_line.cpp @@ -38,16 +38,16 @@ PNS_LINE::PNS_LINE( const PNS_LINE& aOther ) : m_line( aOther.m_line ), m_width( aOther.m_width ) { - m_net = aOther.m_net; - m_movable = aOther.m_movable; - m_layers = aOther.m_layers; - m_owner = aOther.m_owner; - m_via = aOther.m_via; - m_hasVia = aOther.m_hasVia; - m_marker = aOther.m_marker; - m_rank = aOther.m_rank; + m_net = aOther.m_net; + m_movable = aOther.m_movable; + m_layers = aOther.m_layers; + m_owner = NULL; + m_via = aOther.m_via; + m_hasVia = aOther.m_hasVia; + m_marker = aOther.m_marker; + m_rank = aOther.m_rank; - copyLinks( &aOther ); + copyLinks( &aOther ); } @@ -137,7 +137,7 @@ void PNS_LINE::copyLinks( const PNS_LINE* aParent ) } -PNS_SEGMENT* PNS_SEGMENT::Clone( ) const +PNS_SEGMENT* PNS_SEGMENT::Clone() const { PNS_SEGMENT* s = new PNS_SEGMENT; diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index 6487cea3b7..50c84bdb11 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -1110,13 +1110,12 @@ void PNS_NODE::GetUpdatedItems( ITEM_VECTOR& aRemoved, ITEM_VECTOR& aAdded ) aAdded.push_back( *i ); } - void PNS_NODE::releaseChildren() { // copy the kids as the PNS_NODE destructor erases the item from the parent node. std::vector kids = m_children; - BOOST_FOREACH( PNS_NODE * node, kids ) + BOOST_FOREACH( PNS_NODE* node, kids ) { node->releaseChildren(); delete node; @@ -1126,7 +1125,7 @@ void PNS_NODE::releaseChildren() void PNS_NODE::releaseGarbage() { - if( !isRoot( ) ) + if( !isRoot() ) return; BOOST_FOREACH( PNS_ITEM* item, m_garbageItems ) @@ -1162,7 +1161,7 @@ void PNS_NODE::Commit( PNS_NODE* aNode ) void PNS_NODE::KillChildren() { - assert ( isRoot() ); + assert( isRoot() ); releaseChildren(); } diff --git a/pcbnew/router/pns_node.h b/pcbnew/router/pns_node.h index 296932b14f..5f6c19573e 100644 --- a/pcbnew/router/pns_node.h +++ b/pcbnew/router/pns_node.h @@ -135,8 +135,8 @@ public: typedef std::vector ITEM_VECTOR; typedef std::vector OBSTACLES; - PNS_NODE (); - ~PNS_NODE (); + PNS_NODE(); + ~PNS_NODE(); ///> Returns the expected clearance between items a and b. int GetClearance( const PNS_ITEM* aA, const PNS_ITEM* aB ) const; @@ -426,7 +426,7 @@ private: return m_override.find( aItem ) != m_override.end(); } - PNS_SEGMENT *findRedundantSegment ( PNS_SEGMENT* aSeg ); + PNS_SEGMENT* findRedundantSegment( PNS_SEGMENT* aSeg ); ///> scans the joint map, forming a line starting from segment (current). void followLine( PNS_SEGMENT* aCurrent, @@ -466,7 +466,7 @@ private: int m_depth; ///> optional collision filtering object - PNS_COLLISION_FILTER *m_collisionFilter; + PNS_COLLISION_FILTER* m_collisionFilter; boost::unordered_set m_garbageItems; }; diff --git a/pcbnew/router/pns_via.cpp b/pcbnew/router/pns_via.cpp index 8faee3f207..29f907d7ed 100644 --- a/pcbnew/router/pns_via.cpp +++ b/pcbnew/router/pns_via.cpp @@ -78,7 +78,7 @@ const SHAPE_LINE_CHAIN PNS_VIA::Hull( int aClearance, int aWalkaroundThickness ) } -PNS_VIA* PNS_VIA::Clone ( ) const +PNS_VIA* PNS_VIA::Clone() const { PNS_VIA* v = new PNS_VIA();