build: Update for software defined 128 bit types

This commit is contained in:
WerWolv
2025-01-29 21:37:41 +01:00
parent e981eff1e6
commit 803ebe34ed
30 changed files with 112 additions and 117 deletions

View File

@@ -77,17 +77,17 @@ namespace hex::plugin::builtin {
case Unit::Unitless:
case Unit::Decimal:
if (isInteger)
return hex::format("{0}", value / multipler);
return hex::format("{0}", i64(value / multipler));
else
return hex::format("{0:.3f}", value / multipler);
return hex::format("{0:.3f}", double(value / multipler));
case Unit::Hexadecimal:
return hex::format("0x{0:x}", u128(value / multipler));
return hex::format("0x{0:x}", u64(value / multipler));
case Unit::Binary:
return hex::format("0b{0:b}", u128(value / multipler));
return hex::format("0b{0:b}", u64(value / multipler));
case Unit::Octal:
return hex::format("0o{0:o}", u128(value / multipler));
return hex::format("0o{0:o}", u64(value / multipler));
case Unit::Bytes:
return hex::format("{0}", u128(value / multipler));
return hex::format("{0}", u64(value / multipler));
default:
return "hex.builtin.command.convert.invalid_conversion"_lang;
}
@@ -100,17 +100,17 @@ namespace hex::plugin::builtin {
case Unit::Bits:
case Unit::Decimal:
if (isInteger)
return hex::format("{0}", value / multipler);
return hex::format("{0}", i64(value / multipler));
else
return hex::format("{0:.3f}", value / multipler);
return hex::format("{0:.3f}", double(value / multipler));
case Unit::Hexadecimal:
return hex::format("0x{0:x}", u128(value / multipler));
return hex::format("0x{0:x}", u64(value / multipler));
case Unit::Binary:
return hex::format("0b{0:b}", u128(value / multipler));
return hex::format("0b{0:b}", u64(value / multipler));
case Unit::Octal:
return hex::format("0o{0:o}", u128(value / multipler));
return hex::format("0o{0:o}", u64(value / multipler));
case Unit::Bytes:
return hex::format("{0}", u128((value / multipler) / 8));
return hex::format("{0}", u64((value / multipler) / 8));
default:
return "hex.builtin.command.convert.invalid_conversion"_lang;
}
@@ -123,17 +123,17 @@ namespace hex::plugin::builtin {
case Unit::Bytes:
case Unit::Decimal:
if (isInteger)
return hex::format("{0}", value / multipler);
return hex::format("{0}", i64(value / multipler));
else
return hex::format("{0:.3f}", value / multipler);
return hex::format("{0:.3f}", double(value / multipler));
case Unit::Hexadecimal:
return hex::format("0x{0:x}", u128(value / multipler));
return hex::format("0x{0:x}", u64(value / multipler));
case Unit::Binary:
return hex::format("0b{0:b}", u128(value / multipler));
return hex::format("0b{0:b}", u64(value / multipler));
case Unit::Octal:
return hex::format("0o{0:o}", u128(value / multipler));
return hex::format("0o{0:o}", u64(value / multipler));
case Unit::Bits:
return hex::format("{0}", u128((value / multipler) * 8));
return hex::format("{0}", u64((value / multipler) * 8));
default:
return "hex.builtin.command.convert.invalid_conversion"_lang;
}