1
Fork 0

interpret: simplify pointer arithmetic logic

This commit is contained in:
Ralf Jung 2024-08-01 10:19:13 +02:00
parent de78cb56b2
commit 5d5c97aad7
27 changed files with 73 additions and 187 deletions

View file

@ -309,11 +309,7 @@ fn report_bin_hex_error(
) {
let (t, actually) = match ty {
attr::IntType::SignedInt(t) => {
let actually = if negative {
-(size.sign_extend(val) as i128)
} else {
size.sign_extend(val) as i128
};
let actually = if negative { -(size.sign_extend(val)) } else { size.sign_extend(val) };
(t.name_str(), actually.to_string())
}
attr::IntType::UnsignedInt(t) => {