summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Taylor <alex@vector35.com>2025-05-28 00:10:51 -0400
committerAlexander Taylor <alex@vector35.com>2025-06-25 18:36:48 -0400
commit8a4dafc1b6ea114a30844dd153de2714d2d286f9 (patch)
treec6a6fa1c60e420c1ceb8577d4e2f79bb9133b55a
parent0838242066437a04e3aa3417cab703cc071adde6 (diff)
Fix cxx20 compiler warnings.
-rw-r--r--arch/mips/mips/test.c1
-rw-r--r--examples/triage/byte.cpp48
-rw-r--r--examples/triage/entropy.cpp2
-rw-r--r--examples/triage/entry.cpp2
-rw-r--r--examples/triage/exports.cpp8
-rw-r--r--examples/triage/files.cpp2
-rw-r--r--examples/triage/imports.cpp2
-rw-r--r--examples/triage/strings.cpp2
-rw-r--r--objectivec/objc.cpp2
-rw-r--r--view/elf/elfview.cpp2
-rw-r--r--view/kernelcache/ui/kctriage.cpp6
-rw-r--r--view/macho/machoview.cpp2
-rw-r--r--view/pe/peview.cpp2
-rw-r--r--view/sharedcache/ui/dsctriage.cpp6
14 files changed, 43 insertions, 44 deletions
diff --git a/arch/mips/mips/test.c b/arch/mips/mips/test.c
index df009043..a682863d 100644
--- a/arch/mips/mips/test.c
+++ b/arch/mips/mips/test.c
@@ -61,7 +61,6 @@ int main(int ac, char **av)
uint32_t insword = 0;
uint64_t baseaddr = 0;
int instindex = 1;
- int c = 0;
int version = -1;
int flags = 0;
int result = 0;
diff --git a/examples/triage/byte.cpp b/examples/triage/byte.cpp
index 3acab281..12ffcb43 100644
--- a/examples/triage/byte.cpp
+++ b/examples/triage/byte.cpp
@@ -67,30 +67,30 @@ ByteView::ByteView(QWidget* parent, BinaryViewRef data) : QAbstractScrollArea(pa
m_updateTimer->setSingleShot(false);
// connect(m_updateTimer, &QTimer::timeout, this, &ByteView::updateTimerEvent);
- actionHandler()->bindAction("Move Cursor Up", UIAction([=]() { up(false); }));
- actionHandler()->bindAction("Move Cursor Down", UIAction([=]() { down(false); }));
- actionHandler()->bindAction("Move Cursor Left", UIAction([=]() { left(1, false); }));
- actionHandler()->bindAction("Move Cursor Right", UIAction([=]() { right(1, false); }));
- actionHandler()->bindAction("Move Cursor Word Left", UIAction([=]() { left(8, false); }));
- actionHandler()->bindAction("Move Cursor Word Right", UIAction([=]() { right(8, false); }));
- actionHandler()->bindAction("Extend Selection Up", UIAction([=]() { up(true); }));
- actionHandler()->bindAction("Extend Selection Down", UIAction([=]() { down(true); }));
- actionHandler()->bindAction("Extend Selection Left", UIAction([=]() { left(1, true); }));
- actionHandler()->bindAction("Extend Selection Right", UIAction([=]() { right(1, true); }));
- actionHandler()->bindAction("Extend Selection Word Left", UIAction([=]() { left(8, true); }));
- actionHandler()->bindAction("Extend Selection Word Right", UIAction([=]() { right(8, true); }));
- actionHandler()->bindAction("Page Up", UIAction([=]() { pageUp(false); }));
- actionHandler()->bindAction("Page Down", UIAction([=]() { pageDown(false); }));
- actionHandler()->bindAction("Extend Selection Page Up", UIAction([=]() { pageUp(true); }));
- actionHandler()->bindAction("Extend Selection Page Down", UIAction([=]() { pageDown(true); }));
- actionHandler()->bindAction("Move Cursor to Start of Line", UIAction([=]() { moveToStartOfLine(false); }));
- actionHandler()->bindAction("Move Cursor to End of Line", UIAction([=]() { moveToEndOfLine(false); }));
- actionHandler()->bindAction("Move Cursor to Start of View", UIAction([=]() { moveToStartOfView(false); }));
- actionHandler()->bindAction("Move Cursor to End of View", UIAction([=]() { moveToEndOfView(false); }));
- actionHandler()->bindAction("Extend Selection to Start of Line", UIAction([=]() { moveToStartOfLine(true); }));
- actionHandler()->bindAction("Extend Selection to End of Line", UIAction([=]() { moveToEndOfLine(true); }));
- actionHandler()->bindAction("Extend Selection to Start of View", UIAction([=]() { moveToStartOfView(true); }));
- actionHandler()->bindAction("Extend Selection to End of View", UIAction([=]() { moveToEndOfView(true); }));
+ actionHandler()->bindAction("Move Cursor Up", UIAction([=, this]() { up(false); }));
+ actionHandler()->bindAction("Move Cursor Down", UIAction([=, this]() { down(false); }));
+ actionHandler()->bindAction("Move Cursor Left", UIAction([=, this]() { left(1, false); }));
+ actionHandler()->bindAction("Move Cursor Right", UIAction([=, this]() { right(1, false); }));
+ actionHandler()->bindAction("Move Cursor Word Left", UIAction([=, this]() { left(8, false); }));
+ actionHandler()->bindAction("Move Cursor Word Right", UIAction([=, this]() { right(8, false); }));
+ actionHandler()->bindAction("Extend Selection Up", UIAction([=, this]() { up(true); }));
+ actionHandler()->bindAction("Extend Selection Down", UIAction([=, this]() { down(true); }));
+ actionHandler()->bindAction("Extend Selection Left", UIAction([=, this]() { left(1, true); }));
+ actionHandler()->bindAction("Extend Selection Right", UIAction([=, this]() { right(1, true); }));
+ actionHandler()->bindAction("Extend Selection Word Left", UIAction([=, this]() { left(8, true); }));
+ actionHandler()->bindAction("Extend Selection Word Right", UIAction([=, this]() { right(8, true); }));
+ actionHandler()->bindAction("Page Up", UIAction([=, this]() { pageUp(false); }));
+ actionHandler()->bindAction("Page Down", UIAction([=, this]() { pageDown(false); }));
+ actionHandler()->bindAction("Extend Selection Page Up", UIAction([=, this]() { pageUp(true); }));
+ actionHandler()->bindAction("Extend Selection Page Down", UIAction([=, this]() { pageDown(true); }));
+ actionHandler()->bindAction("Move Cursor to Start of Line", UIAction([=, this]() { moveToStartOfLine(false); }));
+ actionHandler()->bindAction("Move Cursor to End of Line", UIAction([=, this]() { moveToEndOfLine(false); }));
+ actionHandler()->bindAction("Move Cursor to Start of View", UIAction([=, this]() { moveToStartOfView(false); }));
+ actionHandler()->bindAction("Move Cursor to End of View", UIAction([=, this]() { moveToEndOfView(false); }));
+ actionHandler()->bindAction("Extend Selection to Start of Line", UIAction([=, this]() { moveToStartOfLine(true); }));
+ actionHandler()->bindAction("Extend Selection to End of Line", UIAction([=, this]() { moveToEndOfLine(true); }));
+ actionHandler()->bindAction("Extend Selection to Start of View", UIAction([=, this]() { moveToStartOfView(true); }));
+ actionHandler()->bindAction("Extend Selection to End of View", UIAction([=, this]() { moveToEndOfView(true); }));
}
diff --git a/examples/triage/entropy.cpp b/examples/triage/entropy.cpp
index b43350cd..229c7079 100644
--- a/examples/triage/entropy.cpp
+++ b/examples/triage/entropy.cpp
@@ -12,7 +12,7 @@ EntropyThread::EntropyThread(BinaryViewRef data, size_t blockSize, QImage* image
m_blockSize = blockSize;
m_updated = false;
m_running = true;
- m_thread = std::thread([=]() { Run(); });
+ m_thread = std::thread([=, this]() { Run(); });
}
diff --git a/examples/triage/entry.cpp b/examples/triage/entry.cpp
index 4c7f5ec0..f66634f1 100644
--- a/examples/triage/entry.cpp
+++ b/examples/triage/entry.cpp
@@ -160,7 +160,7 @@ EntryTreeView::EntryTreeView(EntryWidget* parent, TriageView* view, BinaryViewRe
// Allow view-specific shortcuts when imports are focused
m_actionHandler.setupActionHandler(this);
- m_actionHandler.setActionContext([=]() { return m_view->actionContext(); });
+ m_actionHandler.setActionContext([=, this]() { return m_view->actionContext(); });
m_model = new GenericEntryModel(this, m_data);
setModel(m_model);
diff --git a/examples/triage/exports.cpp b/examples/triage/exports.cpp
index 067ebe92..4d274b1a 100644
--- a/examples/triage/exports.cpp
+++ b/examples/triage/exports.cpp
@@ -28,7 +28,7 @@ GenericExportsModel::GenericExportsModel(QWidget* parent, BinaryViewRef data): Q
m_updateTimer->setSingleShot(true);
m_updateTimer->setInterval(500);
connect(m_updateTimer, &QTimer::timeout, this, &GenericExportsModel::updateModel);
- connect(this, &GenericExportsModel::modelUpdate, this, [=]() {
+ connect(this, &GenericExportsModel::modelUpdate, this, [=, this]() {
if (m_updateTimer->isActive())
return;
m_updateTimer->start();
@@ -285,7 +285,7 @@ ExportsTreeView::ExportsTreeView(ExportsWidget* parent, TriageView* view, Binary
// Allow view-specific shortcuts when imports are focused
m_actionHandler.setupActionHandler(this);
- m_actionHandler.setActionContext([=]() { return m_view->actionContext(); });
+ m_actionHandler.setActionContext([=, this]() { return m_view->actionContext(); });
setFont(getMonospaceFont(this));
@@ -306,11 +306,11 @@ ExportsTreeView::ExportsTreeView(ExportsWidget* parent, TriageView* view, Binary
connect(selectionModel(), &QItemSelectionModel::currentChanged, this, &ExportsTreeView::exportSelected);
connect(this, &QTreeView::doubleClicked, this, &ExportsTreeView::exportDoubleClicked);
- connect(m_model, &QAbstractItemModel::modelAboutToBeReset, this, [=]() {
+ connect(m_model, &QAbstractItemModel::modelAboutToBeReset, this, [=, this]() {
m_selection = selectionModel()->selectedIndexes();
m_scroll = verticalScrollBar()->value();
});
- connect(m_model, &QAbstractItemModel::modelReset, this, [=]() {
+ connect(m_model, &QAbstractItemModel::modelReset, this, [=, this]() {
for (auto& idx : m_selection)
{
setCurrentIndex(idx);
diff --git a/examples/triage/files.cpp b/examples/triage/files.cpp
index d70b61cd..f1d7e09e 100644
--- a/examples/triage/files.cpp
+++ b/examples/triage/files.cpp
@@ -46,7 +46,7 @@ TriageFilePicker::TriageFilePicker(UIContext* context)
}
m_actionHandler.bindAction(
- "Open Selected Files", UIAction([=]() { openSelectedFiles(); }, [=]() { return areFilesSelected(); }));
+ "Open Selected Files", UIAction([=, this]() { openSelectedFiles(); }, [=, this]() { return areFilesSelected(); }));
m_contextMenu.addAction("Open Selected Files", "Open");
}
diff --git a/examples/triage/imports.cpp b/examples/triage/imports.cpp
index 1cc066de..62c8a370 100644
--- a/examples/triage/imports.cpp
+++ b/examples/triage/imports.cpp
@@ -232,7 +232,7 @@ ImportsTreeView::ImportsTreeView(ImportsWidget* parent, TriageView* view, Binary
// Allow view-specific shortcuts when imports are focused
m_actionHandler.setupActionHandler(this);
- m_actionHandler.setActionContext([=]() { return m_view->actionContext(); });
+ m_actionHandler.setActionContext([=, this]() { return m_view->actionContext(); });
m_model = new GenericImportsModel(this, m_data);
setModel(m_model);
diff --git a/examples/triage/strings.cpp b/examples/triage/strings.cpp
index 7c3f44e8..f7fe5989 100644
--- a/examples/triage/strings.cpp
+++ b/examples/triage/strings.cpp
@@ -186,7 +186,7 @@ StringsTreeView::StringsTreeView(StringsWidget* parent, TriageView* view, Binary
// Allow view-specific shortcuts when strings are focused
m_actionHandler.setupActionHandler(this);
- m_actionHandler.setActionContext([=]() { return m_view->actionContext(); });
+ m_actionHandler.setActionContext([=, this]() { return m_view->actionContext(); });
m_model = new GenericStringsModel(this, m_data);
setModel(m_model);
diff --git a/objectivec/objc.cpp b/objectivec/objc.cpp
index a34cffe1..e37be388 100644
--- a/objectivec/objc.cpp
+++ b/objectivec/objc.cpp
@@ -327,7 +327,7 @@ void ObjCProcessor::DefineObjCSymbol(
if (name.size() == 0 || addr == 0)
return;
- auto process = [=]() {
+ auto process = [=, this]() {
NameSpace nameSpace = m_data->GetInternalNameSpace();
if (type == ExternalSymbol)
{
diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp
index b8dd1aaa..25e00152 100644
--- a/view/elf/elfview.cpp
+++ b/view/elf/elfview.cpp
@@ -2511,7 +2511,7 @@ void ElfView::DefineElfSymbol(BNSymbolType type, const string& incomingName, uin
if (gotEntry)
m_gotEntryLocations.emplace(addr);
- auto process = [=]() {
+ auto process = [=, this]() {
NameSpace nameSpace = GetInternalNameSpace();
if (type == ExternalSymbol)
{
diff --git a/view/kernelcache/ui/kctriage.cpp b/view/kernelcache/ui/kctriage.cpp
index bac39b5e..c28c323a 100644
--- a/view/kernelcache/ui/kctriage.cpp
+++ b/view/kernelcache/ui/kctriage.cpp
@@ -244,7 +244,7 @@ QWidget* KCTriageView::initImageTable()
m_imageTable->setFilter(filter.toStdString());
});
- connect(m_imageTable, &FilterableTableView::activated, this, [=](const QModelIndex& index) {
+ connect(m_imageTable, &FilterableTableView::activated, this, [=, this](const QModelIndex& index) {
auto addr = m_imageModel->item(index.row(), 0)->text().toULongLong(nullptr, 16);
loadImagesWithAddr({addr});
});
@@ -325,7 +325,7 @@ void KCTriageView::initSymbolTable()
auto symbolWidget = new QWidget;
symbolWidget->setLayout(symbolLayout);
- std::function<void(uint64_t)> navigateToAddress = [=](uint64_t addr) {
+ std::function<void(uint64_t)> navigateToAddress = [=, this](uint64_t addr) {
ExecuteOnMainThread([addr, this](){
if (Settings::Instance()->Get<bool>("ui.view.graph.preferred"))
m_data->Navigate("Graph:KCView", addr);
@@ -334,7 +334,7 @@ void KCTriageView::initSymbolTable()
});
};
- connect(m_symbolTable, &SymbolTableView::activated, this, [=](const QModelIndex& index)
+ connect(m_symbolTable, &SymbolTableView::activated, this, [=, this](const QModelIndex& index)
{
auto symbol = m_symbolTable->getSymbolAtRow(index.row());
WorkerPriorityEnqueue([this, symbol, navigateToAddress]() {
diff --git a/view/macho/machoview.cpp b/view/macho/machoview.cpp
index 3d8b0186..a58fd556 100644
--- a/view/macho/machoview.cpp
+++ b/view/macho/machoview.cpp
@@ -2439,7 +2439,7 @@ Ref<Symbol> MachoView::DefineMachoSymbol(
}
- auto process = [=]() {
+ auto process = [=, this]() {
// If name does not start with alphabetic character or symbol, prepend an underscore
string rawName = name;
if (!(((name[0] >= 'A') && (name[0] <= 'Z')) || ((name[0] >= 'a') && (name[0] <= 'z')) || (name[0] == '_')
diff --git a/view/pe/peview.cpp b/view/pe/peview.cpp
index e45edd05..c223d12b 100644
--- a/view/pe/peview.cpp
+++ b/view/pe/peview.cpp
@@ -2965,7 +2965,7 @@ void PEView::AddPESymbol(BNSymbolType type, const string& dll, const string& nam
}
m_symbolQueue->Append(
- [=]() {
+ [=, this]() {
// If name does not start with alphabetic character or symbol, prepend an underscore
string rawName = name;
if (!(((name[0] >= 'A') && (name[0] <= 'Z')) || ((name[0] >= 'a') && (name[0] <= 'z')) || (name[0] == '_')
diff --git a/view/sharedcache/ui/dsctriage.cpp b/view/sharedcache/ui/dsctriage.cpp
index b367b809..32a8e97c 100644
--- a/view/sharedcache/ui/dsctriage.cpp
+++ b/view/sharedcache/ui/dsctriage.cpp
@@ -269,7 +269,7 @@ QWidget* DSCTriageView::initImageTable()
m_imageTable->setFilter(filter.toStdString());
});
- connect(m_imageTable, &FilterableTableView::activated, this, [=](const QModelIndex& index) {
+ connect(m_imageTable, &FilterableTableView::activated, this, [=, this](const QModelIndex& index) {
auto addr = m_imageModel->item(index.row(), 0)->text().toULongLong(nullptr, 16);
loadImagesWithAddr({addr});
});
@@ -360,7 +360,7 @@ void DSCTriageView::initSymbolTable()
auto symbolWidget = new QWidget;
symbolWidget->setLayout(symbolLayout);
- connect(m_symbolTable, &SymbolTableView::activated, this, [=](const QModelIndex& index){
+ connect(m_symbolTable, &SymbolTableView::activated, this, [=, this](const QModelIndex& index){
auto symbol = m_symbolTable->getSymbolAtRow(index.row());
auto dialog = new QMessageBox(this);
@@ -375,7 +375,7 @@ void DSCTriageView::initSymbolTable()
dialog->setText("Load " + QString::fromStdString(image->name) + "?");
dialog->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
- connect(dialog, &QMessageBox::buttonClicked, this, [=](QAbstractButton* button)
+ connect(dialog, &QMessageBox::buttonClicked, this, [=, this](QAbstractButton* button)
{
if (button == dialog->button(QMessageBox::Yes))
loadImagesWithAddr({image->headerAddress});