Fix compil warnings (UNDO_REDO::GROUP renamed to UNDO_REDO::REGROUP to fix

collision name with a widows header on msys2)
This commit is contained in:
jean-pierre charras 2021-08-28 11:44:01 +02:00
parent a9829a598e
commit 6c7c9ca50c
4 changed files with 24 additions and 23 deletions

View File

@ -444,7 +444,7 @@ public:
template<typename T>
void SetParameter(T aParam)
{
m_param = (void*) aParam;
m_param = reinterpret_cast<void*>( aParam );
}
OPT<int> GetCommandId() const

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2009 jean-pierre.charras@gipsa-lab.inpg.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2009-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2009-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -54,22 +54,23 @@ class BASE_SCREEN;
* Each type must be redo/undone by a specific operation.
*/
enum class UNDO_REDO {
UNSPECIFIED = 0, // illegal
NOP, // Undo/redo will ignore this entry. Only forces the start of a new stack
CHANGED, // params of items have a value changed: undo is made by exchange
// values with a copy of these values
NEWITEM, // new item, undo by changing in deleted
DELETED, // deleted item, undo by changing in deleted
LIBEDIT, // Specific to the component editor (symbol_editor creates a full copy
// of the current component when changed)
LIB_RENAME, // As LIBEDIT, but old copy should be removed from library
EXCHANGE_T, // Use for changing the schematic text type where swapping
// data structure is insufficient to restore the change.
DRILLORIGIN, // origin changed (like CHANGED, contains the origin and a copy)
GRIDORIGIN, // origin changed (like CHANGED, contains the origin and a copy)
PAGESETTINGS, // page settings or title block changes
GROUP,
UNGROUP
UNSPECIFIED = 0, // illegal
NOP, // Undo/redo will ignore this entry. Only forces the start of a new stack
CHANGED, // params of items have a value changed: undo is made by exchange
// values with a copy of these values
NEWITEM, // new item, undo by changing in deleted
DELETED, // deleted item, undo by changing in deleted
LIBEDIT, // Specific to the component editor (symbol_editor creates a full copy
// of the current component when changed)
LIB_RENAME, // As LIBEDIT, but old copy should be removed from library
EXCHANGE_T, // Use for changing the schematic text type where swapping
// data structure is insufficient to restore the change.
DRILLORIGIN, // origin changed (like CHANGED, contains the origin and a copy)
GRIDORIGIN, // origin changed (like CHANGED, contains the origin and a copy)
PAGESETTINGS, // page settings or title block changes
REGROUP, // new group of items created (do not use GROUP to avoid collision
// with an header on msys2)
UNGROUP // existing group destroyed (items not destroyed)
};

View File

@ -279,10 +279,10 @@ int GROUP_TOOL::Group( const TOOL_EVENT& aEvent )
for( EDA_ITEM* item : selection )
{
group->AddItem( static_cast<BOARD_ITEM*>( item ) );
undoList.PushItem( ITEM_PICKER( nullptr, item, UNDO_REDO::GROUP ) );
undoList.PushItem( ITEM_PICKER( nullptr, item, UNDO_REDO::REGROUP ) );
}
m_frame->SaveCopyInUndoList( undoList, UNDO_REDO::GROUP );
m_frame->SaveCopyInUndoList( undoList, UNDO_REDO::REGROUP );
}
selTool->ClearSelection();

View File

@ -284,7 +284,7 @@ void PCB_BASE_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsLis
case UNDO_REDO::NEWITEM:
case UNDO_REDO::DELETED:
case UNDO_REDO::PAGESETTINGS:
case UNDO_REDO::GROUP:
case UNDO_REDO::REGROUP:
case UNDO_REDO::UNGROUP:
break;
@ -489,13 +489,13 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
break;
case UNDO_REDO::GROUP:
case UNDO_REDO::REGROUP:
aList->SetPickedItemStatus( UNDO_REDO::UNGROUP, ii );
static_cast<BOARD_ITEM*>( eda_item )->SetParentGroup( nullptr );
break;
case UNDO_REDO::UNGROUP:
aList->SetPickedItemStatus( UNDO_REDO::GROUP, ii );
aList->SetPickedItemStatus( UNDO_REDO::REGROUP, ii );
if( group )
group->AddItem( static_cast<BOARD_ITEM*>( eda_item ) );