diff options
author | Karel Kočí <cynerd@email.cz> | 2017-12-17 00:15:38 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-12-17 00:15:38 +0100 |
commit | 7fa050ddefca5373b09bdbcbb3aa0902eacd5d2f (patch) | |
tree | c3c8e4201e72d73f452a5a0c05aa126979872ec7 /qtmips_machine | |
parent | d99ab62f0a0d166fea658dab14f37812c45aaec3 (diff) | |
download | qtmips-7fa050ddefca5373b09bdbcbb3aa0902eacd5d2f.tar.gz qtmips-7fa050ddefca5373b09bdbcbb3aa0902eacd5d2f.tar.bz2 qtmips-7fa050ddefca5373b09bdbcbb3aa0902eacd5d2f.zip |
Revert "Suppress some warning"
This reverts commit 5bf637a429bbcf09092b8d189010c50d61c3562f.
Diffstat (limited to 'qtmips_machine')
-rw-r--r-- | qtmips_machine/alu.cpp | 4 | ||||
-rw-r--r-- | qtmips_machine/instruction.cpp | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/qtmips_machine/alu.cpp b/qtmips_machine/alu.cpp index 73c49e4..d6e7254 100644 --- a/qtmips_machine/alu.cpp +++ b/qtmips_machine/alu.cpp @@ -40,13 +40,13 @@ std::uint32_t alu_operate(enum AluOp operation, std::uint32_t s, std::uint32_t t case ALU_OP_ADD: if (s > (0xFFFFFFFF - t)) throw QTMIPS_EXCEPTION(Overflow, "ADD operation overflow/underflow", QString::number(s) + QString(" + ") + QString::number(t)); - __attribute__((fallthrough)); + // Intentional falltrough case ALU_OP_ADDU: return s + t; case ALU_OP_SUB: if (s < t) throw QTMIPS_EXCEPTION(Overflow, "SUB operation overflow/underflow", QString::number(s) + QString(" - ") + QString::number(t)); - __attribute__((fallthrough)); + // Intentional falltrough case ALU_OP_SUBU: return s - t; case ALU_OP_AND: diff --git a/qtmips_machine/instruction.cpp b/qtmips_machine/instruction.cpp index 4137fdd..b6abebc 100644 --- a/qtmips_machine/instruction.cpp +++ b/qtmips_machine/instruction.cpp @@ -67,7 +67,9 @@ Instruction::Instruction(std::uint8_t opcode, std::uint32_t address) { this->dt |= address; } -Instruction::Instruction(const Instruction &i) : Instruction(i.data()) { } +Instruction::Instruction(const Instruction &i) { + this->dt = i.data(); +} QString Instruction::to_str() { if (this->opcode() >= sizeof(instruction_map)) |