Fix more places where casts into RunAction were happening

This commit is contained in:
Ian McInerney 2022-09-29 00:57:21 +01:00
parent 8f3d159905
commit 07cc85e76c
7 changed files with 13 additions and 17 deletions

View File

@ -130,7 +130,7 @@ bool DIALOG_GRID_SETTINGS::TransferDataFromWindow()
mgr->ResetTools( TOOL_BASE::REDRAW );
// Notify GAL
mgr->RunAction( ACTIONS::gridPreset, true, static_cast<intptr_t>( gridCfg.last_size_idx ) );
mgr->RunAction( ACTIONS::gridPreset, true, gridCfg.last_size_idx );
mgr->RunAction( ACTIONS::gridSetOrigin, true, new VECTOR2D( m_parent->GetGridOrigin() ) );
m_parent->UpdateGridSelectBox();

View File

@ -192,9 +192,9 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
bbox = footprint->GetBoundingBox( true, false ); // No invisible text in bbox calc
if( pad )
m_toolManager->RunAction( PCB_ACTIONS::highlightItem, true, (void*) pad );
m_toolManager->RunAction( PCB_ACTIONS::highlightItem, true, pad );
else
m_toolManager->RunAction( PCB_ACTIONS::highlightItem, true, (void*) footprint );
m_toolManager->RunAction( PCB_ACTIONS::highlightItem, true, footprint );
}
else if( netcode > 0 || multiHighlight )
{
@ -645,13 +645,11 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
if( selectConnections )
{
GetToolManager()->RunAction( PCB_ACTIONS::syncSelectionWithNets, true,
static_cast<void*>( &items ) );
GetToolManager()->RunAction( PCB_ACTIONS::syncSelectionWithNets, true, &items );
}
else
{
GetToolManager()->RunAction( PCB_ACTIONS::syncSelection, true,
static_cast<void*>( &items ) );
GetToolManager()->RunAction( PCB_ACTIONS::syncSelection, true, &items );
}
// Update 3D viewer highlighting

View File

@ -1038,7 +1038,7 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
// Otherwise it is one of the router-specific via commands
if( targetLayer == UNDEFINED_LAYER )
{
const int actViaFlags = aEvent.Parameter<int>();
const int actViaFlags = static_cast<int>( aEvent.Parameter<VIA_ACTION_FLAGS>() );
selectLayer = actViaFlags & VIA_ACTION_FLAGS::SELECT_LAYER;
viaType = getViaTypeFromFlags( actViaFlags );
@ -2234,7 +2234,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
p = controls()->GetCursorPosition();
}
int dragMode = aEvent.Parameter<int64_t> ();
int dragMode = aEvent.Parameter<int> ();
bool dragStarted = m_router->StartDragging( p, itemsToDrag, dragMode );

View File

@ -1481,7 +1481,7 @@ int BOARD_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent )
},
true /* prompt user regarding locked items */ );
intptr_t netCode = -1;
int netCode = -1;
wxString netName;
for( EDA_ITEM* item : selection )
@ -1503,7 +1503,7 @@ int BOARD_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent )
}
selectionTool->ClearSelection();
m_toolMgr->RunAction( PCB_ACTIONS::selectNet, true, (void*) netCode );
m_toolMgr->RunAction( PCB_ACTIONS::selectNet, true, netCode );
canvas()->ForceRefresh();
DIALOG_ASSIGN_NETCLASS dlg( m_frame, netName, board()->GetNetClassAssignmentCandidates(),

View File

@ -1519,7 +1519,7 @@ int BOARD_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
if( item )
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, (void*) item );
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, item );
}
m_frame->m_probingSchToPcb = false;

View File

@ -283,7 +283,7 @@ int EDIT_TOOL::GetAndPlace( const TOOL_EVENT& aEvent )
if( fp )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, (void*) fp );
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, fp );
selectionTool->GetSelection().SetReferencePoint( fp->GetPosition() );
m_toolMgr->RunAction( PCB_ACTIONS::move, false );
@ -314,8 +314,7 @@ bool EDIT_TOOL::invokeInlineRouter( int aDragMode )
if( theRouter->CanInlineDrag( aDragMode ) )
{
m_toolMgr->RunAction( PCB_ACTIONS::routerInlineDrag, true,
static_cast<intptr_t>( aDragMode ) );
m_toolMgr->RunAction( PCB_ACTIONS::routerInlineDrag, true, aDragMode );
return true;
}

View File

@ -3194,8 +3194,7 @@ void APPEARANCE_CONTROLS::onNetclassContextMenu( wxCommandEvent& aEvent )
runOnNetsOfClass( m_contextMenuNetclass,
[&]( NETINFO_ITEM* aItem )
{
toolMgr->RunAction( action, true,
static_cast<intptr_t>( aItem->GetNetCode() ) );
toolMgr->RunAction( action, true, aItem->GetNetCode() );
} );
}
break;