Skip to content

Commit 2b64cb2

Browse files
committed
debugger: minor code fixes and drop reqs to C++14 instead of C++20.
1 parent 6200ec4 commit 2b64cb2

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

gui/qt/debugger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ void MainWindow::gotoPressed() {
19861986
QString resolved = resolveAddressOrEquate(typed, &ok);
19871987
if (ok) {
19881988
m_gotoAddr = typed;
1989-
disasmUpdateAddr(static_cast<int>(hex2int(resolved)), false);
1989+
disasmUpdateAddr(hex2int(resolved), false);
19901990

19911991
auto &hist = m_disasmGotoHistory;
19921992
hist.erase(std::remove_if(hist.begin(), hist.end(), [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; }), hist.end());

gui/qt/memorywidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void MainWindow::flashGotoPressed() {
117117
ui->flashEdit->setOffset(hex2int(resolved));
118118

119119
auto &hist = m_memGotoHistory;
120-
std::erase_if(hist, [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; });
120+
hist.erase(std::remove_if(hist.begin(), hist.end(), [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; }), hist.end());
121121
hist.insert(hist.begin(), typed);
122122
if (hist.size() > 50) { hist.resize(50); }
123123
} else {
@@ -138,7 +138,7 @@ void MainWindow::ramGotoPressed() {
138138
ui->ramEdit->setOffset(hex2int(resolved) - 0xD00000);
139139

140140
auto &hist = m_memGotoHistory;
141-
std::erase_if(hist, [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; });
141+
hist.erase(std::remove_if(hist.begin(), hist.end(), [&](const QString &s){ return s.compare(typed, Qt::CaseInsensitive) == 0; }), hist.end());
142142
hist.insert(hist.begin(), typed);
143143
if (hist.size() > 50) { hist.resize(50); }
144144
} else {

gui/qt/utils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ QString resolveAddressOrEquate(const QString &input, bool *ok) {
6868
return {};
6969
}
7070

71-
if (QString equ = getAddressOfEquate(in.toStdString()); !equ.isEmpty()) {
71+
QString addr = getAddressOfEquate(in.toStdString());
72+
if (!addr.isEmpty()) {
7273
if (ok) { *ok = true; }
73-
return equ;
74+
return addr;
7475
}
7576

7677
QString s = in;
@@ -80,8 +81,7 @@ QString resolveAddressOrEquate(const QString &input, bool *ok) {
8081
if (s.isEmpty() || s.length() > 6) {
8182
return {};
8283
}
83-
std::string ss = s.toStdString();
84-
if (ss.find_first_not_of("0123456789ABCDEF") != std::string::npos) {
84+
if (s.toStdString().find_first_not_of("0123456789ABCDEF") != std::string::npos) {
8585
return {};
8686
}
8787

0 commit comments

Comments
 (0)