Skip to content

Commit b57d480

Browse files
committed
🧰 Fix compile warnings
1 parent 0b50d1b commit b57d480

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

‎src/Interpreter/interpreter.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,3 +470,5 @@ void Interpreter::report_overflow([[maybe_unused]] Module *m,
470470
m->memory.bytes + m->memory.pages * (uint32_t)PAGE_SIZE, maddr);
471471
sprintf(exception, "out of bounds memory access");
472472
}
473+
474+
Interpreter::~Interpreter() {}

‎src/Interpreter/interpreter.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class Interpreter {
5555

5656
static void report_overflow(Module *m, uint8_t *maddr);
5757

58+
virtual ~Interpreter();
5859
protected:
5960
private:
6061
};

‎src/Interpreter/proxied.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
void send_leb(Channel *channel, uint32_t value, const char *end = "") {
77
uint8_t *buffer = write_LEB(value);
88
uint32_t size = size_leb(value);
9-
for (int i = 0; i < size; ++i) {
9+
for (uint32_t i = 0; i < size; ++i) {
1010
channel->write("%02" PRIx8 "%s", buffer[i], end);
1111
}
1212
free(buffer);
1313
}
1414

15-
bool Proxied::store(Module *m, uint8_t type, uint32_t addr, StackValue &sval) {
15+
bool Proxied::store(Module *m, [[maybe_unused]] uint8_t type, uint32_t addr, StackValue &sval) {
1616
m->warduino->debugger->channel->write("%02" PRIx8, interruptStore);
1717
send_leb(m->warduino->debugger->channel, addr);
1818
send_leb(m->warduino->debugger->channel, 0);

‎src/Utils/util.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ uint32_t write_LEB_signed(uint8_t *dest, uint64_t val, uint64_t bits) {
8484
}
8585

8686
if ((val == 0 && static_cast<int8_t>(byte) >= 0) ||
87-
(val == -1 && static_cast<int8_t>(byte) < 0)) {
87+
(val == static_cast<uint64_t>(-1) && static_cast<int8_t>(byte) < 0)) {
8888
break;
8989
}
9090
byte |= 0x80;

0 commit comments

Comments
 (0)