From 8a4dafc1b6ea114a30844dd153de2714d2d286f9 Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Wed, 28 May 2025 00:10:51 -0400 Subject: Fix cxx20 compiler warnings. --- view/elf/elfview.cpp | 2 +- view/kernelcache/ui/kctriage.cpp | 6 +++--- view/macho/machoview.cpp | 2 +- view/pe/peview.cpp | 2 +- view/sharedcache/ui/dsctriage.cpp | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'view') 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 navigateToAddress = [=](uint64_t addr) { + std::function navigateToAddress = [=, this](uint64_t addr) { ExecuteOnMainThread([addr, this](){ if (Settings::Instance()->Get("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 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}); -- cgit v1.3.1