From 9d0b16e81451365403a39623677365c141fb5a14 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Sun, 31 Jan 2021 19:38:20 -0500 Subject: [PATCH] bool/int type safety --- include/eda_item.h | 2 +- pcbnew/connectivity/from_to_cache.cpp | 2 +- pcbnew/drc/drc_engine.cpp | 2 +- pcbnew/drc/drc_engine.h | 2 +- thirdparty/rtree/geometry/rtree.h | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/eda_item.h b/include/eda_item.h index 268f0cc7b7..252180da3a 100644 --- a/include/eda_item.h +++ b/include/eda_item.h @@ -188,7 +188,7 @@ public: return m_status & type; } - void SetState( int type, int state ) + void SetState( int type, bool state ) { if( state ) m_status |= type; // state = ON or OFF diff --git a/pcbnew/connectivity/from_to_cache.cpp b/pcbnew/connectivity/from_to_cache.cpp index 2696c61273..3ef065b255 100644 --- a/pcbnew/connectivity/from_to_cache.cpp +++ b/pcbnew/connectivity/from_to_cache.cpp @@ -76,7 +76,7 @@ static PATH_STATUS uniquePathBetweenNodes( CN_ITEM* u, CN_ITEM* v, std::vector Q; Path pInit; - int pathFound = false; + bool pathFound = false; pInit.push_back( u ); Q.push_back( pInit ); diff --git a/pcbnew/drc/drc_engine.cpp b/pcbnew/drc/drc_engine.cpp index 51d7ccc6b0..0a07dcf092 100644 --- a/pcbnew/drc/drc_engine.cpp +++ b/pcbnew/drc/drc_engine.cpp @@ -1174,7 +1174,7 @@ static int matchDpSuffix( const wxString& aNetName, wxString& aComplementNet, } -int DRC_ENGINE::IsNetADiffPair( BOARD* aBoard, NETINFO_ITEM* aNet, int& aNetP, int& aNetN ) +bool DRC_ENGINE::IsNetADiffPair( BOARD* aBoard, NETINFO_ITEM* aNet, int& aNetP, int& aNetN ) { wxString refName = aNet->GetNetname(); wxString dummy, coupledNetName; diff --git a/pcbnew/drc/drc_engine.h b/pcbnew/drc/drc_engine.h index 8d828fad19..23e7e97564 100644 --- a/pcbnew/drc/drc_engine.h +++ b/pcbnew/drc/drc_engine.h @@ -164,7 +164,7 @@ public: DRC_TEST_PROVIDER* GetTestProvider( const wxString& name ) const; - static int IsNetADiffPair( BOARD* aBoard, NETINFO_ITEM* aNet, int& aNetP, int& aNetN ); + static bool IsNetADiffPair( BOARD* aBoard, NETINFO_ITEM* aNet, int& aNetP, int& aNetN ); private: void addRule( DRC_RULE* rule ) diff --git a/thirdparty/rtree/geometry/rtree.h b/thirdparty/rtree/geometry/rtree.h index 23971e4833..7cb4639516 100644 --- a/thirdparty/rtree/geometry/rtree.h +++ b/thirdparty/rtree/geometry/rtree.h @@ -499,7 +499,7 @@ protected: int m_partition[MAXNODES + 1]; int m_total; int m_minFill; - int m_taken[MAXNODES + 1]; + bool m_taken[MAXNODES + 1]; int m_count[2]; Rect m_cover[2]; ELEMTYPEREAL m_area[2]; @@ -1333,7 +1333,7 @@ typename RTREE_QUAL::Rect RTREE_QUAL::NodeCover( Node* a_node ) const { ASSERT( a_node ); - int firstTime = true; + bool firstTime = true; Rect rect; InitRect( &rect );