From 06a472a358ea30ace47dc14609c373cd32ee3943 Mon Sep 17 00:00:00 2001 From: prisixia Date: Sat, 6 May 2023 15:33:40 +0200 Subject: [PATCH] Disable cppcoreguidelines-owning-memory Due to how wxWidgets works, certain parts of it don't require owning the memory and it's just recommend to use raw pointers instead. --- src/gui/main_panel.cpp | 3 +++ src/gui/stages_panel.cpp | 3 +++ src/speciesgen.cpp | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/src/gui/main_panel.cpp b/src/gui/main_panel.cpp index c744a43..f9b18de 100644 --- a/src/gui/main_panel.cpp +++ b/src/gui/main_panel.cpp @@ -28,6 +28,8 @@ wxBEGIN_EVENT_TABLE(MainPanel, wxPanel) #endif // wxUSE_DIRDLG wxEND_EVENT_TABLE() +// NOLINTBEGIN(cppcoreguidelines-owning-memory): wxWidgets already manages its +// memory more or less so that there's no need for owning the memory MainPanel::MainPanel(wxWindow *window, int x, int y, int w, int h, const std::string &handlerName) : wxPanel(window, wxID_ANY, wxPoint(x, y), wxSize(w, h)), @@ -100,6 +102,7 @@ MainPanel::MainPanel(wxWindow *window, int x, int y, int w, int h, SetSizer(topSizer); } +// NOLINTEND(cppcoreguidelines-owning-memory) #if wxUSE_CLIPBOARD /* diff --git a/src/gui/stages_panel.cpp b/src/gui/stages_panel.cpp index b8de4be..4577ddd 100644 --- a/src/gui/stages_panel.cpp +++ b/src/gui/stages_panel.cpp @@ -35,6 +35,8 @@ wxBEGIN_EVENT_TABLE(StagesPanel, wxPanel) EVT_BUTTON(STAGES_SET_DEFAULT, StagesPanel::OnResetWeightStages) wxEND_EVENT_TABLE() +// NOLINTBEGIN(cppcoreguidelines-owning-memory): wxWidgets already manages its +// memory more or less so that there's no need for owning the memory StagesPanel::StagesPanel(wxWindow *window, int x, int y, int w, int h, const std::string &handlerName) : wxPanel(window, wxID_ANY, wxPoint(x, y), wxSize(w, h)), @@ -146,6 +148,7 @@ StagesPanel::StagesPanel(wxWindow *window, int x, int y, int w, int h, SetSizer(topSizer); } +// NOLINTEND(cppcoreguidelines-owning-memory) void StagesPanel::DoAddWeightStage(Starpounds::WeightStage stage) { stage.SetName(GetInternalNameReplacement(stage)); diff --git a/src/speciesgen.cpp b/src/speciesgen.cpp index 3ec5001..8a877d2 100644 --- a/src/speciesgen.cpp +++ b/src/speciesgen.cpp @@ -37,10 +37,13 @@ bool App::OnInit() { return false; } + // NOLINTBEGIN(cppcoreguidelines-owning-memory): wxWidgets already manages + // its memory more or less so that there's no need for owning the memory Frame *frame = new Frame("Species Support Generator", 680, 480); wxMenu *file_menu = new wxMenu; wxMenu *help_menu = new wxMenu; wxMenuBar *menu_bar = new wxMenuBar(wxMB_DOCKABLE); + // NOLINTEND(cppcoreguidelines-owning-memory) #if wxUSE_FILEDLG file_menu->Append(TEXT_EXPORT, "&Export weightstages\tCTRL+S", @@ -107,6 +110,8 @@ wxBEGIN_EVENT_TABLE(Frame, wxFrame) #endif // wxUSE_CLIPBOARD wxEND_EVENT_TABLE() +// NOLINTBEGIN(cppcoreguidelines-owning-memory): wxWidgets already manages its +// memory more or less so that there's no need for owning the memory Frame::Frame(const wxString &title, int x, int y) : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(x, y), wxDEFAULT_FRAME_STYLE) { @@ -158,6 +163,7 @@ Frame::Frame(const wxString &title, int x, int y) m_panel_stages->m_subRemove->Bind(wxEVT_BUTTON, &Frame::OnRemoveWeightStageSub, this); } +// NOLINTEND(cppcoreguidelines-owning-memory) #if wxUSE_CLIPBOARD /*