refactor: use east const convention (#5409)

This change refactors the codebase to use the "east const convention", and adds a clang-format rule to follow this convention.
This commit is contained in:
Vito Tumas
2025-05-08 13:00:42 +02:00
committed by GitHub
parent 2db2791805
commit 3e152fec74
212 changed files with 812 additions and 795 deletions

View File

@@ -90,13 +90,13 @@ setSTAmountCanonicalizeSwitchover(bool v)
*getStaticSTAmountCanonicalizeSwitchover() = v;
}
static const std::uint64_t tenTo14 = 100000000000000ull;
static const std::uint64_t tenTo14m1 = tenTo14 - 1;
static const std::uint64_t tenTo17 = tenTo14 * 1000;
static std::uint64_t const tenTo14 = 100000000000000ull;
static std::uint64_t const tenTo14m1 = tenTo14 - 1;
static std::uint64_t const tenTo17 = tenTo14 * 1000;
//------------------------------------------------------------------------------
static std::int64_t
getInt64Value(STAmount const& amount, bool valid, const char* error)
getInt64Value(STAmount const& amount, bool valid, char const* error)
{
if (!valid)
Throw<std::runtime_error>(error);
@@ -680,9 +680,9 @@ STAmount::add(Serializer& s) const
}
bool
STAmount::isEquivalent(const STBase& t) const
STAmount::isEquivalent(STBase const& t) const
{
const STAmount* v = dynamic_cast<const STAmount*>(&t);
STAmount const* v = dynamic_cast<STAmount const*>(&t);
return v && (*v == *this);
}
@@ -1065,7 +1065,7 @@ amountFromJsonNoThrow(STAmount& result, Json::Value const& jvSource)
result = amountFromJson(sfGeneric, jvSource);
return true;
}
catch (const std::exception& e)
catch (std::exception const& e)
{
JLOG(debugLog().warn())
<< "amountFromJsonNoThrow: caught: " << e.what();