diff --git a/common/commit.cpp b/common/commit.cpp index ddc31c3e78..6939539b0e 100644 --- a/common/commit.cpp +++ b/common/commit.cpp @@ -23,6 +23,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include #include diff --git a/common/geometry/shape_line_chain.cpp b/common/geometry/shape_line_chain.cpp index c3254084d8..8abfcfb4e1 100644 --- a/common/geometry/shape_line_chain.cpp +++ b/common/geometry/shape_line_chain.cpp @@ -22,11 +22,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include #include -using boost::optional; - bool SHAPE_LINE_CHAIN::Collide( const VECTOR2I& aP, int aClearance ) const { // fixme: ugly! @@ -366,7 +366,7 @@ bool SHAPE_LINE_CHAIN::PointOnEdge( const VECTOR2I& aP ) const } -const optional SHAPE_LINE_CHAIN::SelfIntersecting() const +const OPT SHAPE_LINE_CHAIN::SelfIntersecting() const { for( int s1 = 0; s1 < SegmentCount(); s1++ ) { @@ -410,7 +410,7 @@ const optional SHAPE_LINE_CHAIN::SelfIntersectin } } - return optional(); + return OPT(); } diff --git a/common/tool/tool_action.cpp b/common/tool/tool_action.cpp index c73445f95b..622bb5e7ff 100644 --- a/common/tool/tool_action.cpp +++ b/common/tool/tool_action.cpp @@ -25,6 +25,8 @@ #include #include +#include + TOOL_ACTION::TOOL_ACTION( const std::string& aName, TOOL_ACTION_SCOPE aScope, int aDefaultHotKey, const wxString aMenuItem, const wxString& aMenuDesc, const BITMAP_OPAQUE* aIcon, TOOL_ACTION_FLAGS aFlags, void* aParam ) : diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index f27cc93c14..feacd15aef 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include ///> Stores information about a mouse button state struct TOOL_DISPATCHER::BUTTON_STATE @@ -154,7 +154,7 @@ bool TOOL_DISPATCHER::handleMouseButton( wxEvent& aEvent, int aIndex, bool aMoti { BUTTON_STATE* st = m_buttons[aIndex]; wxEventType type = aEvent.GetEventType(); - boost::optional evt; + OPT evt; bool isClick = false; // bool up = type == st->upEvent; @@ -307,7 +307,7 @@ int translateSpecialCode( int aKeyCode ) void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) { bool motion = false, buttonEvents = false; - boost::optional evt; + OPT evt; int key = 0; // key = 0 if the event is not a key event bool keyIsSpecial = false; // True if the key is a special key code @@ -436,7 +436,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) void TOOL_DISPATCHER::DispatchWxCommand( wxCommandEvent& aEvent ) { - boost::optional evt = m_actions->TranslateLegacyId( aEvent.GetId() ); + OPT evt = m_actions->TranslateLegacyId( aEvent.GetId() ); if( evt ) m_toolMgr->ProcessEvent( *evt ); diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index b8933bc4bb..7e0f891e69 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -44,8 +44,6 @@ #include #include -using boost::optional; - /// Struct describing the current execution state of a TOOL struct TOOL_MANAGER::TOOL_STATE { @@ -494,7 +492,7 @@ void TOOL_MANAGER::RunMainStack( TOOL_BASE* aTool, std::function aFunc ) } -optional TOOL_MANAGER::ScheduleWait( TOOL_BASE* aTool, +OPT TOOL_MANAGER::ScheduleWait( TOOL_BASE* aTool, const TOOL_EVENT_LIST& aConditions ) { TOOL_STATE* st = m_toolState[aTool]; @@ -632,7 +630,6 @@ bool TOOL_MANAGER::dispatchActivation( const TOOL_EVENT& aEvent ) return false; } - void TOOL_MANAGER::dispatchContextMenu( const TOOL_EVENT& aEvent ) { // Store the current tool ID to decide whether to restore the cursor position @@ -703,10 +700,10 @@ void TOOL_MANAGER::dispatchContextMenu( const TOOL_EVENT& aEvent ) if( activeTool == GetCurrentToolId() ) { m_viewControls->ForceCursorPosition( (bool) m_origCursor, - m_origCursor.get_value_or( VECTOR2D( 0, 0 ) ) ); + m_origCursor.value_or( VECTOR2D( 0, 0 ) ) ); } - m_origCursor = boost::none; + m_origCursor = NULLOPT; break; } } diff --git a/common/wx_unit_binder.cpp b/common/wx_unit_binder.cpp index 82dbfa6f0b..f9563ef8cd 100644 --- a/common/wx_unit_binder.cpp +++ b/common/wx_unit_binder.cpp @@ -29,8 +29,6 @@ #include #include -#include - #include "wx_unit_binder.h" WX_UNIT_BINDER::WX_UNIT_BINDER( wxWindow* aParent, wxTextEntry* aTextInput, diff --git a/common/wxunittext.cpp b/common/wxunittext.cpp index 646fb90b65..3efcfab7f3 100644 --- a/common/wxunittext.cpp +++ b/common/wxunittext.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include WX_UNIT_TEXT::WX_UNIT_TEXT( wxWindow* aParent, const wxString& aLabel, double aValue, double aStep ) : wxPanel( aParent, wxID_ANY ), @@ -109,18 +109,18 @@ void WX_UNIT_TEXT::SetValue( double aValue ) } -boost::optional WX_UNIT_TEXT::GetValue() const +OPT WX_UNIT_TEXT::GetValue() const { wxString text = m_inputValue->GetValue(); double value; if( text == DEFAULT_VALUE ) - return boost::optional( -1.0 ); + return OPT( -1.0 ); if( !text.ToDouble( &value ) ) - return boost::optional(); + return OPT(); - return boost::optional( value ); + return OPT( value ); } diff --git a/gerbview/tools/gerbview_actions.cpp b/gerbview/tools/gerbview_actions.cpp index 577c84ea1c..250fffb8db 100644 --- a/gerbview/tools/gerbview_actions.cpp +++ b/gerbview/tools/gerbview_actions.cpp @@ -36,7 +36,7 @@ void GERBVIEW_ACTIONS::RegisterAllTools( TOOL_MANAGER* aToolManager ) aToolManager->RegisterTool( new ZOOM_TOOL ); } -boost::optional GERBVIEW_ACTIONS::TranslateLegacyId( int aId ) +OPT GERBVIEW_ACTIONS::TranslateLegacyId( int aId ) { switch( aId ) { @@ -72,5 +72,5 @@ boost::optional GERBVIEW_ACTIONS::TranslateLegacyId( int aId ) break; } - return boost::optional(); + return OPT(); } diff --git a/gerbview/tools/gerbview_actions.h b/gerbview/tools/gerbview_actions.h index facc333c45..2c9fe5c379 100644 --- a/gerbview/tools/gerbview_actions.h +++ b/gerbview/tools/gerbview_actions.h @@ -23,7 +23,7 @@ #include #include -#include +#include class TOOL_EVENT; class TOOL_MANAGER; @@ -130,7 +130,7 @@ public: static TOOL_ACTION highlightAttribute; ///> @copydoc COMMON_ACTIONS::TranslateLegacyId() - virtual boost::optional TranslateLegacyId( int aId ) override; + virtual OPT TranslateLegacyId( int aId ) override; ///> @copydoc COMMON_ACTIONS::RegisterAllTools() virtual void RegisterAllTools( TOOL_MANAGER* aToolManager ) override; diff --git a/gerbview/tools/selection_tool.cpp b/gerbview/tools/selection_tool.cpp index cf10e9d696..a2cba93aa7 100644 --- a/gerbview/tools/selection_tool.cpp +++ b/gerbview/tools/selection_tool.cpp @@ -692,7 +692,7 @@ EDA_ITEM* GERBVIEW_SELECTION_TOOL::disambiguationMenu( GERBER_COLLECTOR* aCollec } else if( evt->Action() == TA_CONTEXT_MENU_CHOICE ) { - boost::optional id = evt->GetCommandId(); + OPT id = evt->GetCommandId(); // User has selected an item, so this one will be returned if( id && ( *id > 0 ) ) diff --git a/include/core/optional.h b/include/core/optional.h new file mode 100644 index 0000000000..21b7bd30fe --- /dev/null +++ b/include/core/optional.h @@ -0,0 +1,11 @@ +# ifndef ___OPTIONAL_H___ +# define ___OPTIONAL_H___ + +#include + +template +using OPT = boost::optional; + +const auto NULLOPT = boost::none; + +# endif //___OPTIONAL_HPP___ diff --git a/include/eagle_parser.h b/include/eagle_parser.h index 10207900c6..5cfa30e018 100644 --- a/include/eagle_parser.h +++ b/include/eagle_parser.h @@ -179,7 +179,7 @@ T Convert( const wxString& aValue ) /** * Class OPTIONAL_XML_ATTRIBUTE * models an optional XML attribute. - * This was implemented as an alternative to boost::optional. This class should be replaced with a + * This was implemented as an alternative to OPT. This class should be replaced with a * simple typedef per type using std::optional when C++17 is published. */ template diff --git a/include/gal/stroke_font.h b/include/gal/stroke_font.h index b84e570fff..a10ee431a4 100644 --- a/include/gal/stroke_font.h +++ b/include/gal/stroke_font.h @@ -30,6 +30,8 @@ #define STROKE_FONT_H_ #include +#include + #include #include diff --git a/include/geometry/seg.h b/include/geometry/seg.h index fedd9decc3..d3e410d223 100644 --- a/include/geometry/seg.h +++ b/include/geometry/seg.h @@ -29,10 +29,9 @@ #include #include +#include -#include - -typedef boost::optional OPT_VECTOR2I; +typedef OPT OPT_VECTOR2I; class SEG { diff --git a/include/geometry/shape_index_list.h b/include/geometry/shape_index_list.h index 194ae5ffd9..98fd33afea 100644 --- a/include/geometry/shape_index_list.h +++ b/include/geometry/shape_index_list.h @@ -25,8 +25,6 @@ #ifndef __SHAPE_INDEX_LIST_H #define __SHAPE_INDEX_LIST_H -#include - template const SHAPE* defaultShapeFunctor( const T aItem ) { diff --git a/include/geometry/shape_line_chain.h b/include/geometry/shape_line_chain.h index 18ac6aef92..49dda87835 100644 --- a/include/geometry/shape_line_chain.h +++ b/include/geometry/shape_line_chain.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include @@ -538,7 +538,7 @@ public: * Checks if the line chain is self-intersecting. * @return (optional) first found self-intersection point. */ - const boost::optional SelfIntersecting() const; + const OPT SelfIntersecting() const; /** * Function Simplify() diff --git a/include/math/box2.h b/include/math/box2.h index 5bf6ddd03c..99fa6c9d1a 100644 --- a/include/math/box2.h +++ b/include/math/box2.h @@ -30,7 +30,7 @@ #include #include -#include +#include /** * Class BOX2 @@ -468,7 +468,7 @@ public: typedef BOX2 BOX2I; typedef BOX2 BOX2D; -typedef boost::optional OPT_BOX2I; +typedef OPT OPT_BOX2I; // FIXME should be removed to avoid multiple typedefs for the same type typedef BOX2D DBOX; diff --git a/include/tool/actions.h b/include/tool/actions.h index 1eb5be8f7c..b4ccc9d058 100644 --- a/include/tool/actions.h +++ b/include/tool/actions.h @@ -27,7 +27,7 @@ #define __ACTIONS_H #include -#include +#include class TOOL_EVENT; class TOOL_MANAGER; @@ -73,7 +73,7 @@ public: * @return std::string is name of the corresponding TOOL_ACTION. It may be empty, if there is * no corresponding TOOL_ACTION. */ - virtual boost::optional TranslateLegacyId( int aId ) = 0; + virtual OPT TranslateLegacyId( int aId ) = 0; ///> Registers all valid tools for an application with the tool manager virtual void RegisterAllTools( TOOL_MANAGER* aToolManager ) = 0; diff --git a/include/tool/conditional_menu.h b/include/tool/conditional_menu.h index 7583611fcd..868c9a2c63 100644 --- a/include/tool/conditional_menu.h +++ b/include/tool/conditional_menu.h @@ -26,7 +26,6 @@ #define CONDITIONAL_MENU_H #include "selection_conditions.h" -#include #include #include diff --git a/include/tool/selection.h b/include/tool/selection.h index fb0c735ef3..0916f98481 100644 --- a/include/tool/selection.h +++ b/include/tool/selection.h @@ -172,7 +172,7 @@ public: bool HasReferencePoint() const { - return m_referencePoint != boost::none; + return m_referencePoint != NULLOPT; } VECTOR2I GetReferencePoint() const @@ -187,12 +187,12 @@ public: void ClearReferencePoint() { - m_referencePoint = boost::none; + m_referencePoint = NULLOPT; } private: - boost::optional m_referencePoint; + OPT m_referencePoint; /// Set of selected items std::set m_items; diff --git a/include/tool/tool_event.h b/include/tool/tool_event.h index fd83909476..a2feeae9a3 100644 --- a/include/tool/tool_event.h +++ b/include/tool/tool_event.h @@ -32,7 +32,7 @@ #include #include -#include +#include class TOOL_ACTION; class TOOL_MANAGER; @@ -387,12 +387,12 @@ public: m_param = (void*) aParam; } - boost::optional GetCommandId() const + OPT GetCommandId() const { return m_commandId; } - boost::optional GetCommandStr() const + OPT GetCommandStr() const { return m_commandStr; } @@ -453,11 +453,11 @@ private: ///> Generic parameter used for passing non-standard data. void* m_param; - boost::optional m_commandId; - boost::optional m_commandStr; + OPT m_commandId; + OPT m_commandStr; }; -typedef boost::optional OPT_TOOL_EVENT; +typedef OPT OPT_TOOL_EVENT; /** * Class TOOL_EVENT_LIST @@ -490,13 +490,13 @@ public: */ const std::string Format() const; - boost::optional Matches( const TOOL_EVENT& aEvent ) const + OPT Matches( const TOOL_EVENT& aEvent ) const { for( const_iterator i = m_events.begin(); i != m_events.end(); ++i ) if( i->Matches( aEvent ) ) return *i; - return boost::optional(); + return OPT(); } /** diff --git a/include/tool/tool_manager.h b/include/tool/tool_manager.h index 2762fd806b..e26a29138f 100644 --- a/include/tool/tool_manager.h +++ b/include/tool/tool_manager.h @@ -329,7 +329,7 @@ public: * The pause/resume operation is done through COROUTINE object. * Called only from coroutines. */ - boost::optional ScheduleWait( TOOL_BASE* aTool, + OPT ScheduleWait( TOOL_BASE* aTool, const TOOL_EVENT_LIST& aConditions ); /** @@ -514,7 +514,7 @@ private: ACTION_MANAGER* m_actionMgr; /// Original cursor position, if overridden by the context menu handler - boost::optional m_origCursor; + OPT m_origCursor; EDA_ITEM* m_model; KIGFX::VIEW* m_view; diff --git a/include/wxunittext.h b/include/wxunittext.h index f86d4aa55b..cb5beeb0f2 100644 --- a/include/wxunittext.h +++ b/include/wxunittext.h @@ -80,7 +80,7 @@ public: * Function GetValue * Returns the current value in currently used units. */ - virtual boost::optional GetValue() const; + virtual OPT GetValue() const; /** * Function GetUnits diff --git a/pcbnew/class_board_item.cpp b/pcbnew/class_board_item.cpp index 1f5c580581..1c60f85adc 100644 --- a/pcbnew/class_board_item.cpp +++ b/pcbnew/class_board_item.cpp @@ -262,5 +262,5 @@ void BOARD_ITEM::DeleteStructure() void BOARD_ITEM::SwapData( BOARD_ITEM* aImage ) { - + } diff --git a/pcbnew/class_pad_custom_shape_functions.cpp b/pcbnew/class_pad_custom_shape_functions.cpp index 83fe7689b4..b1f0c1f6e8 100644 --- a/pcbnew/class_pad_custom_shape_functions.cpp +++ b/pcbnew/class_pad_custom_shape_functions.cpp @@ -381,8 +381,7 @@ bool D_PAD::GetBestAnchorPosition( VECTOR2I& aPos ) minDistEdge = std::max( GetSize().x, GetSize().y ); } - boost::optional bestAnchor( []()-> - boost::optional{ return boost::none; }() ); + OPT bestAnchor; for ( int y = 0; y < stepsY ; y++ ) { diff --git a/pcbnew/dialogs/dialog_track_via_properties.cpp b/pcbnew/dialogs/dialog_track_via_properties.cpp index 6a8eb601cb..3c13a8041f 100644 --- a/pcbnew/dialogs/dialog_track_via_properties.cpp +++ b/pcbnew/dialogs/dialog_track_via_properties.cpp @@ -47,16 +47,16 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen wxASSERT( !m_items.Empty() ); // This is a way to trick gcc into considering these variables as initialized - boost::optional trackStartX = boost::make_optional( false, 0 ); - boost::optional trackStartY = boost::make_optional( false, 0 ); - boost::optional trackEndX = boost::make_optional( false, 0 ); - boost::optional trackEndY = boost::make_optional( false, 0 ); - boost::optional trackWidth = boost::make_optional( false, 0 ); - boost::optional trackLayer = boost::make_optional( false, (PCB_LAYER_ID) 0 ); - boost::optional viaX = boost::make_optional( false, 0 ); - boost::optional viaY = boost::make_optional( false, 0 ); - boost::optional viaDiameter = boost::make_optional( false, 0 ); - boost::optional viaDrill = boost::make_optional( false, 0 ); + OPT trackStartX = NULLOPT; + OPT trackStartY = NULLOPT; + OPT trackEndX = NULLOPT; + OPT trackEndY = NULLOPT; + OPT trackWidth = NULLOPT; + OPT trackLayer = NULLOPT; + OPT viaX = NULLOPT; + OPT viaY = NULLOPT; + OPT viaDiameter = NULLOPT; + OPT viaDrill = NULLOPT; m_haveUniqueNet = true; int prevNet = -1; @@ -112,22 +112,22 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen else // check if values are the same for every selected track { if( trackStartX && ( *trackStartX != t->GetStart().x ) ) - trackStartX = boost::none; + trackStartX = NULLOPT; if( trackStartY && ( *trackStartY != t->GetStart().y ) ) - trackStartY = boost::none; + trackStartY = NULLOPT; if( trackEndX && ( *trackEndX != t->GetEnd().x ) ) - trackEndX = boost::none; + trackEndX = NULLOPT; if( trackEndY && ( *trackEndY != t->GetEnd().y ) ) - trackEndY = boost::none; + trackEndY = NULLOPT; if( trackWidth && ( *trackWidth != t->GetWidth() ) ) - trackWidth = boost::none; + trackWidth = NULLOPT; if( trackLayer && ( *trackLayer != t->GetLayer() ) ) - trackLayer = boost::none; + trackLayer = NULLOPT; } if( t->IsLocked() ) @@ -153,16 +153,16 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen else // check if values are the same for every selected via { if( viaX && ( *viaX != v->GetPosition().x ) ) - viaX = boost::none; + viaX = NULLOPT; if( viaY && ( *viaY != v->GetPosition().y ) ) - viaY = boost::none; + viaY = NULLOPT; if( viaDiameter && ( *viaDiameter != v->GetWidth() ) ) - viaDiameter = boost::none; + viaDiameter = NULLOPT; if( viaDrill && ( *viaDrill != v->GetDrillValue() ) ) - viaDrill = boost::none; + viaDrill = NULLOPT; } if( v->IsLocked() ) diff --git a/pcbnew/dialogs/dialog_track_via_properties.h b/pcbnew/dialogs/dialog_track_via_properties.h index 50909924cc..ce327b6930 100644 --- a/pcbnew/dialogs/dialog_track_via_properties.h +++ b/pcbnew/dialogs/dialog_track_via_properties.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include class SELECTION; @@ -61,9 +61,9 @@ private: ///> Checks if the dialog values are correct. bool check() const; - ///> Sets wxTextEntry to the value stored in boost::optional or "<...>" if it is not available. + ///> Sets wxTextEntry to the value stored in OPT or "<...>" if it is not available. template - void setCommonVal( const boost::optional& aVal, wxTextEntry* aTxtEntry, WX_UNIT_BINDER& aBinder ) + void setCommonVal( const OPT& aVal, wxTextEntry* aTxtEntry, WX_UNIT_BINDER& aBinder ) { if( aVal ) aBinder.SetValue( *aVal ); diff --git a/pcbnew/dialogs/dialog_track_via_size.cpp b/pcbnew/dialogs/dialog_track_via_size.cpp index 9c4d1de84d..5c4ac50c43 100644 --- a/pcbnew/dialogs/dialog_track_via_size.cpp +++ b/pcbnew/dialogs/dialog_track_via_size.cpp @@ -25,7 +25,7 @@ #include "dialog_track_via_size.h" #include #include -#include +#include #include "class_board_design_settings.h" diff --git a/pcbnew/dialogs/wizard_add_fplib.cpp b/pcbnew/dialogs/wizard_add_fplib.cpp index 903a41be49..3b0adc481f 100644 --- a/pcbnew/dialogs/wizard_add_fplib.cpp +++ b/pcbnew/dialogs/wizard_add_fplib.cpp @@ -96,10 +96,10 @@ static wxString getFilterString() // Tries to guess the plugin type basing on the path -static boost::optional getPluginType( const wxString& aPath ) +static OPT getPluginType( const wxString& aPath ) { if( ( aPath.StartsWith( "http://" ) || aPath.StartsWith( "https://" ) ) ) - return boost::optional( IO_MGR::GITHUB ); + return OPT( IO_MGR::GITHUB ); wxFileName path( aPath ); @@ -127,10 +127,10 @@ static boost::optional getPluginType( const wxString& aPath } if( ok ) - return boost::optional( fileFilters[i].m_Plugin ); + return OPT( fileFilters[i].m_Plugin ); } - return boost::none; + return NULLOPT; } @@ -139,7 +139,7 @@ static bool passesFilter( const wxString& aFileName, int aFilterIndex ) { wxASSERT( aFilterIndex <= FILTER_COUNT ); wxFileName file( aFileName ); - boost::optional result = getPluginType( aFileName ); + OPT result = getPluginType( aFileName ); if( !result ) // does not match any supported plugin return false; diff --git a/pcbnew/dialogs/wizard_add_fplib.h b/pcbnew/dialogs/wizard_add_fplib.h index 520ea43e26..b185d79af1 100644 --- a/pcbnew/dialogs/wizard_add_fplib.h +++ b/pcbnew/dialogs/wizard_add_fplib.h @@ -26,7 +26,7 @@ #include #include -#include +#include class KIWAY_PLAYER; @@ -115,9 +115,9 @@ public: /** * Function GetPluginType * Returns the plugin type, autodetected basing on the path. - * @return Returns empty boost::optional if the type could not be autodetected. + * @return Returns empty OPT if the type could not be autodetected. */ - inline boost::optional GetPluginType() const + inline OPT GetPluginType() const { return m_plugin; } @@ -194,7 +194,7 @@ public: wxString m_path; wxString m_description; - boost::optional m_plugin; + OPT m_plugin; STATUS m_status; friend class WIZARD_FPLIB_TABLE; diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index 7a5881952b..9b9ca3c69e 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -1085,7 +1085,7 @@ void EAGLE_PLUGIN::orientModuleText( MODULE* m, const EELEMENT& e, txt->SetText( FROM_UTF8( a.value->c_str() ) ); } - if( a.x && a.y ) // boost::optional + if( a.x && a.y ) // OPT { wxPoint pos( kicad_x( *a.x ), kicad_y( *a.y ) ); txt->SetTextPos( pos ); diff --git a/pcbnew/footprint_preview_panel.cpp b/pcbnew/footprint_preview_panel.cpp index d711952fac..6bb4b6cf23 100644 --- a/pcbnew/footprint_preview_panel.cpp +++ b/pcbnew/footprint_preview_panel.cpp @@ -47,7 +47,7 @@ class FP_THREAD_IFACE public: /// Retrieve a cache entry by LIB_ID - boost::optional GetFromCache( LIB_ID const & aFPID ) + OPT GetFromCache( LIB_ID const & aFPID ) { MUTLOCK lock( m_lock ); auto it = m_cachedFootprints.find( aFPID ); @@ -55,7 +55,7 @@ class FP_THREAD_IFACE if( it != m_cachedFootprints.end() ) return it->second; else - return boost::none; + return NULLOPT; } /** @@ -74,13 +74,13 @@ class FP_THREAD_IFACE } /// Pop an entry from the queue, or empty option if none is available. - boost::optional PopFromQueue() + OPT PopFromQueue() { MUTLOCK lock( m_lock ); if( m_loaderQueue.empty() ) { - return boost::none; + return NULLOPT; } else { diff --git a/pcbnew/footprint_preview_panel.h b/pcbnew/footprint_preview_panel.h index fd98db283c..b86d52ea0a 100644 --- a/pcbnew/footprint_preview_panel.h +++ b/pcbnew/footprint_preview_panel.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include diff --git a/pcbnew/pcb_parser.h b/pcbnew/pcb_parser.h index 016b5b8064..df97b450a2 100644 --- a/pcbnew/pcb_parser.h +++ b/pcbnew/pcb_parser.h @@ -36,8 +36,7 @@ #include // KiROUND #include // IU_PER_MM -#include -#include +#include class BOARD; @@ -65,8 +64,8 @@ struct LAYER; */ class PCB_PARSER : public PCB_LEXER { - typedef boost::unordered_map< std::string, PCB_LAYER_ID > LAYER_ID_MAP; - typedef boost::unordered_map< std::string, LSET > LSET_MAP; + typedef std::unordered_map< std::string, PCB_LAYER_ID > LAYER_ID_MAP; + typedef std::unordered_map< std::string, LSET > LSET_MAP; BOARD* m_board; LAYER_ID_MAP m_layerIndices; ///< map layer name to it's index diff --git a/pcbnew/router/length_tuner_tool.cpp b/pcbnew/router/length_tuner_tool.cpp index a98ce5d1a7..39e144d496 100644 --- a/pcbnew/router/length_tuner_tool.cpp +++ b/pcbnew/router/length_tuner_tool.cpp @@ -19,7 +19,7 @@ * with this program. If not, see . */ -#include +#include #include "class_draw_panel_gal.h" #include "class_board.h" @@ -43,7 +43,6 @@ #include "length_tuner_tool.h" using namespace KIGFX; -using boost::optional; static TOOL_ACTION ACT_StartTuning( "pcbnew.LengthTuner.StartTuning", AS_CONTEXT, 'X', _( "New Track" ), _( "Starts laying a new track." ) ); diff --git a/pcbnew/router/pns_diff_pair.cpp b/pcbnew/router/pns_diff_pair.cpp index 60889072fd..f301304e9d 100644 --- a/pcbnew/router/pns_diff_pair.cpp +++ b/pcbnew/router/pns_diff_pair.cpp @@ -690,9 +690,9 @@ void DP_GATEWAYS::BuildGeneric( const VECTOR2I& p0_p, const VECTOR2I& p0_n, bool ips[1] = st_p[i].IntersectLines( st_n[j] ); if( d_n[i].Collinear( d_p[j] ) ) - ips[0] = boost::none; + ips[0] = OPT_VECTOR2I(); if( st_p[i].Collinear( st_p[j] ) ) - ips[1] = boost::none; + ips[1] = OPT_VECTOR2I(); // diagonal-diagonal and straight-straight cases - the most typical case if the pads // are on the same straight/diagonal line diff --git a/pcbnew/router/pns_diff_pair_placer.h b/pcbnew/router/pns_diff_pair_placer.h index d22424e964..6eb3ec8bc9 100644 --- a/pcbnew/router/pns_diff_pair_placer.h +++ b/pcbnew/router/pns_diff_pair_placer.h @@ -247,7 +247,7 @@ private: int m_netP, m_netN; DP_PRIMITIVE_PAIR m_start; - boost::optional m_prevPair; + OPT m_prevPair; ///> current algorithm iteration int m_iteration; diff --git a/pcbnew/router/pns_dp_meander_placer.cpp b/pcbnew/router/pns_dp_meander_placer.cpp index 589c6d6b84..0b9dc8e16f 100644 --- a/pcbnew/router/pns_dp_meander_placer.cpp +++ b/pcbnew/router/pns_dp_meander_placer.cpp @@ -19,7 +19,7 @@ * with this program. If not, see . */ -#include +#include #include // God forgive me doing this... @@ -33,8 +33,6 @@ namespace PNS { -using boost::optional; - DP_MEANDER_PLACER::DP_MEANDER_PLACER( ROUTER* aRouter ) : MEANDER_PLACER_BASE( aRouter ) { diff --git a/pcbnew/router/pns_index.h b/pcbnew/router/pns_index.h index d8c20c22ba..7edec8900a 100644 --- a/pcbnew/router/pns_index.h +++ b/pcbnew/router/pns_index.h @@ -24,6 +24,7 @@ #include #include +#include #include @@ -47,7 +48,7 @@ class INDEX public: typedef std::list NET_ITEMS_LIST; typedef SHAPE_INDEX ITEM_SHAPE_INDEX; - typedef boost::unordered_set ITEM_SET; + typedef std::unordered_set ITEM_SET; INDEX(); ~INDEX(); diff --git a/pcbnew/router/pns_joint.h b/pcbnew/router/pns_joint.h index 359e9f92fe..2e68b43779 100644 --- a/pcbnew/router/pns_joint.h +++ b/pcbnew/router/pns_joint.h @@ -23,7 +23,6 @@ #define __PNS_JOINT_H #include -#include #include @@ -54,6 +53,20 @@ public: int net; }; + struct JOINT_TAG_HASH + { + std::size_t operator()( const JOINT::HASH_TAG& aP ) const + { + using std::size_t; + using std::hash; + using std::string; + + return ( (hash()( aP.pos.x ) + ^ (hash()( aP.pos.y ) << 1) ) >> 1 ) + ^ (hash()( aP.net ) << 1); + } + }; + JOINT() : ITEM( JOINT_T ), m_locked( false ) {} @@ -249,16 +262,6 @@ inline bool operator==( JOINT::HASH_TAG const& aP1, JOINT::HASH_TAG const& aP2 ) return aP1.pos == aP2.pos && aP1.net == aP2.net; } -inline std::size_t hash_value( JOINT::HASH_TAG const& aP ) -{ - std::size_t seed = 0; - boost::hash_combine( seed, aP.pos.x ); - boost::hash_combine( seed, aP.pos.y ); - boost::hash_combine( seed, aP.net ); - - return seed; -} - } #endif // __PNS_JOINT_H diff --git a/pcbnew/router/pns_line.cpp b/pcbnew/router/pns_line.cpp index 4d84889ad1..99309a5c3c 100644 --- a/pcbnew/router/pns_line.cpp +++ b/pcbnew/router/pns_line.cpp @@ -19,7 +19,7 @@ * with this program. If not, see . */ -#include +#include #include @@ -31,8 +31,6 @@ #include -using boost::optional; - namespace PNS { LINE::LINE( const LINE& aOther ) : @@ -338,7 +336,7 @@ void LINE::ShowLinks() const SHAPE_LINE_CHAIN dragCornerInternal( const SHAPE_LINE_CHAIN& aOrigin, const VECTOR2I& aP ) { - optional picked; + OPT picked; int i; int d = 2; diff --git a/pcbnew/router/pns_line_placer.cpp b/pcbnew/router/pns_line_placer.cpp index f1cd748e17..336b2b158f 100644 --- a/pcbnew/router/pns_line_placer.cpp +++ b/pcbnew/router/pns_line_placer.cpp @@ -19,7 +19,7 @@ * with this program. If not, see . */ -#include +#include #include "pns_node.h" #include "pns_line_placer.h" @@ -32,8 +32,6 @@ #include -using boost::optional; - namespace PNS { LINE_PLACER::LINE_PLACER( ROUTER* aRouter ) : diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index 8a9a66feb7..c09a1647d1 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -38,13 +38,11 @@ #include "pns_index.h" #include "pns_router.h" -using boost::unordered_set; -using boost::unordered_map; namespace PNS { #ifdef DEBUG -static boost::unordered_set allocNodes; +static std::unordered_set allocNodes; #endif NODE::NODE() @@ -1082,7 +1080,7 @@ void NODE::unlinkJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, void NODE::Dump( bool aLong ) { #if 0 - boost::unordered_set all_segs; + std::unordered_set all_segs; SHAPE_INDEX_LIST::iterator i; for( i = m_items.begin(); i != m_items.end(); i++ ) diff --git a/pcbnew/router/pns_node.h b/pcbnew/router/pns_node.h index 8e4ca8dd40..decec562b4 100644 --- a/pcbnew/router/pns_node.h +++ b/pcbnew/router/pns_node.h @@ -24,10 +24,10 @@ #include #include +#include +#include -#include -#include -#include +#include #include #include @@ -137,7 +137,7 @@ protected: class NODE { public: - typedef boost::optional OPT_OBSTACLE; + typedef OPT OPT_OBSTACLE; typedef std::vector ITEM_VECTOR; typedef std::vector OBSTACLES; @@ -420,7 +420,7 @@ public: private: struct DEFAULT_OBSTACLE_VISITOR; - typedef boost::unordered_multimap JOINT_MAP; + typedef std::unordered_multimap JOINT_MAP; typedef JOINT_MAP::value_type TagJointPair; /// nodes are not copyable @@ -486,7 +486,7 @@ private: std::set m_children; ///> hash of root's items that have been changed in this node - boost::unordered_set m_override; + std::unordered_set m_override; ///> worst case item-item clearance int m_maxClearance; @@ -500,7 +500,7 @@ private: ///> depth of the node (number of parent nodes in the inheritance chain) int m_depth; - boost::unordered_set m_garbageItems; + std::unordered_set m_garbageItems; }; } diff --git a/pcbnew/router/pns_optimizer.h b/pcbnew/router/pns_optimizer.h index 96b3e3b0eb..b12e7a4020 100644 --- a/pcbnew/router/pns_optimizer.h +++ b/pcbnew/router/pns_optimizer.h @@ -22,7 +22,7 @@ #ifndef __PNS_OPTIMIZER_H #define __PNS_OPTIMIZER_H -#include +#include #include #include @@ -170,7 +170,7 @@ private: SHAPE_INDEX_LIST m_cache; - typedef boost::unordered_map CachedItemTags; + typedef std::unordered_map CachedItemTags; CachedItemTags m_cacheTags; NODE* m_world; int m_collisionKindMask; diff --git a/pcbnew/router/pns_router.h b/pcbnew/router/pns_router.h index 2368ce8378..67e6b9dd5d 100644 --- a/pcbnew/router/pns_router.h +++ b/pcbnew/router/pns_router.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include diff --git a/pcbnew/router/pns_shove.h b/pcbnew/router/pns_shove.h index abcd6d64b4..537c0a4d65 100644 --- a/pcbnew/router/pns_shove.h +++ b/pcbnew/router/pns_shove.h @@ -87,7 +87,7 @@ public: private: typedef std::vector HULL_SET; - typedef boost::optional OPT_LINE; + typedef OPT OPT_LINE; typedef std::pair LINE_PAIR; typedef std::vector LINE_PAIR_VEC; diff --git a/pcbnew/router/pns_sizes_settings.h b/pcbnew/router/pns_sizes_settings.h index cbc8570ba3..9f5f446388 100644 --- a/pcbnew/router/pns_sizes_settings.h +++ b/pcbnew/router/pns_sizes_settings.h @@ -23,7 +23,7 @@ #define __PNS_SIZES_SETTINGS_H #include -#include +#include #include "../class_track.h" // for VIATYPE_T @@ -82,10 +82,10 @@ public: int ViaDrill() const { return m_viaDrill; } void SetViaDrill( int aDrill ) { m_viaDrill = aDrill; } - boost::optional PairedLayer( int aLayerId ) + OPT PairedLayer( int aLayerId ) { if( m_layerPairs.find(aLayerId) == m_layerPairs.end() ) - return boost::optional(); + return OPT(); return m_layerPairs[aLayerId]; } diff --git a/pcbnew/router/pns_utils.cpp b/pcbnew/router/pns_utils.cpp index 2d857ca4fe..84d4ec944a 100644 --- a/pcbnew/router/pns_utils.cpp +++ b/pcbnew/router/pns_utils.cpp @@ -141,14 +141,14 @@ const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& aConvex, int aClearance ) SHAPE_LINE_CHAIN octagon; octagon.SetClosed( true ); - octagon.Append( leftline.IntersectLines( bottomleftline ).get() ); - octagon.Append( bottomline.IntersectLines( bottomleftline ).get() ); - octagon.Append( bottomline.IntersectLines( bottomrightline ).get() ); - octagon.Append( rightline.IntersectLines( bottomrightline ).get() ); - octagon.Append( rightline.IntersectLines( toprightline ).get() ); - octagon.Append( topline.IntersectLines( toprightline ).get() ); - octagon.Append( topline.IntersectLines( topleftline ).get() ); - octagon.Append( leftline.IntersectLines( topleftline ).get() ); + octagon.Append( *leftline.IntersectLines( bottomleftline ) ); + octagon.Append( *bottomline.IntersectLines( bottomleftline ) ); + octagon.Append( *bottomline.IntersectLines( bottomrightline ) ); + octagon.Append( *rightline.IntersectLines( bottomrightline ) ); + octagon.Append( *rightline.IntersectLines( toprightline ) ); + octagon.Append( *topline.IntersectLines( toprightline ) ); + octagon.Append( *topline.IntersectLines( topleftline ) ); + octagon.Append( *leftline.IntersectLines( topleftline ) ); return octagon; } diff --git a/pcbnew/router/pns_walkaround.cpp b/pcbnew/router/pns_walkaround.cpp index 3e26ea46e3..18b7673d55 100644 --- a/pcbnew/router/pns_walkaround.cpp +++ b/pcbnew/router/pns_walkaround.cpp @@ -19,7 +19,7 @@ * with this program. If not, see . */ -#include +#include #include @@ -27,7 +27,6 @@ #include "pns_optimizer.h" #include "pns_utils.h" #include "pns_router.h" -using boost::optional; namespace PNS { @@ -55,7 +54,7 @@ NODE::OPT_OBSTACLE WALKAROUND::nearestObstacle( const LINE& aPath ) WALKAROUND::WALKAROUND_STATUS WALKAROUND::singleStep( LINE& aPath, bool aWindingDirection ) { - optional& current_obs = + OPT& current_obs = aWindingDirection ? m_currentObstacle[0] : m_currentObstacle[1]; bool& prev_recursive = aWindingDirection ? m_recursiveCollision[0] : m_recursiveCollision[1]; diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index c76f0051ce..9de3b0d30a 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -21,7 +21,7 @@ #include -#include +#include #include using namespace std::placeholders; @@ -60,8 +60,6 @@ using namespace std::placeholders; #include "pns_router.h" using namespace KIGFX; -using boost::optional; - /** * Flags used by via tool actions @@ -460,7 +458,7 @@ void ROUTER_TOOL::switchLayerOnViaPlacement() m_router->SwitchLayer( al ); } - optional newLayer = m_router->Sizes().PairedLayer( cl ); + OPT newLayer = m_router->Sizes().PairedLayer( cl ); if( !newLayer ) newLayer = m_router->Sizes().GetLayerTop(); diff --git a/pcbnew/swig/mire.i b/pcbnew/swig/pcb_target.i similarity index 100% rename from pcbnew/swig/mire.i rename to pcbnew/swig/pcb_target.i diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 4987cc750f..68b362018a 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -219,7 +219,7 @@ int DRAWING_TOOL::DrawLine( const TOOL_EVENT& aEvent ) BOARD_ITEM_CONTAINER* parent = m_frame->GetModel(); DRAWSEGMENT* line = m_editModules ? new EDGE_MODULE( (MODULE*) parent ) : new DRAWSEGMENT; - boost::optional startingPoint; + OPT startingPoint; BOARD_COMMIT commit( m_frame ); SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::LINE ); @@ -234,11 +234,11 @@ int DRAWING_TOOL::DrawLine( const TOOL_EVENT& aEvent ) { commit.Add( line ); commit.Push( _( "Draw a line segment" ) ); - startingPoint = line->GetEnd(); + startingPoint = VECTOR2D( line->GetEnd() ); } else { - startingPoint = boost::none; + startingPoint = NULLOPT; } line = m_editModules ? new EDGE_MODULE( (MODULE*) parent ) : new DRAWSEGMENT; @@ -920,7 +920,7 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent ) bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic, - boost::optional aStartingPoint ) + OPT aStartingPoint ) { // Only two shapes are currently supported assert( aShape == S_SEGMENT || aShape == S_CIRCLE ); diff --git a/pcbnew/tools/drawing_tool.h b/pcbnew/tools/drawing_tool.h index 871993a830..d851c24cb6 100644 --- a/pcbnew/tools/drawing_tool.h +++ b/pcbnew/tools/drawing_tool.h @@ -26,7 +26,7 @@ #define __DRAWING_TOOL_H #include -#include +#include #include @@ -206,7 +206,7 @@ private: ///> @return False if the tool was cancelled before the origin was set or origin and end are ///> the same point. bool drawSegment( int aShape, DRAWSEGMENT*& aGraphic, - boost::optional aStartingPoint = boost::none ); + OPT aStartingPoint = NULLOPT ); ///> Starts drawing an arc. ///> @param aGraphic is an object that is going to be used by the tool for drawing. It has to diff --git a/pcbnew/tools/grid_helper.cpp b/pcbnew/tools/grid_helper.cpp index 00789bce51..dc04749be2 100644 --- a/pcbnew/tools/grid_helper.cpp +++ b/pcbnew/tools/grid_helper.cpp @@ -108,7 +108,7 @@ void GRID_HELPER::SetAuxAxes( bool aEnable, const VECTOR2I& aOrigin, bool aEnabl } else { - m_auxAxis = boost::optional(); + m_auxAxis = OPT(); view->SetVisible( &m_viewAxis, false ); } diff --git a/pcbnew/tools/grid_helper.h b/pcbnew/tools/grid_helper.h index 446a1af9a2..dd5db21a53 100644 --- a/pcbnew/tools/grid_helper.h +++ b/pcbnew/tools/grid_helper.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -102,7 +102,7 @@ private: } PCB_BASE_FRAME* m_frame; - boost::optional m_auxAxis; + OPT m_auxAxis; bool m_diagonalAuxAxesEnable; KIGFX::ORIGIN_VIEWITEM m_viewSnapPoint, m_viewAxis; }; diff --git a/pcbnew/tools/module_editor_tools.cpp b/pcbnew/tools/module_editor_tools.cpp index 63951e39db..f90e292c83 100644 --- a/pcbnew/tools/module_editor_tools.cpp +++ b/pcbnew/tools/module_editor_tools.cpp @@ -26,6 +26,9 @@ #include "kicad_clipboard.h" #include "selection_tool.h" #include "pcb_actions.h" + +#include + #include #include @@ -467,12 +470,12 @@ int MODULE_EDITOR_TOOLS::CreatePadFromShapes( const TOOL_EVENT& aEvent ) pad->SetPrimitives( shapes ); pad->SetShape ( PAD_SHAPE_CUSTOM ); - boost::optional anchor; + OPT anchor; VECTOR2I tmp; if( refPad ) { - anchor = pad->GetPosition(); + anchor = VECTOR2I( pad->GetPosition() ); } else if( pad->GetBestAnchorPosition( tmp ) ) { diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index 52a4177d0d..712c6c0d2b 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -27,7 +27,7 @@ #include -boost::optional PCB_ACTIONS::TranslateLegacyId( int aId ) +OPT PCB_ACTIONS::TranslateLegacyId( int aId ) { switch( aId ) { @@ -199,5 +199,5 @@ boost::optional PCB_ACTIONS::TranslateLegacyId( int aId ) return PCB_ACTIONS::pasteFromClipboard.MakeEvent(); } - return boost::optional(); + return OPT(); } diff --git a/pcbnew/tools/pcb_actions.h b/pcbnew/tools/pcb_actions.h index 100ea8b830..8926b82320 100644 --- a/pcbnew/tools/pcb_actions.h +++ b/pcbnew/tools/pcb_actions.h @@ -28,7 +28,7 @@ #include #include -#include +#include class TOOL_EVENT; class TOOL_MANAGER; @@ -391,7 +391,7 @@ public: ///> @copydoc COMMON_ACTIONS::TranslateLegacyId() - virtual boost::optional TranslateLegacyId( int aId ) override; + virtual OPT TranslateLegacyId( int aId ) override; ///> @copydoc COMMON_ACTIONS::RegisterAllTools() virtual void RegisterAllTools( TOOL_MANAGER* aToolManager ) override; diff --git a/pcbnew/tools/picker_tool.cpp b/pcbnew/tools/picker_tool.cpp index a8e63d68ad..9bf7151295 100644 --- a/pcbnew/tools/picker_tool.cpp +++ b/pcbnew/tools/picker_tool.cpp @@ -47,7 +47,7 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent ) assert( !m_picking ); m_picking = true; - m_picked = boost::none; + m_picked = NULLOPT; setControls(); @@ -62,8 +62,8 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent ) { bool getNext = false; - m_picked = p; - + m_picked = VECTOR2D( p ); + if( m_clickHandler ) { try @@ -112,7 +112,7 @@ void PICKER_TOOL::reset() m_autoPanning = false; m_picking = false; - m_clickHandler = boost::none; + m_clickHandler = NULLOPT; } diff --git a/pcbnew/tools/picker_tool.h b/pcbnew/tools/picker_tool.h index 60b5b6f8ee..9cdc74a740 100644 --- a/pcbnew/tools/picker_tool.h +++ b/pcbnew/tools/picker_tool.h @@ -74,7 +74,7 @@ public: * Function GetPoint() * Returns picked point. */ - inline boost::optional GetPoint() const + inline OPT GetPoint() const { assert( !m_picking ); return m_picked; @@ -108,10 +108,10 @@ private: bool m_autoPanning; ///> Optional mouse click event handler. - boost::optional m_clickHandler; + OPT m_clickHandler; ///> Picked point (if any). - boost::optional m_picked; + OPT m_picked; ///> Activity status. bool m_picking; diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 352d5ec214..1841bb0db5 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -1361,7 +1361,7 @@ BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector ) } else if( evt->Action() == TA_CONTEXT_MENU_CHOICE ) { - boost::optional id = evt->GetCommandId(); + OPT id = evt->GetCommandId(); // User has selected an item, so this one will be returned if( id && ( *id > 0 ) ) diff --git a/qa/common/mocks.cpp b/qa/common/mocks.cpp index 1be8d9685f..4fe04937bb 100644 --- a/qa/common/mocks.cpp +++ b/qa/common/mocks.cpp @@ -28,10 +28,6 @@ * @brief Pcbnew main program. */ -#ifdef KICAD_SCRIPTING - #include - #include -#endif #include #include #include @@ -51,7 +47,6 @@ #include #include #include -#include <3d_viewer.h> #include #include #include diff --git a/qa/common/pcb_test_frame.cpp b/qa/common/pcb_test_frame.cpp index a36b925300..ff699eac43 100644 --- a/qa/common/pcb_test_frame.cpp +++ b/qa/common/pcb_test_frame.cpp @@ -103,9 +103,9 @@ public: virtual ~TEST_ACTIONS() {}; - virtual boost::optional TranslateLegacyId( int aId ) + virtual OPT TranslateLegacyId( int aId ) { - return boost::none; + return NULLOPT; } void RegisterAllTools( TOOL_MANAGER* aToolManager ) diff --git a/qa/pcb_test_window/CMakeLists.txt b/qa/pcb_test_window/CMakeLists.txt index f073d00846..a941655715 100644 --- a/qa/pcb_test_window/CMakeLists.txt +++ b/qa/pcb_test_window/CMakeLists.txt @@ -75,6 +75,7 @@ target_link_libraries( test_window common pcbcommon bitmaps + gal ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}