Fix GCC-induced -Werror errors
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -14,8 +14,7 @@ project(Ripes CXX)
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "-Wextra -Wall \
-Werror=switch -Werror=return-type -Werror=shadow \
- -Werror=unreachable-code -Werror=Wno-bad-function-cast \
- -Werror=no-unused-function -Werror=no-unused-local-typedefs")
+ -Werror=unreachable-code")
endif()
######################################################################

MODIFY
src/assembler/instruction.h
src/assembler/instruction.h
@@ -109,13 +109,14 @@ struct Reg : public Field {
* @param tokenIndex: Index within a list of decoded instruction tokens that corresponds to the register index
* @param range: range in instruction field containing register index value
*/
- Reg(const ISAInfoBase* isa, unsigned tokenIndex, BitRange range) : Field(tokenIndex), m_range(range), m_isa(isa) {}
- Reg(const ISAInfoBase* isa, unsigned tokenIndex, unsigned _start, unsigned _stop)
- : Field(tokenIndex), m_range({_start, _stop}), m_isa(isa) {}
- Reg(const ISAInfoBase* isa, unsigned tokenIndex, BitRange range, QString _regsd)
- : Field(tokenIndex), m_range(range), m_isa(isa), regsd(_regsd) {}
- Reg(const ISAInfoBase* isa, unsigned tokenIndex, unsigned _start, unsigned _stop, QString _regsd)
- : Field(tokenIndex), m_range({_start, _stop}), m_isa(isa), regsd(_regsd) {}
+ Reg(const ISAInfoBase* isa, unsigned _tokenIndex, BitRange range)
+ : Field(_tokenIndex), m_range(range), m_isa(isa) {}
+ Reg(const ISAInfoBase* isa, unsigned _tokenIndex, unsigned _start, unsigned _stop)
+ : Field(_tokenIndex), m_range({_start, _stop}), m_isa(isa) {}
+ Reg(const ISAInfoBase* isa, unsigned _tokenIndex, BitRange range, QString _regsd)
+ : Field(_tokenIndex), m_range(range), m_isa(isa), regsd(_regsd) {}
+ Reg(const ISAInfoBase* isa, unsigned _tokenIndex, unsigned _start, unsigned _stop, QString _regsd)
+ : Field(_tokenIndex), m_range({_start, _stop}), m_isa(isa), regsd(_regsd) {}
std::optional<Assembler::Error> apply(const Assembler::TokenizedSrcLine& line, uint32_t& instruction,
FieldLinkRequest&) const override {
bool success;

MODIFY
src/assembler/rv32i_assembler.cpp
src/assembler/rv32i_assembler.cpp
@@ -105,12 +105,14 @@ std::tuple<InstrVec, PseudoInstrVec> RV32I_Assembler::initInstructions(const ISA
#define RegTok PseudoInstruction::reg()
#define ImmTok PseudoInstruction::imm()
#define CreatePseudoInstruction
-#define PseudoExpandFunc(line, symbols) \
+#define _PseudoExpandFuncSyms(line, symbols) \
[](const PseudoInstruction&, const TokenizedSrcLine& line, const SymbolMap& symbols)
+#define _PseudoExpandFunc(line) [](const PseudoInstruction&, const TokenizedSrcLine& line, const SymbolMap&)
+
#define PseudoLoad(name) \
std::shared_ptr<PseudoInstruction>(new PseudoInstruction( \
- name, {RegTok, ImmTok}, PseudoExpandFunc(line, symbols) { \
+ name, {RegTok, ImmTok}, _PseudoExpandFunc(line) { \
LineTokensVec v; \
v.push_back(LineTokens() << Token("auipc") << line.tokens.at(1) << Token(line.tokens.at(2), "%pcrel_hi")); \
v.push_back(LineTokens() << name << line.tokens.at(1) \
@@ -123,7 +125,7 @@ std::tuple<InstrVec, PseudoInstrVec> RV32I_Assembler::initInstructions(const ISA
// a number has been provided, then abort the pseudo-op handling.
#define PseudoStore(name) \
std::shared_ptr<PseudoInstruction>(new PseudoInstruction( \
- name, {RegTok, ImmTok, RegTok}, PseudoExpandFunc(line, symbols) { \
+ name, {RegTok, ImmTok, RegTok}, _PseudoExpandFunc(line) { \
bool canConvert; \
getImmediate(line.tokens.at(2), canConvert); \
if (canConvert) { \
@@ -149,51 +151,51 @@ void RV32I_Assembler::enableExtI(const ISAInfo<ISA::RV32I>* isa, InstrVec& instr
// clang-format off
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(new PseudoInstruction(
- Token("la"), {RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ Token("la"), {RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens() << Token("auipc") << line.tokens.at(1) << Token(line.tokens.at(2), "%pcrel_hi"),
LineTokens() << Token("addi") << line.tokens.at(1) << line.tokens.at(1) << Token(QString("(%1 + 4)").arg(line.tokens.at(2)), "%pcrel_lo")};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(new PseudoInstruction(
- Token("call"), {RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ Token("call"), {RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens() << Token("auipc") << Token("x6") << line.tokens.at(1),
LineTokens() << Token("jalr") << Token("x1") << Token("x6") << line.tokens.at(1)};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(new PseudoInstruction(
- Token("tail"), {RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ Token("tail"), {RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens() << Token("auipc") << Token("x6") << line.tokens.at(1),
LineTokens() << Token("jalr") << Token("x0") << Token("x6") << line.tokens.at(1)};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(new PseudoInstruction(
- Token("j"), {ImmTok}, PseudoExpandFunc(line, symbols) {
+ Token("j"), {ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens() << Token("jal") << Token("x0") << line.tokens.at(1)};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(new PseudoInstruction(
- Token("jr"), {RegTok}, PseudoExpandFunc(line, symbols) {
+ Token("jr"), {RegTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens() << Token("jalr") << Token("x0") << line.tokens.at(1) << Token("0")};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(new PseudoInstruction(
- Token("jalr"), {RegTok}, PseudoExpandFunc(line, symbols) {
+ Token("jalr"), {RegTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens() << Token("jalr") << Token("x1") << line.tokens.at(1) << Token("0")};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(new PseudoInstruction(
- Token("ret"), {}, PseudoExpandFunc(line, symbols) {
+ Token("ret"), {}, [](const PseudoInstruction&, const TokenizedSrcLine& , const SymbolMap&) {
return LineTokensVec{LineTokens() << Token("jalr") << Token("x0") << Token("x1") << Token("0")};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(new PseudoInstruction(
- Token("jal"), {ImmTok}, PseudoExpandFunc(line, symbols) {
+ Token("jal"), {ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens() << Token("jal") << Token("x1") << line.tokens.at(1)};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(new PseudoInstruction(
Token("li"), {RegTok, ImmTok},
- PseudoExpandFunc(line, symbols) {
+ _PseudoExpandFuncSyms(line, symbols) {
LineTokensVec v;
// Determine whether an ADDI or LUI instruction is sufficient, or if both LUI and ADDI is needed, by
// analysing the immediate size
@@ -228,92 +230,92 @@ void RV32I_Assembler::enableExtI(const ISAInfo<ISA::RV32I>* isa, InstrVec& instr
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token(Token("nop")), {}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token(Token("nop")), {}, [](const PseudoInstruction&, const TokenizedSrcLine& , const SymbolMap&) {
return LineTokensVec{LineTokens() << Token("addi") << Token("x0") << Token("x0") << Token("0")};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(new PseudoInstruction(
- Token("mv"), {RegTok, RegTok}, PseudoExpandFunc(line, symbols) {
+ Token("mv"), {RegTok, RegTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("addi"), line.tokens.at(1), line.tokens.at(2), Token("0")}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("not"), {RegTok, RegTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("not"), {RegTok, RegTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("xori"), line.tokens.at(1), line.tokens.at(2), Token("-1")}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("neg"), {RegTok, RegTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("neg"), {RegTok, RegTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("sub"), line.tokens.at(1), Token("x0"), line.tokens.at(2)}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("seqz"), {RegTok, RegTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("seqz"), {RegTok, RegTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("sltiu"), line.tokens.at(1), line.tokens.at(2), Token("1")}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("snez"), {RegTok, RegTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("snez"), {RegTok, RegTok}, _PseudoExpandFunc(line) {
return LineTokensVec{ LineTokens{Token("sltu"), line.tokens.at(1), Token("x0"), line.tokens.at(2)}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("sltz"), {RegTok, RegTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("sltz"), {RegTok, RegTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("slt"), line.tokens.at(1), line.tokens.at(2), Token("x0")}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("sgtz"), {RegTok, RegTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("sgtz"), {RegTok, RegTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("slt"), line.tokens.at(1), Token("x0"), line.tokens.at(2)}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("beqz"), {RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("beqz"), {RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("beq"), line.tokens.at(1), Token("x0"), line.tokens.at(2)}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("bnez"), {RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("bnez"), {RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("bne"), line.tokens.at(1), Token("x0"), line.tokens.at(2)}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("blez"), {RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("blez"), {RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("bge"), Token("x0"), line.tokens.at(1), line.tokens.at(2)}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("bgez"), {RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("bgez"), {RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("bge"), line.tokens.at(1), Token("x0"), line.tokens.at(2)}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("bltz"), {RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("bltz"), {RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("blt"), line.tokens.at(1), Token("x0"), line.tokens.at(2)}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("bgtz"), {RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("bgtz"), {RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("blt"), Token("x0"), line.tokens.at(1), line.tokens.at(2)}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("bgt"), {RegTok, RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("bgt"), {RegTok, RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("blt"), line.tokens.at(2), line.tokens.at(1), line.tokens.at(3)}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("ble"), {RegTok, RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("ble"), {RegTok, RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("bge"), line.tokens.at(2), line.tokens.at(1), line.tokens.at(3)}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("bgtu"), {RegTok, RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("bgtu"), {RegTok, RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("bltu"), line.tokens.at(2), line.tokens.at(2), line.tokens.at(3)}};
})));
pseudoInstructions.push_back(std::shared_ptr<PseudoInstruction>(
- new PseudoInstruction(Token("bleu"), {RegTok, RegTok, ImmTok}, PseudoExpandFunc(line, symbols) {
+ new PseudoInstruction(Token("bleu"), {RegTok, RegTok, ImmTok}, _PseudoExpandFunc(line) {
return LineTokensVec{LineTokens{Token("bgeu"), line.tokens.at(2), line.tokens.at(2), line.tokens.at(3)}};
})));
// clang-format on
@@ -389,7 +391,7 @@ void RV32I_Assembler::enableExtM(const ISAInfo<ISA::RV32I>* isa, InstrVec& instr
instructions.push_back(RType(Token("remu"), 0b111, 0b0000001));
}
-void RV32I_Assembler::enableExtF(const ISAInfo<ISA::RV32I>* isa, InstrVec&, PseudoInstrVec&) const {
+void RV32I_Assembler::enableExtF(const ISAInfo<ISA::RV32I>*, InstrVec&, PseudoInstrVec&) const {
// Pseudo-op functors
// Assembler functors

MODIFY
src/cachesim/cacheconfigwidget.cpp
src/cachesim/cacheconfigwidget.cpp
@@ -98,9 +98,9 @@ void CacheConfigWidget::setupPresets() {
}
connect(m_ui->presets, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) {
- const CacheSim::CachePreset preset = qvariant_cast<CacheSim::CachePreset>(m_ui->presets->itemData(index));
+ const CacheSim::CachePreset _preset = qvariant_cast<CacheSim::CachePreset>(m_ui->presets->itemData(index));
m_justSetPreset = true;
- m_cache->setPreset(preset);
+ m_cache->setPreset(_preset);
});
}

MODIFY
src/cachesim/cacheplotwidget.cpp
src/cachesim/cacheplotwidget.cpp
@@ -243,7 +243,7 @@ std::map<CachePlotWidget::Variable, QList<QPoint>>
CachePlotWidget::gatherData(const std::vector<Variable>& types) const {
const auto& trace = m_cache.getAccessTrace();
- std::map<Variable, QList<QPoint>> data;
+ std::map<Variable, QList<QPoint>> cacheData;
// Transform variable vector to set (avoid duplicates)
std::set<Variable> varSet;
@@ -253,39 +253,39 @@ CachePlotWidget::gatherData(const std::vector<Variable>& types) const {
for (const auto& type : types) {
// Initialize all data types
- data[type];
+ cacheData[type];
}
// Gather data
for (const auto& entry : trace) {
if (varSet.count(Variable::Writes)) {
- data[Variable::Writes].append(QPoint(entry.first, entry.second.writes));
+ cacheData[Variable::Writes].append(QPoint(entry.first, entry.second.writes));
}
if (varSet.count(Variable::Reads)) {
- data[Variable::Reads].append(QPoint(entry.first, entry.second.reads));
+ cacheData[Variable::Reads].append(QPoint(entry.first, entry.second.reads));
}
if (varSet.count(Variable::Hits)) {
- data[Variable::Hits].append(QPoint(entry.first, entry.second.hits));
+ cacheData[Variable::Hits].append(QPoint(entry.first, entry.second.hits));
}
if (varSet.count(Variable::Misses)) {
- data[Variable::Misses].append(QPoint(entry.first, entry.second.misses));
+ cacheData[Variable::Misses].append(QPoint(entry.first, entry.second.misses));
}
if (varSet.count(Variable::Writebacks)) {
- data[Variable::Writebacks].append(QPoint(entry.first, entry.second.writebacks));
+ cacheData[Variable::Writebacks].append(QPoint(entry.first, entry.second.writebacks));
}
if (varSet.count(Variable::Accesses)) {
- data[Variable::Accesses].append(QPoint(entry.first, entry.second.hits + entry.second.misses));
+ cacheData[Variable::Accesses].append(QPoint(entry.first, entry.second.hits + entry.second.misses));
}
}
- return data;
+ return cacheData;
}
QChart* CachePlotWidget::createRatioPlot(const Variable num, const Variable den) const {
- const auto data = gatherData({num, den});
+ const auto cacheData = gatherData({num, den});
- const QList<QPoint>& numerator = data.at(num);
- const QList<QPoint>& denominator = data.at(den);
+ const QList<QPoint>& numerator = cacheData.at(num);
+ const QList<QPoint>& denominator = cacheData.at(den);
Q_ASSERT(numerator.size() == denominator.size());
@@ -344,9 +344,9 @@ QChart* CachePlotWidget::createStackedPlot(const std::vector<Variable>& variable
return nullptr;
}
- const auto data = gatherData(variables);
- const unsigned len = data.at(*variables.begin()).size();
- for (const auto& iter : data) {
+ const auto cacheData = gatherData(variables);
+ const unsigned len = cacheData.at(*variables.begin()).size();
+ for (const auto& iter : cacheData) {
Q_ASSERT(len == iter.second.size());
}
@@ -365,7 +365,7 @@ QChart* CachePlotWidget::createStackedPlot(const std::vector<Variable>& variable
QLineSeries* upperSeries = nullptr;
const unsigned maxX = ProcessorHandler::get()->getProcessor()->getCycleCount();
unsigned maxY = 0;
- for (const auto& variableData : data) {
+ for (const auto& variableData : cacheData) {
upperSeries = new QLineSeries(chart);
for (unsigned i = 0; i < len; i++) {
const auto& dataPoint = variableData.second.at(i);

MODIFY
src/cachesim/cacheview.cpp
src/cachesim/cacheview.cpp
@@ -20,9 +20,9 @@ void CacheView::mousePressEvent(QMouseEvent* event) {
// address was selected through the cache
for (const auto& item : items(event->pos())) {
if (auto* textItem = dynamic_cast<QGraphicsSimpleTextItem*>(item)) {
- const QVariant data = textItem->data(Qt::UserRole);
- if (data.isValid()) {
- emit cacheAddressSelected(data.toUInt());
+ const QVariant userData = textItem->data(Qt::UserRole);
+ if (userData.isValid()) {
+ emit cacheAddressSelected(userData.toUInt());
break;
}
}

MODIFY
src/cachesim/callout.cpp
src/cachesim/callout.cpp
@@ -101,7 +101,7 @@ void Callout::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, Q
painter->restore();
}
-void Callout::contextMenuEvent(QGraphicsSceneContextMenuEvent* event) {
+void Callout::contextMenuEvent(QGraphicsSceneContextMenuEvent*) {
m_view->deleteCallout(this);
}

MODIFY
src/cachesim/chartlinemarker.cpp
src/cachesim/chartlinemarker.cpp
@@ -52,7 +52,6 @@ QPointF ChartLineMarker::getMarkerPos() const {
void ChartLineMarker::move(const QPointF& center) {
if (m_snapToLine) {
- const QValueAxis* axisY = qobject_cast<QValueAxis*>(m_chart->axes(Qt::Vertical).first());
const QValueAxis* axisX = qobject_cast<QValueAxis*>(m_chart->axes(Qt::Horizontal).first());
// Note: we assume that the points are in a sorted order!

MODIFY
src/console.cpp
src/console.cpp
@@ -39,12 +39,12 @@ Console::Console(QWidget* parent) : QPlainTextEdit(parent) {
m_localEchoEnabled = RipesSettings::value(RIPES_SETTING_CONSOLEECHO).toBool();
}
-void Console::putData(const QByteArray& data) {
+void Console::putData(const QByteArray& bytes) {
// Text can always only be inserted at the end of the console
auto cursorAtEnd = QTextCursor(document());
cursorAtEnd.movePosition(QTextCursor::End);
setTextCursor(cursorAtEnd);
- insertPlainText(data);
+ insertPlainText(bytes);
QScrollBar* bar = verticalScrollBar();
bar->setValue(bar->maximum());

MODIFY
src/gotocombobox.cpp
src/gotocombobox.cpp
@@ -76,8 +76,8 @@ void GoToRegisterComboBox::addTargets() {
}
uint32_t GoToRegisterComboBox::addrForIndex(int i) {
- const auto& data = qvariant_cast<GoToUserData>(itemData(i));
- return ProcessorHandler::get()->getRegisterValue(RegisterFileType::GPR, data.arg);
+ const auto& regIdx = qvariant_cast<GoToUserData>(itemData(i));
+ return ProcessorHandler::get()->getRegisterValue(RegisterFileType::GPR, regIdx.arg);
}
} // namespace Ripes

MODIFY
src/programviewer.cpp
src/programviewer.cpp
@@ -213,7 +213,7 @@ QTextBlock ProgramViewer::blockForAddress(unsigned long addr) const {
}
high = std::next(low);
- auto validBlockRange = [this, adjustedLineNumber](auto& low, auto& high, long lineNumber) {
+ auto validBlockRange = [&] {
if (m_labelAddrOffsetMap.count(lineNumber))
return false;
@@ -226,7 +226,7 @@ QTextBlock ProgramViewer::blockForAddress(unsigned long addr) const {
};
// Adjust low and high iterators to locate the range bounds of the address
- while (!validBlockRange(low, high, lineNumber)) {
+ while (!validBlockRange()) {
low = m_labelAddrOffsetMap.lower_bound(lineNumber);
high = std::next(low);
lineNumber = low->first + 1;

MODIFY
src/settingsdialog.cpp
src/settingsdialog.cpp
@@ -287,12 +287,12 @@ void SettingsDialog::addPage(const QString& name, QWidget* page) {
m_ui->settingsList->addItem(item);
connect(m_ui->settingsList, &QListWidget::currentItemChanged, [=](QListWidgetItem* current, QListWidgetItem*) {
- const QString name = current->text();
- Q_ASSERT(m_pageIndex.count(name));
+ const QString _name = current->text();
+ Q_ASSERT(m_pageIndex.count(_name));
- const int index = m_pageIndex.at(name);
- m_ui->settingsPages->setCurrentIndex(index);
- RipesSettings::setValue(RIPES_SETTING_SETTING_TAB, index);
+ const int idx = m_pageIndex.at(_name);
+ m_ui->settingsPages->setCurrentIndex(idx);
+ RipesSettings::setValue(RIPES_SETTING_SETTING_TAB, idx);
});
}

Fix GCC-induced -Werror errors #80