mirror of
https://git.suyu.dev/suyu/sirit.git
synced 2026-01-01 20:25:23 +01:00
operand: Use pure virtual functions
This commit is contained in:
parent
4c2981eab5
commit
b4eeadfd9b
8 changed files with 39 additions and 51 deletions
|
|
@ -22,16 +22,16 @@ void LiteralNumber::Fetch(Stream& stream) const {
|
|||
}
|
||||
}
|
||||
|
||||
u16 LiteralNumber::GetWordCount() const {
|
||||
u16 LiteralNumber::GetWordCount() const noexcept {
|
||||
return is_32 ? 1 : 2;
|
||||
}
|
||||
|
||||
bool LiteralNumber::operator==(const Operand& other) const {
|
||||
if (GetType() == other.GetType()) {
|
||||
const auto& o{static_cast<const LiteralNumber&>(other)};
|
||||
return o.raw == raw && o.is_32 == is_32;
|
||||
bool LiteralNumber::operator==(const Operand& other) const noexcept {
|
||||
if (!EqualType(other)) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
const auto& o{static_cast<const LiteralNumber&>(other)};
|
||||
return o.raw == raw && o.is_32 == is_32;
|
||||
}
|
||||
|
||||
} // namespace Sirit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue