mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
chore: Set ColumnLimit to 120 in clang-format (#6288)
This change updates the ColumnLimit from 80 to 120, and applies clang-format to reformat the code.
This commit is contained in:
@@ -20,8 +20,7 @@
|
||||
namespace xrpl {
|
||||
|
||||
template <>
|
||||
STInteger<unsigned char>::STInteger(SerialIter& sit, SField const& name)
|
||||
: STInteger(name, sit.get8())
|
||||
STInteger<unsigned char>::STInteger(SerialIter& sit, SField const& name) : STInteger(name, sit.get8())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -44,8 +43,7 @@ STUInt8::getText() const
|
||||
return human;
|
||||
|
||||
// LCOV_EXCL_START
|
||||
JLOG(debugLog().error())
|
||||
<< "Unknown result code in metadata: " << value_;
|
||||
JLOG(debugLog().error()) << "Unknown result code in metadata: " << value_;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
@@ -64,8 +62,7 @@ STUInt8::getJson(JsonOptions) const
|
||||
return token;
|
||||
|
||||
// LCOV_EXCL_START
|
||||
JLOG(debugLog().error())
|
||||
<< "Unknown result code in metadata: " << value_;
|
||||
JLOG(debugLog().error()) << "Unknown result code in metadata: " << value_;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
@@ -75,8 +72,7 @@ STUInt8::getJson(JsonOptions) const
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template <>
|
||||
STInteger<std::uint16_t>::STInteger(SerialIter& sit, SField const& name)
|
||||
: STInteger(name, sit.get16())
|
||||
STInteger<std::uint16_t>::STInteger(SerialIter& sit, SField const& name) : STInteger(name, sit.get16())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -93,8 +89,7 @@ STUInt16::getText() const
|
||||
{
|
||||
if (getFName() == sfLedgerEntryType)
|
||||
{
|
||||
auto item = LedgerFormats::getInstance().findByType(
|
||||
safe_cast<LedgerEntryType>(value_));
|
||||
auto item = LedgerFormats::getInstance().findByType(safe_cast<LedgerEntryType>(value_));
|
||||
|
||||
if (item != nullptr)
|
||||
return item->getName();
|
||||
@@ -102,8 +97,7 @@ STUInt16::getText() const
|
||||
|
||||
if (getFName() == sfTransactionType)
|
||||
{
|
||||
auto item =
|
||||
TxFormats::getInstance().findByType(safe_cast<TxType>(value_));
|
||||
auto item = TxFormats::getInstance().findByType(safe_cast<TxType>(value_));
|
||||
|
||||
if (item != nullptr)
|
||||
return item->getName();
|
||||
@@ -118,8 +112,7 @@ STUInt16::getJson(JsonOptions) const
|
||||
{
|
||||
if (getFName() == sfLedgerEntryType)
|
||||
{
|
||||
auto item = LedgerFormats::getInstance().findByType(
|
||||
safe_cast<LedgerEntryType>(value_));
|
||||
auto item = LedgerFormats::getInstance().findByType(safe_cast<LedgerEntryType>(value_));
|
||||
|
||||
if (item != nullptr)
|
||||
return item->getName();
|
||||
@@ -127,8 +120,7 @@ STUInt16::getJson(JsonOptions) const
|
||||
|
||||
if (getFName() == sfTransactionType)
|
||||
{
|
||||
auto item =
|
||||
TxFormats::getInstance().findByType(safe_cast<TxType>(value_));
|
||||
auto item = TxFormats::getInstance().findByType(safe_cast<TxType>(value_));
|
||||
|
||||
if (item != nullptr)
|
||||
return item->getName();
|
||||
@@ -140,8 +132,7 @@ STUInt16::getJson(JsonOptions) const
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template <>
|
||||
STInteger<std::uint32_t>::STInteger(SerialIter& sit, SField const& name)
|
||||
: STInteger(name, sit.get32())
|
||||
STInteger<std::uint32_t>::STInteger(SerialIter& sit, SField const& name) : STInteger(name, sit.get32())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -158,8 +149,7 @@ STUInt32::getText() const
|
||||
{
|
||||
if (getFName() == sfPermissionValue)
|
||||
{
|
||||
auto const permissionName =
|
||||
Permission::getInstance().getPermissionName(value_);
|
||||
auto const permissionName = Permission::getInstance().getPermissionName(value_);
|
||||
if (permissionName)
|
||||
return *permissionName;
|
||||
}
|
||||
@@ -172,8 +162,7 @@ STUInt32::getJson(JsonOptions) const
|
||||
{
|
||||
if (getFName() == sfPermissionValue)
|
||||
{
|
||||
auto const permissionName =
|
||||
Permission::getInstance().getPermissionName(value_);
|
||||
auto const permissionName = Permission::getInstance().getPermissionName(value_);
|
||||
if (permissionName)
|
||||
return *permissionName;
|
||||
}
|
||||
@@ -184,8 +173,7 @@ STUInt32::getJson(JsonOptions) const
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template <>
|
||||
STInteger<std::uint64_t>::STInteger(SerialIter& sit, SField const& name)
|
||||
: STInteger(name, sit.get64())
|
||||
STInteger<std::uint64_t>::STInteger(SerialIter& sit, SField const& name) : STInteger(name, sit.get64())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -208,16 +196,10 @@ Json::Value
|
||||
STUInt64::getJson(JsonOptions) const
|
||||
{
|
||||
auto convertToString = [](uint64_t const value, int const base) {
|
||||
XRPL_ASSERT(
|
||||
base == 10 || base == 16,
|
||||
"xrpl::STUInt64::getJson : base 10 or 16");
|
||||
std::string str(
|
||||
base == 10 ? 20 : 16, 0); // Allocate space depending on base
|
||||
auto ret =
|
||||
std::to_chars(str.data(), str.data() + str.size(), value, base);
|
||||
XRPL_ASSERT(
|
||||
ret.ec == std::errc(),
|
||||
"xrpl::STUInt64::getJson : to_chars succeeded");
|
||||
XRPL_ASSERT(base == 10 || base == 16, "xrpl::STUInt64::getJson : base 10 or 16");
|
||||
std::string str(base == 10 ? 20 : 16, 0); // Allocate space depending on base
|
||||
auto ret = std::to_chars(str.data(), str.data() + str.size(), value, base);
|
||||
XRPL_ASSERT(ret.ec == std::errc(), "xrpl::STUInt64::getJson : to_chars succeeded");
|
||||
str.resize(std::distance(str.data(), ret.ptr));
|
||||
return str;
|
||||
};
|
||||
@@ -233,8 +215,7 @@ STUInt64::getJson(JsonOptions) const
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template <>
|
||||
STInteger<std::int32_t>::STInteger(SerialIter& sit, SField const& name)
|
||||
: STInteger(name, sit.get32())
|
||||
STInteger<std::int32_t>::STInteger(SerialIter& sit, SField const& name) : STInteger(name, sit.get32())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user