Skip to content

Commit 0fce3c3

Browse files
committed
More cppcheck fixes, make sure static analysis has openmp installed for clang-analyzer to find
1 parent 868c6fb commit 0fce3c3

9 files changed

Lines changed: 16 additions & 24 deletions

src/ngscopeclient/CreateFilterBrowser.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* *
33
* ngscopeclient *
44
* *
5-
* Copyright (c) 2012-2024 Andrew D. Zonenberg *
5+
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -43,9 +43,7 @@ using namespace std;
4343
// Construction / destruction
4444

4545
CreateFilterBrowser::CreateFilterBrowser(Session& session, MainWindow* parent)
46-
: Dialog("Filter Palette", "Filter Palette", ImVec2(550, 400))
47-
, m_session(session)
48-
, m_parent(parent)
46+
: Dialog("Filter Palette", "Filter Palette", ImVec2(550, 400), &session, parent)
4947
, m_selectedCategoryIndex(0)
5048
{
5149
m_categoryNames.push_back("All");
@@ -106,7 +104,7 @@ CreateFilterBrowser::~CreateFilterBrowser()
106104
*/
107105
bool CreateFilterBrowser::DoRender()
108106
{
109-
auto& refs = m_session.GetReferenceFilters();
107+
auto& refs = m_session->GetReferenceFilters();
110108

111109
//Filter bars
112110
ImGui::SetNextItemWidth(8 * ImGui::GetFontSize());
@@ -222,7 +220,7 @@ bool CreateFilterBrowser::DoRender()
222220
}
223221

224222
}
225-
223+
226224
ImGui::EndChild();
227225

228226
return true;

src/ngscopeclient/CreateFilterBrowser.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* *
33
* ngscopeclient *
44
* *
5-
* Copyright (c) 2012-2024 Andrew D. Zonenberg *
5+
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -49,8 +49,6 @@ class CreateFilterBrowser : public Dialog
4949
virtual bool DoRender() override;
5050

5151
protected:
52-
Session& m_session;
53-
MainWindow* m_parent;
5452

5553
std::vector<std::string> m_categoryNames;
5654
std::vector<Filter::Category> m_categoryValues;

src/ngscopeclient/FilterPropertiesDialog.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ bool FilterPropertiesDialog::DoRender()
213213
auto& param = it->second;
214214

215215
string s = param.GetFileName();
216-
if(m_paramTempValues.find(name) == m_paramTempValues.end())
217-
m_paramTempValues[name] = s;
216+
m_paramTempValues.try_emplace(name, s);
218217

219218
//Input path
220219
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 10);

src/ngscopeclient/MemoryLeakerDialog.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* *
33
* ngscopeclient *
44
* *
5-
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
5+
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -47,8 +47,9 @@ MemoryLeakerDialog::MemoryLeakerDialog(MainWindow* parent)
4747
: Dialog(
4848
"Memory Leaker",
4949
string("Memory Leaker ") + to_string(reinterpret_cast<uintptr_t>(this)),
50-
ImVec2(500, 300))
51-
, m_parent(parent)
50+
ImVec2(500, 300),
51+
nullptr,
52+
parent)
5253
, m_deviceMemoryString("0 kB")
5354
, m_deviceMemoryUsage(0)
5455
, m_hostMemoryString("0 kB")

src/ngscopeclient/MemoryLeakerDialog.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* *
33
* ngscopeclient *
44
* *
5-
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
5+
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -52,7 +52,6 @@ class MemoryLeakerDialog : public Dialog
5252
virtual bool DoRender();
5353

5454
protected:
55-
MainWindow* m_parent;
5655

5756
std::string m_deviceMemoryString;
5857
int64_t m_deviceMemoryUsage;

src/ngscopeclient/NotesDialog.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* *
33
* ngscopeclient *
44
* *
5-
* Copyright (c) 2012-2025 Andrew D. Zonenberg *
5+
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -44,8 +44,7 @@ using namespace std;
4444
// Construction / destruction
4545

4646
NotesDialog::NotesDialog(MainWindow* parent)
47-
: Dialog("Lab Notes", "Lab Notes", ImVec2(800, 400))
48-
, m_parent(parent)
47+
: Dialog("Lab Notes", "Lab Notes", ImVec2(800, 400), nullptr, parent)
4948
{
5049
}
5150

src/ngscopeclient/NotesDialog.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* *
33
* ngscopeclient *
44
* *
5-
* Copyright (c) 2012-2023 Andrew D. Zonenberg *
5+
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -52,8 +52,6 @@ class NotesDialog : public Dialog
5252

5353
void SetupNotes();
5454
void GeneralNotes();
55-
56-
MainWindow* m_parent;
5755
};
5856

5957
#endif

test-scripts/test-driver-debian-analyze.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
sudo apt -y update
33
sudo apt -y full-upgrade
4-
sudo apt -y install build-essential git cmake pkgconf libgtk-3-dev libsigc++-2.0-dev libyaml-cpp-dev catch2 libglfw3-dev curl xzip libhidapi-dev lsb-release dpkg-dev file libvulkan-dev glslang-dev glslang-tools spirv-tools glslc liblxi-dev libtirpc-dev texlive texlive-binaries texlive-fonts-extra texlive-extra-utils libfftw3-dev vulkan-validationlayers cppcheck clang-tools
4+
sudo apt -y install build-essential git cmake pkgconf libgtk-3-dev libsigc++-2.0-dev libyaml-cpp-dev catch2 libglfw3-dev curl xzip libhidapi-dev lsb-release dpkg-dev file libvulkan-dev glslang-dev glslang-tools spirv-tools glslc liblxi-dev libtirpc-dev texlive texlive-binaries texlive-fonts-extra texlive-extra-utils libfftw3-dev vulkan-validationlayers cppcheck clang-tools libomp-dev
55

66
export VK_LOADER_LAYERS_ENABLE=VK_LAYER_KHRONOS_validation
77
source ./test-scripts/Validation.sh

0 commit comments

Comments
 (0)