Remove superfluous m_status variable

This used to be used to store information for the item similar to
m_state but it has been deprecated and no uses remained
This commit is contained in:
Seth Hillbrand 2023-03-24 09:37:42 -07:00
parent 244c37298f
commit 19d0aceda3
11 changed files with 19 additions and 46 deletions

View File

@ -34,7 +34,6 @@
#include <wx/fdrepdlg.h>
EDA_ITEM::EDA_ITEM( EDA_ITEM* parent, KICAD_T idType ) :
m_status( 0 ),
m_parent( parent ),
m_forceVisible( false ),
m_flags( 0 ),
@ -43,7 +42,6 @@ EDA_ITEM::EDA_ITEM( EDA_ITEM* parent, KICAD_T idType ) :
EDA_ITEM::EDA_ITEM( KICAD_T idType ) :
m_status( 0 ),
m_parent( nullptr ),
m_forceVisible( false ),
m_flags( 0 ),
@ -53,7 +51,6 @@ EDA_ITEM::EDA_ITEM( KICAD_T idType ) :
EDA_ITEM::EDA_ITEM( const EDA_ITEM& base ) :
m_Uuid( base.m_Uuid ),
m_status( base.m_status ),
m_parent( base.m_parent ),
m_forceVisible( base.m_forceVisible ),
m_flags( base.m_flags ),
@ -245,7 +242,6 @@ EDA_ITEM& EDA_ITEM::operator=( const EDA_ITEM& aItem )
m_structType = aItem.m_structType;
m_flags = aItem.m_flags;
m_status = aItem.m_status;
m_parent = aItem.m_parent;
m_forceVisible = aItem.m_forceVisible;

View File

@ -1485,6 +1485,13 @@ void VIEW::UpdateItems()
if( anyUpdated )
{
GAL_UPDATE_CONTEXT ctx( m_gal );
std::vector<VIEW_ITEM*> items_to_update( m_allItems->size() );
std::copy_if( m_allItems->begin(), m_allItems->end(),
std::back_inserter( items_to_update ),
[]( VIEW_ITEM *aItem )
{ return aItem->viewPrivData() && aItem->viewPrivData()->m_requiredUpdate != NONE; }
);
for( VIEW_ITEM* item : *m_allItems.get() )
{
@ -1494,6 +1501,8 @@ void VIEW::UpdateItems()
item->viewPrivData()->m_requiredUpdate = NONE;
}
}
}
KI_TRACE( traceGalProfile, wxS( "View update: total items %u, geom %u anyUpdated %u\n" ), cntTotal,

View File

@ -906,7 +906,6 @@ void GERBER_DRAW_ITEM::Show( int nestLevel, std::ostream& os ) const
" layer=\"" << GetLayer() << '"' <<
" size=\"" << m_Size << '"' <<
" flags=\"" << m_flags << '"' <<
" status=\"" << GetStatus() << '"' <<
"<start" << m_Start << "/>" <<
"<end" << m_End << "/>";

View File

@ -120,22 +120,6 @@ public:
void SetModified();
int GetState( EDA_ITEM_FLAGS type ) const
{
return m_status & type;
}
void SetState( EDA_ITEM_FLAGS type, bool state )
{
if( state )
m_status |= type; // state = ON or OFF
else
m_status &= ~type;
}
EDA_ITEM_FLAGS GetStatus() const { return m_status; }
void SetStatus( EDA_ITEM_FLAGS aStatus ) { m_status = aStatus; }
void SetFlags( EDA_ITEM_FLAGS aMask ) { m_flags |= aMask; }
void XorFlags( EDA_ITEM_FLAGS aMask ) { m_flags ^= aMask; }
void ClearFlags( EDA_ITEM_FLAGS aMask = EDA_ITEM_ALL_FLAGS ) { m_flags &= ~aMask; }
@ -491,7 +475,6 @@ public:
const KIID m_Uuid;
protected:
EDA_ITEM_FLAGS m_status;
EDA_ITEM* m_parent; ///< Linked list: Link (parent struct)
bool m_forceVisible;
EDA_ITEM_FLAGS m_flags;

View File

@ -57,8 +57,7 @@
#define MALFORMED_F_COURTYARD (1 << 20)
#define MALFORMED_B_COURTYARD (1 << 21)
#define MALFORMED_COURTYARDS ( MALFORMED_F_COURTYARD | MALFORMED_B_COURTYARD )
#define BEGIN_ONPAD (1 << 22) ///< Pcbnew: flag set for track segment starting on a pad
#define END_ONPAD (1 << 23) ///< Pcbnew: flag set for track segment ending on a pad
// 22 and 23 are unused
#define HOLE_PROXY (1 << 24) ///< Indicates the BOARD_ITEM is a proxy for its hole
#define IS_ROLLOVER (1 << 25) ///< Rollover active. Used for hyperlink highlighting.
#define SHOW_ELEC_TYPE (1 << 25) ///< Show pin electrical type. Shared with IS_ROLLOVER.

View File

@ -873,8 +873,6 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
//
if( !m_isDryRun )
{
m_board->SetStatus( 0 );
for( NETINFO_ITEM* net : m_board->GetNetInfo() )
net->SetIsCurrent( net->GetNetCode() == 0 );
}

View File

@ -118,7 +118,6 @@ void PCB_BITMAP::swapData( BOARD_ITEM* aItem )
std::swap( m_isKnockout, item->m_isKnockout );
std::swap( m_isLocked, item->m_isLocked );
std::swap( m_flags, item->m_flags );
std::swap( m_status, item->m_status );
std::swap( m_parent, item->m_parent );
std::swap( m_forceVisible, item->m_forceVisible );
std::swap( m_pos, item->m_pos );

View File

@ -359,7 +359,6 @@ void PCB_SHAPE::swapData( BOARD_ITEM* aImage )
std::swap( m_isKnockout, image->m_isKnockout );
std::swap( m_isLocked, image->m_isLocked );
std::swap( m_flags, image->m_flags );
std::swap( m_status, image->m_status );
std::swap( m_parent, image->m_parent );
std::swap( m_forceVisible, image->m_forceVisible );
}

View File

@ -2800,7 +2800,7 @@ PCB_SHAPE* PCB_PARSER::parsePCB_SHAPE()
// We continue to parse the status field but it is no longer written
case T_status:
shape->SetStatus( static_cast<EDA_ITEM_FLAGS>( parseHex() ) );
parseHex();
NeedRIGHT();
break;
@ -4524,7 +4524,7 @@ FP_SHAPE* PCB_PARSER::parseFP_SHAPE()
// We continue to parse the status field but it is no longer written
case T_status:
shape->SetStatus( static_cast<EDA_ITEM_FLAGS>( parseHex() ) );
parseHex();
NeedRIGHT();
break;
@ -5274,7 +5274,7 @@ PCB_ARC* PCB_PARSER::parseARC()
// We continue to parse the status field but it is no longer written
case T_status:
arc->SetStatus( static_cast<EDA_ITEM_FLAGS>( parseHex() ) );
parseHex();
break;
// Continue to process "(locked)" format which was output during 5.99 development
@ -5353,7 +5353,7 @@ PCB_TRACK* PCB_PARSER::parsePCB_TRACK()
// We continue to parse the status field but it is no longer written
case T_status:
track->SetStatus( static_cast<EDA_ITEM_FLAGS>( parseHex() ) );
parseHex();
break;
// Continue to process "(locked)" format which was output during 5.99 development
@ -5481,7 +5481,7 @@ PCB_VIA* PCB_PARSER::parsePCB_VIA()
// We continue to parse the status field but it is no longer written
case T_status:
via->SetStatus( static_cast<EDA_ITEM_FLAGS>( parseHex() ) );
parseHex();
NeedRIGHT();
break;

View File

@ -1874,9 +1874,8 @@ void LEGACY_PLUGIN::loadPCB_LINE()
break;
case 4:
{
EDA_ITEM_FLAGS state;
state = static_cast<EDA_ITEM_FLAGS>( hexParse( data ) );
dseg->SetState( state, true );
// Ignore state data
hexParse( data );
break;
}
// Bezier Control Points
@ -2149,9 +2148,9 @@ void LEGACY_PLUGIN::loadTrackList( int aStructType )
int type = intParse( data, &data );
int net_code = intParse( data, &data );
char* uuid = strtok_r( (char*) data, delims, (char**) &data );
int flags_int = intParse( data, (const char**) &data );
EDA_ITEM_FLAGS flags = static_cast<EDA_ITEM_FLAGS>( flags_int );
// Discard flags data
intParse( data, (const char**) &data );
if( aStructType == PCB_TRACE_T )
{
@ -2232,7 +2231,6 @@ void LEGACY_PLUGIN::loadTrackList( int aStructType )
if( newTrack )
{
newTrack->SetNetCode( getNetCode( net_code ) );
newTrack->SetState( flags, true );
m_board->Add( newTrack );
}

View File

@ -696,13 +696,6 @@ bool TRACKS_CLEANER::mergeCollinearSegments( PCB_TRACK* aSeg1, PCB_TRACK* aSeg2
m_brd->GetConnectivity()->Update( aSeg1 );
// Clear the status flags here after update.
for( PAD* pad : m_brd->GetConnectivity()->GetConnectedPads( aSeg1 ) )
{
aSeg1->SetState( BEGIN_ONPAD, pad->HitTest( aSeg1->GetStart() ) );
aSeg1->SetState( END_ONPAD, pad->HitTest( aSeg1->GetEnd() ) );
}
// Merge successful, seg2 has to go away
m_brd->Remove( aSeg2 );
m_commit.Removed( aSeg2 );