diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index c5b4f082b2..a04f549248 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -643,7 +643,7 @@ int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent ) { case PCB_T: { - BOARD* clipBoard = (BOARD*) clipItem; + BOARD* clipBoard = static_cast( clipItem ); if( editModules ) { @@ -675,7 +675,7 @@ int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent ) { if( clipDrawItem->Type() == PCB_LINE_T ) { - DRAWSEGMENT* clipDrawSeg = (DRAWSEGMENT*) clipDrawItem; + DRAWSEGMENT* clipDrawSeg = static_cast( clipDrawItem ); // Convert to PCB_MODULE_EDGE_T EDGE_MODULE* pastedDrawSeg = new EDGE_MODULE( editModule ); @@ -686,7 +686,7 @@ int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent ) } else if( clipDrawItem->Type() == PCB_TEXT_T ) { - TEXTE_PCB* clipTextItem = (TEXTE_PCB*) clipDrawItem; + TEXTE_PCB* clipTextItem = static_cast( clipDrawItem ); // Convert to PCB_MODULE_TEXT_T TEXTE_MODULE* pastedTextItem = new TEXTE_MODULE( editModule ); @@ -714,7 +714,7 @@ int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent ) case PCB_MODULE_T: { - MODULE* clipModule = (MODULE*) clipItem; + MODULE* clipModule = static_cast( clipItem ); std::vector pastedItems; if( editModules ) @@ -879,7 +879,7 @@ int PCBNEW_CONTROL::placeBoardItems( std::vector& aItems, bool aIsN } else { - BOARD_ITEM* item = (BOARD_ITEM*) selection.GetTopLeftItem(); + BOARD_ITEM* item = static_cast( selection.GetTopLeftItem() ); selection.SetReferencePoint( item->GetPosition() ); } @@ -1032,7 +1032,7 @@ int PCBNEW_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) if( selection.GetSize() == 1 ) { - EDA_ITEM* item = (EDA_ITEM*) selection.Front(); + EDA_ITEM* item = selection.Front(); MSG_PANEL_ITEMS msgItems; item->GetMsgPanelInfo( m_frame->GetUserUnits(), msgItems ); @@ -1048,7 +1048,7 @@ int PCBNEW_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) } else if( auto editFrame = dynamic_cast( m_frame ) ) { - MODULE* footprint = (MODULE*) editFrame->GetModel(); + MODULE* footprint = static_cast( editFrame->GetModel() ); if( !footprint ) return 0;