mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 16:56:48 +00:00
chore: Apply clang-format width 100 (#6387)
This commit is contained in:
@@ -50,7 +50,10 @@ STNumber::associateAsset(Asset const& a)
|
||||
{
|
||||
STTakesAsset::associateAsset(a);
|
||||
|
||||
XRPL_ASSERT_PARTS(getFName().shouldMeta(SField::sMD_NeedsAsset), "STNumber::associateAsset", "field needs asset");
|
||||
XRPL_ASSERT_PARTS(
|
||||
getFName().shouldMeta(SField::sMD_NeedsAsset),
|
||||
"STNumber::associateAsset",
|
||||
"field needs asset");
|
||||
|
||||
roundToAsset(a, value_);
|
||||
}
|
||||
@@ -94,7 +97,8 @@ STNumber::add(Serializer& s) const
|
||||
}
|
||||
|
||||
XRPL_ASSERT_PARTS(
|
||||
mantissa <= std::numeric_limits<std::int64_t>::max() && mantissa >= std::numeric_limits<std::int64_t>::min(),
|
||||
mantissa <= std::numeric_limits<std::int64_t>::max() &&
|
||||
mantissa >= std::numeric_limits<std::int64_t>::min(),
|
||||
"xrpl::STNumber::add",
|
||||
"mantissa in valid range");
|
||||
s.add64(mantissa);
|
||||
@@ -128,7 +132,8 @@ STNumber::move(std::size_t n, void* buf)
|
||||
bool
|
||||
STNumber::isEquivalent(STBase const& t) const
|
||||
{
|
||||
XRPL_ASSERT(t.getSType() == this->getSType(), "xrpl::STNumber::isEquivalent : field type match");
|
||||
XRPL_ASSERT(
|
||||
t.getSType() == this->getSType(), "xrpl::STNumber::isEquivalent : field type match");
|
||||
STNumber const& v = dynamic_cast<STNumber const&>(t);
|
||||
return value_ == v;
|
||||
}
|
||||
@@ -226,19 +231,22 @@ numberFromJson(SField const& field, Json::Value const& value)
|
||||
{
|
||||
parts = partsFromString(value.asString());
|
||||
|
||||
XRPL_ASSERT_PARTS(!getCurrentTransactionRules(), "xrpld::numberFromJson", "Not in a Transactor context");
|
||||
XRPL_ASSERT_PARTS(
|
||||
!getCurrentTransactionRules(), "xrpld::numberFromJson", "Not in a Transactor context");
|
||||
|
||||
// Number mantissas are much bigger than the allowable parsed values, so
|
||||
// it can't be out of range.
|
||||
static_assert(
|
||||
std::numeric_limits<std::uint64_t>::max() >= std::numeric_limits<decltype(parts.mantissa)>::max());
|
||||
std::numeric_limits<std::uint64_t>::max() >=
|
||||
std::numeric_limits<decltype(parts.mantissa)>::max());
|
||||
}
|
||||
else
|
||||
{
|
||||
Throw<std::runtime_error>("not a number");
|
||||
}
|
||||
|
||||
return STNumber{field, Number{parts.negative, parts.mantissa, parts.exponent, Number::normalized{}}};
|
||||
return STNumber{
|
||||
field, Number{parts.negative, parts.mantissa, parts.exponent, Number::normalized{}}};
|
||||
}
|
||||
|
||||
} // namespace xrpl
|
||||
|
||||
Reference in New Issue
Block a user