Fixed missing 0x when printing signed hex in some places.

This commit is contained in:
2021-01-11 16:59:22 +00:00
parent e29c3ed4e0
commit cc44af744c
3 changed files with 3 additions and 3 deletions

View File

@@ -133,6 +133,6 @@ impl InstFmt for Inst {
let Self { dst, src, offset, kind } = self;
let mnemonic = kind.mnemonic();
write!(f, "{mnemonic} {dst}, {}({src})", SignedHex(offset))
write!(f, "{mnemonic} {dst}, {:#}({src})", SignedHex(offset))
}
}

View File

@@ -120,6 +120,6 @@ impl InstFmt for Inst {
let Self { dst, src, offset, kind } = self;
let mnemonic = kind.mnemonic();
write!(f, "{mnemonic} {dst}, {}({src})", SignedHex(offset))
write!(f, "{mnemonic} {dst}, {:#}({src})", SignedHex(offset))
}
}

View File

@@ -50,7 +50,7 @@ impl Kind {
Self::Address(address) => write!(f, "{address:#x}"),
Self::Word(value) => write!(f, "{value:#x}"),
Self::HalfWordUnsigned(value) => write!(f, "{value:#x}"),
Self::HalfWordSigned(value) => write!(f, "{}", SignedHex(value)),
Self::HalfWordSigned(value) => write!(f, "{:#}", SignedHex(value)),
})
}
}