Fix build errors; warnings

(somehow, the previous version compiles on my machine...)
This commit is contained in:
Jon Evans 2024-03-26 19:38:28 -04:00
parent 5aa8af1abf
commit 1acb1afa98
3 changed files with 7 additions and 11 deletions

View File

@ -1138,20 +1138,14 @@ void BOARD::RemoveAll( std::initializer_list<KICAD_T> aTypes )
{ {
std::vector<BOARD_ITEM*> removed; std::vector<BOARD_ITEM*> removed;
if( aTypes.size() == 1 && *aTypes.begin() == TYPE_NOT_INIT )
{
aTypes = {
PCB_NETINFO_T, PCB_MARKER_T, PCB_GROUP_T, PCB_ZONE_T, PCB_GENERATOR_T, PCB_FOOTPRINT_T,
PCB_TRACE_T, PCB_SHAPE_T
};
}
for( const KICAD_T& type : aTypes ) for( const KICAD_T& type : aTypes )
{ {
switch( type ) switch( type )
{ {
case PCB_NETINFO_T: case PCB_NETINFO_T:
std::copy( m_NetInfo.begin(), m_NetInfo.end(), std::back_inserter( removed ) ); for( NETINFO_ITEM* item : m_NetInfo )
removed.emplace_back( item );
m_NetInfo.clear(); m_NetInfo.clear();
break; break;

View File

@ -390,7 +390,10 @@ public:
* granular than that, use BOARD::Remove. * granular than that, use BOARD::Remove.
* @param aTypes is a list of one or more types to remove, or leave default to remove all * @param aTypes is a list of one or more types to remove, or leave default to remove all
*/ */
void RemoveAll( std::initializer_list<KICAD_T> aTypes = { TYPE_NOT_INIT } ); void RemoveAll( std::initializer_list<KICAD_T> aTypes = { PCB_NETINFO_T, PCB_MARKER_T,
PCB_GROUP_T, PCB_ZONE_T,
PCB_GENERATOR_T, PCB_FOOTPRINT_T,
PCB_TRACE_T, PCB_SHAPE_T } );
/** /**
* Must be used if Add() is used using a BULK_x ADD_MODE to generate a change event for * Must be used if Add() is used using a BULK_x ADD_MODE to generate a change event for

View File

@ -849,7 +849,6 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent )
wxT( "" ) + rcItem->GetErrorText() ); wxT( "" ) + rcItem->GetErrorText() );
BOARD* board = m_frame->GetBoard(); BOARD* board = m_frame->GetBoard();
const std::vector<PCB_MARKER*>& markers = board->Markers();
std::vector<BOARD_ITEM*> toRemove; std::vector<BOARD_ITEM*> toRemove;