Browse Source

Copy c'tor / operator= safety.

Also fixes a memory leak of search pane handlers.
pull/18/head
Jeff Young 4 months ago
parent
commit
8c85cd43f3
  1. 5
      3d-viewer/3d_rendering/raytracing/accelerators/bvh_pbrt.h
  2. 29
      3d-viewer/3d_rendering/raytracing/accelerators/container_2d.h
  3. 13
      3d-viewer/3d_rendering/raytracing/shapes2D/layer_item_2d.h
  4. 10
      3d-viewer/dialogs/appearance_controls_3D.h
  5. 2
      common/eda_group.h
  6. 5
      common/jobs/job.h
  7. 3
      common/single_top.cpp
  8. 11
      common/widgets/grid_text_button_helpers.cpp
  9. 2
      common/widgets/properties_panel.cpp
  10. 2
      common/widgets/properties_panel.h
  11. 5
      common/widgets/search_pane.cpp
  12. 5
      eeschema/connection_graph.h
  13. 10
      eeschema/erc/erc_settings.h
  14. 4
      eeschema/sch_rule_area.h
  15. 9
      eeschema/sim/sim_lib_mgr.h
  16. 56
      include/libeval_compiler/libeval_compiler.h
  17. 10
      include/rc_item.h
  18. 5
      include/settings/json_settings.h
  19. 2
      include/tool/action_toolbar.h
  20. 5
      include/undo_redo_container.h
  21. 13
      include/view/view.h
  22. 16
      include/view/view_group.h
  23. 13
      include/view/view_overlay.h
  24. 4
      include/widgets/grid_text_button_helpers.h
  25. 9
      include/widgets/search_pane.h
  26. 5
      pcbnew/drc/drc_engine.h
  27. 5
      pcbnew/drc/drc_item.h
  28. 3
      pcbnew/pcb_table.h
  29. 5
      pcbnew/widgets/appearance_controls.h

5
3d-viewer/3d_rendering/raytracing/accelerators/bvh_pbrt.h

@ -115,6 +115,11 @@ public:
~BVH_PBRT(); ~BVH_PBRT();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
BVH_PBRT( const BVH_PBRT& ) = delete;
BVH_PBRT& operator=( const BVH_PBRT& ) = delete;
bool Intersect( const RAY& aRay, HITINFO& aHitInfo ) const override; bool Intersect( const RAY& aRay, HITINFO& aHitInfo ) const override;
bool Intersect( const RAY& aRay, HITINFO& aHitInfo, unsigned int aAccNodeInfo ) const override; bool Intersect( const RAY& aRay, HITINFO& aHitInfo, unsigned int aAccNodeInfo ) const override;
bool Intersect( const RAYPACKET& aRayPacket, HITINFO_PACKET* aHitInfoPacket ) const override; bool Intersect( const RAYPACKET& aRayPacket, HITINFO_PACKET* aHitInfoPacket ) const override;

29
3d-viewer/3d_rendering/raytracing/accelerators/container_2d.h

@ -22,12 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file container_2d.h
*/
#ifndef _CONTAINER_2D_H_
#define _CONTAINER_2D_H_
#pragma once
#include "../shapes2D/object_2d.h" #include "../shapes2D/object_2d.h"
#include <list> #include <list>
@ -71,8 +66,7 @@ public:
* @param aBBox The bounding box to test. * @param aBBox The bounding box to test.
* @param aOutList The list of objects that intersects the bounding box. * @param aOutList The list of objects that intersects the bounding box.
*/ */
virtual void GetIntersectingObjects( const BBOX_2D& aBBox,
CONST_LIST_OBJECT2D& aOutList ) const = 0;
virtual void GetIntersectingObjects( const BBOX_2D& aBBox, CONST_LIST_OBJECT2D& aOutList ) const = 0;
/** /**
* Intersect and check if a segment ray hits a object or is inside it. * Intersect and check if a segment ray hits a object or is inside it.
@ -96,8 +90,7 @@ class CONTAINER_2D : public CONTAINER_2D_BASE
public: public:
CONTAINER_2D(); CONTAINER_2D();
void GetIntersectingObjects( const BBOX_2D& aBBox,
CONST_LIST_OBJECT2D& aOutList ) const override;
void GetIntersectingObjects( const BBOX_2D& aBBox, CONST_LIST_OBJECT2D& aOutList ) const override;
bool IntersectAny( const RAYSEG2D& aSegRay ) const override; bool IntersectAny( const RAYSEG2D& aSegRay ) const override;
}; };
@ -119,28 +112,30 @@ public:
BVH_CONTAINER_2D(); BVH_CONTAINER_2D();
~BVH_CONTAINER_2D(); ~BVH_CONTAINER_2D();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
BVH_CONTAINER_2D( const BVH_CONTAINER_2D& ) = delete;
BVH_CONTAINER_2D& operator=( const BVH_CONTAINER_2D& ) = delete;
void BuildBVH(); void BuildBVH();
void Clear() override; void Clear() override;
void GetIntersectingObjects( const BBOX_2D& aBBox,
CONST_LIST_OBJECT2D& aOutList ) const override;
void GetIntersectingObjects( const BBOX_2D& aBBox, CONST_LIST_OBJECT2D& aOutList ) const override;
bool IntersectAny( const RAYSEG2D& aSegRay ) const override; bool IntersectAny( const RAYSEG2D& aSegRay ) const override;
private: private:
void destroy(); void destroy();
void recursiveBuild_MIDDLE_SPLIT( BVH_CONTAINER_NODE_2D* aNodeParent ); void recursiveBuild_MIDDLE_SPLIT( BVH_CONTAINER_NODE_2D* aNodeParent );
void recursiveGetListObjectsIntersects( const BVH_CONTAINER_NODE_2D* aNode,
const BBOX_2D& aBBox,
void recursiveGetListObjectsIntersects( const BVH_CONTAINER_NODE_2D* aNode, const BBOX_2D& aBBox,
CONST_LIST_OBJECT2D& aOutList ) const; CONST_LIST_OBJECT2D& aOutList ) const;
bool recursiveIntersectAny( const BVH_CONTAINER_NODE_2D* aNode,
const RAYSEG2D& aSegRay ) const;
bool recursiveIntersectAny( const BVH_CONTAINER_NODE_2D* aNode, const RAYSEG2D& aSegRay ) const;
private:
bool m_isInitialized; bool m_isInitialized;
std::list<BVH_CONTAINER_NODE_2D*> m_elementsToDelete; std::list<BVH_CONTAINER_NODE_2D*> m_elementsToDelete;
BVH_CONTAINER_NODE_2D* m_tree; BVH_CONTAINER_NODE_2D* m_tree;
}; };
#endif // _CONTAINER_2D_H_

13
3d-viewer/3d_rendering/raytracing/shapes2D/layer_item_2d.h

@ -23,12 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file layer_item_2d.h
*/
#ifndef _LAYER_ITEM_2D_H_
#define _LAYER_ITEM_2D_H_
#pragma once
#include "object_2d.h" #include "object_2d.h"
#include <vector> #include <vector>
@ -84,6 +79,11 @@ public:
~LAYER_ITEM_2D(); ~LAYER_ITEM_2D();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
LAYER_ITEM_2D( const LAYER_ITEM_2D& ) = delete;
LAYER_ITEM_2D& operator=( const LAYER_ITEM_2D& ) = delete;
// Imported from OBJECT_2D // Imported from OBJECT_2D
bool Overlaps( const BBOX_2D& aBBox ) const override; bool Overlaps( const BBOX_2D& aBBox ) const override;
bool Intersects( const BBOX_2D& aBBox ) const override; bool Intersects( const BBOX_2D& aBBox ) const override;
@ -97,4 +97,3 @@ private:
const OBJECT_2D* m_objectC; const OBJECT_2D* m_objectC;
}; };
#endif // _LAYER_ITEM_2D_H_

10
3d-viewer/dialogs/appearance_controls_3D.h

@ -18,8 +18,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef APPEARANCE_CONTROLS_3D_H
#define APPEARANCE_CONTROLS_3D_H
#pragma once
#include <vector> #include <vector>
@ -113,6 +112,11 @@ public:
APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent, wxWindow* aFocusOwner ); APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent, wxWindow* aFocusOwner );
~APPEARANCE_CONTROLS_3D(); ~APPEARANCE_CONTROLS_3D();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
APPEARANCE_CONTROLS_3D( const APPEARANCE_CONTROLS_3D& ) = delete;
APPEARANCE_CONTROLS_3D& operator=( const APPEARANCE_CONTROLS_3D& ) = delete;
wxSize GetBestSize() const; wxSize GetBestSize() const;
void OnDarkModeToggle(); void OnDarkModeToggle();
void OnLayerVisibilityChanged( int aLayer, bool isVisible ); void OnLayerVisibilityChanged( int aLayer, bool isVisible );
@ -189,5 +193,3 @@ private:
wxCheckBox* m_cbUseBoardStackupColors; wxCheckBox* m_cbUseBoardStackupColors;
wxCheckBox* m_cbUseBoardEditorCopperColors; wxCheckBox* m_cbUseBoardEditorCopperColors;
}; };
#endif

2
common/eda_group.h

@ -73,7 +73,7 @@ public:
const LIB_ID& GetDesignBlockLibId() const { return m_designBlockLibId; } const LIB_ID& GetDesignBlockLibId() const { return m_designBlockLibId; }
protected: protected:
std::unordered_set<EDA_ITEM*> m_items; // Members of the group
std::unordered_set<EDA_ITEM*> m_items; // Members of the group (no ownership)
wxString m_name; // Optional group name wxString m_name; // Optional group name
LIB_ID m_designBlockLibId; // Optional link to a design block LIB_ID m_designBlockLibId; // Optional link to a design block
}; };

5
common/jobs/job.h

@ -186,6 +186,11 @@ public:
virtual ~JOB(); virtual ~JOB();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
JOB( const JOB& ) = delete;
JOB& operator=( const JOB& ) = delete;
const std::string& GetType() const { return m_type; }; const std::string& GetType() const { return m_type; };
const std::map<wxString, wxString>& GetVarOverrides() const { return m_varOverrides; } const std::map<wxString, wxString>& GetVarOverrides() const { return m_varOverrides; }

3
common/single_top.cpp

@ -260,8 +260,7 @@ struct APP_SINGLE_TOP : public wxApp
if( dlgs.back() == dialog ) if( dlgs.back() == dialog )
dlgs.pop_back(); dlgs.pop_back();
// If an out-of-order, remove all dialogs added after the closed one // If an out-of-order, remove all dialogs added after the closed one
else if( auto it = std::find( dlgs.begin(), dlgs.end(), dialog );
it != dlgs.end() )
else if( auto it = std::find( dlgs.begin(), dlgs.end(), dialog ); it != dlgs.end() )
dlgs.erase( it, dlgs.end() ); dlgs.erase( it, dlgs.end() );
} }
} }

11
common/widgets/grid_text_button_helpers.cpp

@ -350,8 +350,12 @@ public:
~TEXT_BUTTON_URL() ~TEXT_BUTTON_URL()
{ {
Unbind( wxEVT_TEXT, &TEXT_BUTTON_URL::OnTextChange, this ); Unbind( wxEVT_TEXT, &TEXT_BUTTON_URL::OnTextChange, this );
m_filesStack.clear(); // we don't own pointers
} }
// We don't own any of our raw pointers, so compiler's copy c'tor an operator= are OK.
protected: protected:
void DoSetPopupControl( wxComboPopup* popup ) override void DoSetPopupControl( wxComboPopup* popup ) override
{ {
@ -368,8 +372,7 @@ protected:
{ {
FILEDLG_HOOK_EMBED_FILE customize; FILEDLG_HOOK_EMBED_FILE customize;
wxFileDialog openFileDialog( this, _( "Open file" ), "", "",
_( "All Files" ) + wxT( " (*.*)|*.*" ),
wxFileDialog openFileDialog( this, _( "Open file" ), "", "", _( "All Files" ) + wxT( " (*.*)|*.*" ),
wxFD_OPEN | wxFD_FILE_MUST_EXIST ); wxFD_OPEN | wxFD_FILE_MUST_EXIST );
openFileDialog.SetCustomizeHook( customize ); openFileDialog.SetCustomizeHook( customize );
@ -414,8 +417,8 @@ protected:
protected: protected:
DIALOG_SHIM* m_dlg; DIALOG_SHIM* m_dlg;
SEARCH_STACK* m_searchStack;
std::vector<EMBEDDED_FILES*> m_filesStack;
SEARCH_STACK* m_searchStack; // No ownership of pointer
std::vector<EMBEDDED_FILES*> m_filesStack; // No ownership of pointers
}; };

2
common/widgets/properties_panel.cpp

@ -158,7 +158,7 @@ void PROPERTIES_PANEL::OnLanguageChanged( wxCommandEvent& aEvent )
m_grid->CommitChangesFromEditor(); m_grid->CommitChangesFromEditor();
m_grid->Clear(); m_grid->Clear();
m_displayed.clear();
m_displayed.clear(); // no ownership of pointers
UpdateData(); UpdateData();

2
common/widgets/properties_panel.h

@ -108,7 +108,7 @@ public:
int m_SuppressGridChangeEvents; int m_SuppressGridChangeEvents;
protected: protected:
std::vector<PROPERTY_BASE*> m_displayed;
std::vector<PROPERTY_BASE*> m_displayed; // no ownership of pointers
wxPropertyGrid* m_grid; wxPropertyGrid* m_grid;
EDA_BASE_FRAME* m_frame; EDA_BASE_FRAME* m_frame;
wxStaticText* m_caption; wxStaticText* m_caption;

5
common/widgets/search_pane.cpp

@ -143,6 +143,11 @@ SEARCH_PANE::~SEARCH_PANE()
m_frame->Unbind( EDA_LANG_CHANGED, &SEARCH_PANE::OnLanguageChange, this ); m_frame->Unbind( EDA_LANG_CHANGED, &SEARCH_PANE::OnLanguageChange, this );
Unbind( wxEVT_CHAR_HOOK, &SEARCH_PANE::OnCharHook, this ); Unbind( wxEVT_CHAR_HOOK, &SEARCH_PANE::OnCharHook, this );
for( SEARCH_HANDLER* handler : m_handlers )
delete handler;
m_handlers.clear();
delete m_menu; delete m_menu;
} }

5
eeschema/connection_graph.h

@ -370,6 +370,11 @@ public:
Reset(); Reset();
} }
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
CONNECTION_GRAPH( const CONNECTION_GRAPH& ) = delete;
CONNECTION_GRAPH& operator=( const CONNECTION_GRAPH& ) = delete;
void Reset(); void Reset();
void SetSchematic( SCHEMATIC* aSchematic ) void SetSchematic( SCHEMATIC* aSchematic )

10
eeschema/erc/erc_settings.h

@ -19,8 +19,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef _ERC_SETTINGS_H
#define _ERC_SETTINGS_H
#pragma once
#include <erc/erc_item.h> #include <erc/erc_item.h>
#include <pin_type.h> #include <pin_type.h>
@ -250,6 +249,11 @@ public:
m_severities( 0 ) m_severities( 0 )
{ } { }
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
SHEETLIST_ERC_ITEMS_PROVIDER( const SHEETLIST_ERC_ITEMS_PROVIDER& ) = delete;
SHEETLIST_ERC_ITEMS_PROVIDER& operator=( const SHEETLIST_ERC_ITEMS_PROVIDER& ) = delete;
void SetSeverities( int aSeverities ) override; void SetSeverities( int aSeverities ) override;
int GetCount( int aSeverity = -1 ) const override; int GetCount( int aSeverity = -1 ) const override;
@ -265,5 +269,3 @@ private:
void visitMarkers( std::function<void( SCH_MARKER* )> aVisitor ) const; void visitMarkers( std::function<void( SCH_MARKER* )> aVisitor ) const;
}; };
#endif // _ERC_SETTINGS_H

4
eeschema/sch_rule_area.h

@ -137,11 +137,11 @@ protected:
bool m_excludedFromBoard; bool m_excludedFromBoard;
bool m_DNP; ///< True if symbol is set to 'Do Not Populate'. bool m_DNP; ///< True if symbol is set to 'Do Not Populate'.
/// All #SCH_ITEM objects currently contained or intersecting the rule area.
/// All #SCH_ITEM objects currently contained or intersecting the rule area. No ownership.
std::unordered_set<SCH_ITEM*> m_items; std::unordered_set<SCH_ITEM*> m_items;
std::unordered_set<KIID> m_itemIDs; std::unordered_set<KIID> m_itemIDs;
/// All #SCH_DIRECTIVE_LABEL objectss attached to the rule area border.
/// All #SCH_DIRECTIVE_LABEL objects attached to the rule area border. No ownership.
std::unordered_set<SCH_DIRECTIVE_LABEL*> m_directives; std::unordered_set<SCH_DIRECTIVE_LABEL*> m_directives;
std::unordered_set<KIID> m_directiveIDs; std::unordered_set<KIID> m_directiveIDs;

9
eeschema/sim/sim_lib_mgr.h

@ -22,8 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef SIM_LIB_MGR_H
#define SIM_LIB_MGR_H
#pragma once
#include <map> #include <map>
#include <vector> #include <vector>
@ -84,12 +83,10 @@ public:
REPORTER& aReporter ); REPORTER& aReporter );
private: private:
std::vector<EMBEDDED_FILES*> m_embeddedFilesStack;
const PROJECT* m_project;
std::vector<EMBEDDED_FILES*> m_embeddedFilesStack; // no ownership
const PROJECT* m_project; // no ownership
bool m_forceFullParse; bool m_forceFullParse;
std::map<wxString, std::unique_ptr<SIM_LIBRARY>> m_libraries; std::map<wxString, std::unique_ptr<SIM_LIBRARY>> m_libraries;
std::vector<std::unique_ptr<SIM_MODEL>> m_models; std::vector<std::unique_ptr<SIM_MODEL>> m_models;
}; };
#endif // SIM_LIB_MGR_H

56
include/libeval_compiler/libeval_compiler.h

@ -18,8 +18,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef __LIBEVAL_COMPILER_H
#define __LIBEVAL_COMPILER_H
#pragma once
#include <cstddef> #include <cstddef>
#include <functional> #include <functional>
@ -188,7 +187,7 @@ public:
virtual double Convert( const wxString& aString, int unitType ) const virtual double Convert( const wxString& aString, int unitType ) const
{ {
return 0.0; return 0.0;
};
}
}; };
@ -202,7 +201,7 @@ public:
m_isDeferredDbl( false ), m_isDeferredDbl( false ),
m_isDeferredStr( false ), m_isDeferredStr( false ),
m_units( EDA_UNITS::UNSCALED ) m_units( EDA_UNITS::UNSCALED )
{};
{}
VALUE( const wxString& aStr, bool aIsWildcard = false ) : VALUE( const wxString& aStr, bool aIsWildcard = false ) :
m_type( VT_STRING ), m_type( VT_STRING ),
@ -212,7 +211,7 @@ public:
m_isDeferredDbl( false ), m_isDeferredDbl( false ),
m_isDeferredStr( false ), m_isDeferredStr( false ),
m_units( EDA_UNITS::UNSCALED ) m_units( EDA_UNITS::UNSCALED )
{};
{}
VALUE( const double aVal ) : VALUE( const double aVal ) :
m_type( VT_NUMERIC ), m_type( VT_NUMERIC ),
@ -221,7 +220,7 @@ public:
m_isDeferredDbl( false ), m_isDeferredDbl( false ),
m_isDeferredStr( false ), m_isDeferredStr( false ),
m_units( EDA_UNITS::UNSCALED ) m_units( EDA_UNITS::UNSCALED )
{};
{}
static VALUE* MakeNullValue() static VALUE* MakeNullValue()
{ {
@ -230,8 +229,7 @@ public:
return v; return v;
} }
virtual ~VALUE()
{};
virtual ~VALUE() = default;
virtual double AsDouble() const virtual double AsDouble() const
{ {
@ -321,8 +319,10 @@ private:
class KICOMMON_API VAR_REF class KICOMMON_API VAR_REF
{ {
public: public:
VAR_REF() {};
virtual ~VAR_REF() {};
VAR_REF()
{}
virtual ~VAR_REF() = default;
virtual VAR_TYPE_T GetType() const = 0; virtual VAR_TYPE_T GetType() const = 0;
virtual VALUE* GetValue( CONTEXT* aCtx ) = 0; virtual VALUE* GetValue( CONTEXT* aCtx ) = 0;
@ -342,10 +342,13 @@ public:
virtual ~CONTEXT() virtual ~CONTEXT()
{ {
for( VALUE* v : m_ownedValues ) for( VALUE* v : m_ownedValues )
{
delete v; delete v;
} }
}
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
CONTEXT( const CONTEXT& ) = delete;
CONTEXT& operator=( const CONTEXT& ) = delete;
VALUE* AllocValue() VALUE* AllocValue()
{ {
@ -401,8 +404,16 @@ private:
class KICOMMON_API UCODE class KICOMMON_API UCODE
{ {
public: public:
UCODE()
{}
virtual ~UCODE(); virtual ~UCODE();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
UCODE( const UCODE& ) = delete;
UCODE& operator=( const UCODE& ) = delete;
void AddOp( UOP* uop ) void AddOp( UOP* uop )
{ {
m_ucode.push_back(uop); m_ucode.push_back(uop);
@ -414,15 +425,14 @@ public:
virtual std::unique_ptr<VAR_REF> CreateVarRef( const wxString& var, const wxString& field ) virtual std::unique_ptr<VAR_REF> CreateVarRef( const wxString& var, const wxString& field )
{ {
return nullptr; return nullptr;
};
}
virtual FUNC_CALL_REF CreateFuncCall( const wxString& name ) virtual FUNC_CALL_REF CreateFuncCall( const wxString& name )
{ {
return nullptr; return nullptr;
};
}
protected: protected:
std::vector<UOP*> m_ucode; std::vector<UOP*> m_ucode;
}; };
@ -434,24 +444,22 @@ public:
m_op( op ), m_op( op ),
m_ref(nullptr), m_ref(nullptr),
m_value( std::move( value ) ) m_value( std::move( value ) )
{};
{}
UOP( int op, std::unique_ptr<VAR_REF> vref ) : UOP( int op, std::unique_ptr<VAR_REF> vref ) :
m_op( op ), m_op( op ),
m_ref( std::move( vref ) ), m_ref( std::move( vref ) ),
m_value(nullptr) m_value(nullptr)
{};
{}
UOP( int op, FUNC_CALL_REF func, std::unique_ptr<VAR_REF> vref = nullptr ) : UOP( int op, FUNC_CALL_REF func, std::unique_ptr<VAR_REF> vref = nullptr ) :
m_op( op ), m_op( op ),
m_func( std::move( func ) ), m_func( std::move( func ) ),
m_ref( std::move( vref ) ), m_ref( std::move( vref ) ),
m_value(nullptr) m_value(nullptr)
{};
{}
~UOP()
{
}
virtual ~UOP() = default;
void Exec( CONTEXT* ctx ); void Exec( CONTEXT* ctx );
@ -522,6 +530,11 @@ public:
COMPILER(); COMPILER();
virtual ~COMPILER(); virtual ~COMPILER();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
COMPILER( const COMPILER& ) = delete;
COMPILER& operator=( const COMPILER& ) = delete;
/* /*
* clear() should be invoked by the client if a new input string is to be processed. It * clear() should be invoked by the client if a new input string is to be processed. It
* will reset the parser. User defined variables are retained. * will reset the parser. User defined variables are retained.
@ -596,4 +609,3 @@ protected:
} // namespace LIBEVAL } // namespace LIBEVAL
#endif /* LIBEVAL_COMPILER_H_ */

10
include/rc_item.h

@ -219,6 +219,11 @@ public:
delete child; delete child;
} }
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
RC_TREE_NODE( const RC_TREE_NODE& ) = delete;
RC_TREE_NODE& operator=( const RC_TREE_NODE& ) = delete;
NODE_TYPE m_Type; NODE_TYPE m_Type;
std::shared_ptr<RC_ITEM> m_RcItem; std::shared_ptr<RC_ITEM> m_RcItem;
@ -248,6 +253,11 @@ public:
~RC_TREE_MODEL(); ~RC_TREE_MODEL();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
RC_TREE_MODEL( const RC_TREE_MODEL& ) = delete;
RC_TREE_MODEL& operator=( const RC_TREE_MODEL& ) = delete;
void Update( std::shared_ptr<RC_ITEMS_PROVIDER> aProvider, int aSeverities ); void Update( std::shared_ptr<RC_ITEMS_PROVIDER> aProvider, int aSeverities );
void ExpandAll(); void ExpandAll();

5
include/settings/json_settings.h

@ -78,6 +78,11 @@ public:
virtual ~JSON_SETTINGS(); virtual ~JSON_SETTINGS();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
JSON_SETTINGS( const JSON_SETTINGS& ) = delete;
JSON_SETTINGS& operator=( const JSON_SETTINGS& ) = delete;
wxString GetFilename() const { return m_filename; } wxString GetFilename() const { return m_filename; }
wxString GetFullFilename() const; wxString GetFullFilename() const;

2
include/tool/action_toolbar.h

@ -103,7 +103,7 @@ protected:
///< The default action to display on the toolbar item ///< The default action to display on the toolbar item
const TOOL_ACTION* m_defaultAction; const TOOL_ACTION* m_defaultAction;
///< The actions that compose the group
///< The actions that compose the group. Non-owning.
std::vector<const TOOL_ACTION*> m_actions; std::vector<const TOOL_ACTION*> m_actions;
}; };

5
include/undo_redo_container.h

@ -292,6 +292,11 @@ public:
UNDO_REDO_CONTAINER(); UNDO_REDO_CONTAINER();
~UNDO_REDO_CONTAINER(); ~UNDO_REDO_CONTAINER();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
UNDO_REDO_CONTAINER( const UNDO_REDO_CONTAINER& ) = delete;
UNDO_REDO_CONTAINER& operator=( const UNDO_REDO_CONTAINER& ) = delete;
void PushCommand( PICKED_ITEMS_LIST* aCommand ); void PushCommand( PICKED_ITEMS_LIST* aCommand );
PICKED_ITEMS_LIST* PopCommand(); PICKED_ITEMS_LIST* PopCommand();

13
include/view/view.h

@ -24,8 +24,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __VIEW_H
#define __VIEW_H
#pragma once
#include <gal/gal.h> #include <gal/gal.h>
#include <vector> #include <vector>
@ -73,6 +72,11 @@ public:
VIEW(); VIEW();
virtual ~VIEW(); virtual ~VIEW();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
VIEW( const VIEW& ) = delete;
VIEW& operator=( const VIEW& ) = delete;
/** /**
* Nasty hack, invoked by the destructor of VIEW_ITEM to auto-remove the item * Nasty hack, invoked by the destructor of VIEW_ITEM to auto-remove the item
* from the owning VIEW if there is any. * from the owning VIEW if there is any.
@ -768,10 +772,6 @@ protected:
} }
}; };
VIEW( const VIEW& ) = delete;
/// Redraw contents within rectangle \a aRect. /// Redraw contents within rectangle \a aRect.
void redrawRect( const BOX2I& aRect ); void redrawRect( const BOX2I& aRect );
@ -904,4 +904,3 @@ protected:
}; };
} // namespace KIGFX } // namespace KIGFX
#endif

16
include/view/view_group.h

@ -25,12 +25,7 @@
* *
*/ */
/**
* @file view_group.h
*/
#ifndef VIEW_GROUP_H_
#define VIEW_GROUP_H_
#pragma once
#include <gal/gal.h> #include <gal/gal.h>
#include <view/view_item.h> #include <view/view_item.h>
@ -50,6 +45,11 @@ public:
VIEW_GROUP( VIEW* aView = nullptr ); VIEW_GROUP( VIEW* aView = nullptr );
virtual ~VIEW_GROUP(); virtual ~VIEW_GROUP();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
VIEW_GROUP( const VIEW_GROUP& ) = delete;
VIEW_GROUP& operator=( const VIEW_GROUP& ) = delete;
wxString GetClass() const override; wxString GetClass() const override;
/** /**
@ -108,9 +108,7 @@ protected:
protected: protected:
int m_layer; int m_layer;
std::vector<VIEW_ITEM*> m_groupItems;
std::vector<VIEW_ITEM*> m_groupItems; // No ownership.
}; };
} // namespace KIGFX } // namespace KIGFX
#endif // VIEW_GROUP_H_

13
include/view/view_overlay.h

@ -24,12 +24,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __VIEW_OVERLAY_H
#define __VIEW_OVERLAY_H
#pragma once
#include <gal/gal.h> #include <gal/gal.h>
#include <view/view_item.h> #include <view/view_item.h>
#include <vector> #include <vector>
#include <deque> #include <deque>
@ -48,6 +46,11 @@ public:
VIEW_OVERLAY(); VIEW_OVERLAY();
virtual ~VIEW_OVERLAY(); virtual ~VIEW_OVERLAY();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
VIEW_OVERLAY( const VIEW_OVERLAY& ) = delete;
VIEW_OVERLAY& operator=( const VIEW_OVERLAY& ) = delete;
wxString GetClass() const override; wxString GetClass() const override;
struct COMMAND; struct COMMAND;
@ -109,13 +112,11 @@ public:
private: private:
void releaseCommands(); void releaseCommands();
private:
COLOR4D m_strokeColor; COLOR4D m_strokeColor;
COLOR4D m_fillColor; COLOR4D m_fillColor;
std::vector<COMMAND*> m_commands; std::vector<COMMAND*> m_commands;
}; };
} // namespace KIGFX } // namespace KIGFX
#endif

4
include/widgets/grid_text_button_helpers.h

@ -135,8 +135,8 @@ public:
protected: protected:
DIALOG_SHIM* m_dlg; DIALOG_SHIM* m_dlg;
SEARCH_STACK* m_searchStack;
std::vector<EMBEDDED_FILES*> m_filesStack;
SEARCH_STACK* m_searchStack; // No ownership.
std::vector<EMBEDDED_FILES*> m_filesStack; // No ownership.
}; };

9
include/widgets/search_pane.h

@ -68,6 +68,11 @@ public:
SEARCH_PANE( EDA_DRAW_FRAME* aFrame ); SEARCH_PANE( EDA_DRAW_FRAME* aFrame );
virtual ~SEARCH_PANE(); virtual ~SEARCH_PANE();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
SEARCH_PANE( const SEARCH_PANE& ) = delete;
SEARCH_PANE& operator=( const SEARCH_PANE& ) = delete;
void AddSearcher( SEARCH_HANDLER* aHandler ); void AddSearcher( SEARCH_HANDLER* aHandler );
void OnSearchTextEntry( wxCommandEvent& aEvent ) override; void OnSearchTextEntry( wxCommandEvent& aEvent ) override;
void OnNotebookPageChanged( wxBookCtrlEvent& aEvent ) override; void OnNotebookPageChanged( wxBookCtrlEvent& aEvent ) override;
@ -84,8 +89,8 @@ protected:
void OnClosed( wxAuiManagerEvent& aEvent ); void OnClosed( wxAuiManagerEvent& aEvent );
private: private:
std::vector<SEARCH_HANDLER*> m_handlers;
std::vector<SEARCH_PANE_TAB*> m_tabs;
std::vector<SEARCH_HANDLER*> m_handlers; // We own these.
std::vector<SEARCH_PANE_TAB*> m_tabs; // No ownership.
wxString m_lastQuery; wxString m_lastQuery;
EDA_DRAW_FRAME* m_frame; EDA_DRAW_FRAME* m_frame;
ACTION_MENU* m_menu; ACTION_MENU* m_menu;

5
pcbnew/drc/drc_engine.h

@ -91,6 +91,11 @@ public:
DRC_ENGINE( BOARD* aBoard = nullptr, BOARD_DESIGN_SETTINGS* aSettings = nullptr ); DRC_ENGINE( BOARD* aBoard = nullptr, BOARD_DESIGN_SETTINGS* aSettings = nullptr );
virtual ~DRC_ENGINE(); virtual ~DRC_ENGINE();
// We own several lists of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
DRC_ENGINE( const DRC_ENGINE& ) = delete;
DRC_ENGINE& operator=( const DRC_ENGINE& ) = delete;
void SetBoard( BOARD* aBoard ) { m_board = aBoard; } void SetBoard( BOARD* aBoard ) { m_board = aBoard; }
BOARD* GetBoard() const { return m_board; } BOARD* GetBoard() const { return m_board; }

5
pcbnew/drc/drc_item.h

@ -278,6 +278,11 @@ public:
m_markerTypes.push_back( otherMarkerType ); m_markerTypes.push_back( otherMarkerType );
} }
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
DRC_ITEMS_PROVIDER( const DRC_ITEMS_PROVIDER& ) = delete;
DRC_ITEMS_PROVIDER& operator=( const DRC_ITEMS_PROVIDER& ) = delete;
void SetSeverities( int aSeverities ) override; void SetSeverities( int aSeverities ) override;
int GetCount( int aSeverity = -1 ) const override; int GetCount( int aSeverity = -1 ) const override;

3
pcbnew/pcb_table.h

@ -39,6 +39,9 @@ public:
~PCB_TABLE(); ~PCB_TABLE();
// If implemented, would need to copy m_cells list.
PCB_TABLE& operator=( const PCB_TABLE& ) = delete;
static inline bool ClassOf( const EDA_ITEM* aItem ) static inline bool ClassOf( const EDA_ITEM* aItem )
{ {
return aItem && PCB_TABLE_T == aItem->Type(); return aItem && PCB_TABLE_T == aItem->Type();

5
pcbnew/widgets/appearance_controls.h

@ -202,6 +202,11 @@ public:
APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFocusOwner, bool aFpEditor = false ); APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFocusOwner, bool aFpEditor = false );
~APPEARANCE_CONTROLS(); ~APPEARANCE_CONTROLS();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
APPEARANCE_CONTROLS( const APPEARANCE_CONTROLS& ) = delete;
APPEARANCE_CONTROLS& operator=( const APPEARANCE_CONTROLS& ) = delete;
wxSize GetBestSize() const; wxSize GetBestSize() const;
///< Update the panel contents from the application and board models. ///< Update the panel contents from the application and board models.

Loading…
Cancel
Save