mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-24 15:40:26 +00:00
Merge remote-tracking branch 'XRPLF/develop' into ximinez/number-maxint-range
* XRPLF/develop: chore: Enable modernize-use-auto (7707) build: Add protobuf dependencies to Nix (7706) feat: Enable ConfidentialTransfer and BatchV1_1 (7698) chore: Enable modernize-unary-static-assert (7705) chore: Make clang-tidy happy on macOS (7701) chore: Improve pre-commit hooks (7702)
This commit is contained in:
@@ -199,7 +199,7 @@ struct MantissaRange final
|
||||
rep const internalMin{getInternalMin(scale, log)};
|
||||
CuspRoundingFix const cuspRoundingFixEnabled{isCuspFixEnabled(scale)};
|
||||
|
||||
static MantissaRange const&
|
||||
static constexpr MantissaRange const&
|
||||
getMantissaRange(MantissaScale scale);
|
||||
|
||||
static std::set<MantissaScale> const&
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
//
|
||||
|
||||
static constexpr std::size_t kBytes = Bits / 8;
|
||||
static_assert(sizeof(data_) == kBytes, "");
|
||||
static_assert(sizeof(data_) == kBytes);
|
||||
|
||||
using size_type = std::size_t;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
|
||||
@@ -26,7 +26,7 @@ template <class T>
|
||||
inline void
|
||||
reverseBytes(T& t)
|
||||
{
|
||||
unsigned char* bytes =
|
||||
auto* bytes =
|
||||
static_cast<unsigned char*>(std::memmove(std::addressof(t), std::addressof(t), sizeof(T)));
|
||||
for (unsigned i = 0; i < sizeof(T) / 2; ++i)
|
||||
std::swap(bytes[i], bytes[sizeof(T) - 1 - i]);
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <typeindex>
|
||||
#include <unordered_set>
|
||||
#include <string> // IWYU pragma: keep
|
||||
#include <typeindex> // IWYU pragma: keep
|
||||
#include <unordered_set> // IWYU pragma: keep
|
||||
|
||||
namespace beast::unit_test {
|
||||
|
||||
|
||||
@@ -108,12 +108,12 @@ public:
|
||||
};
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
static_assert(!std::is_default_constructible_v<Sink>, "");
|
||||
static_assert(!std::is_copy_constructible_v<Sink>, "");
|
||||
static_assert(!std::is_move_constructible_v<Sink>, "");
|
||||
static_assert(!std::is_copy_assignable_v<Sink>, "");
|
||||
static_assert(!std::is_move_assignable_v<Sink>, "");
|
||||
static_assert(std::is_nothrow_destructible_v<Sink>, "");
|
||||
static_assert(!std::is_default_constructible_v<Sink>);
|
||||
static_assert(!std::is_copy_constructible_v<Sink>);
|
||||
static_assert(!std::is_move_constructible_v<Sink>);
|
||||
static_assert(!std::is_copy_assignable_v<Sink>);
|
||||
static_assert(!std::is_move_assignable_v<Sink>);
|
||||
static_assert(std::is_nothrow_destructible_v<Sink>);
|
||||
#endif
|
||||
|
||||
/** Returns a Sink which does nothing. */
|
||||
@@ -164,12 +164,12 @@ public:
|
||||
};
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
static_assert(!std::is_default_constructible_v<ScopedStream>, "");
|
||||
static_assert(std::is_copy_constructible_v<ScopedStream>, "");
|
||||
static_assert(std::is_move_constructible_v<ScopedStream>, "");
|
||||
static_assert(!std::is_copy_assignable_v<ScopedStream>, "");
|
||||
static_assert(!std::is_move_assignable_v<ScopedStream>, "");
|
||||
static_assert(std::is_nothrow_destructible_v<ScopedStream>, "");
|
||||
static_assert(!std::is_default_constructible_v<ScopedStream>);
|
||||
static_assert(std::is_copy_constructible_v<ScopedStream>);
|
||||
static_assert(std::is_move_constructible_v<ScopedStream>);
|
||||
static_assert(!std::is_copy_assignable_v<ScopedStream>);
|
||||
static_assert(!std::is_move_assignable_v<ScopedStream>);
|
||||
static_assert(std::is_nothrow_destructible_v<ScopedStream>);
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -246,12 +246,12 @@ public:
|
||||
};
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
static_assert(std::is_default_constructible_v<Stream>, "");
|
||||
static_assert(std::is_copy_constructible_v<Stream>, "");
|
||||
static_assert(std::is_move_constructible_v<Stream>, "");
|
||||
static_assert(!std::is_copy_assignable_v<Stream>, "");
|
||||
static_assert(!std::is_move_assignable_v<Stream>, "");
|
||||
static_assert(std::is_nothrow_destructible_v<Stream>, "");
|
||||
static_assert(std::is_default_constructible_v<Stream>);
|
||||
static_assert(std::is_copy_constructible_v<Stream>);
|
||||
static_assert(std::is_move_constructible_v<Stream>);
|
||||
static_assert(!std::is_copy_assignable_v<Stream>);
|
||||
static_assert(!std::is_move_assignable_v<Stream>);
|
||||
static_assert(std::is_nothrow_destructible_v<Stream>);
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -329,12 +329,12 @@ public:
|
||||
};
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
static_assert(!std::is_default_constructible_v<Journal>, "");
|
||||
static_assert(std::is_copy_constructible_v<Journal>, "");
|
||||
static_assert(std::is_move_constructible_v<Journal>, "");
|
||||
static_assert(std::is_copy_assignable_v<Journal>, "");
|
||||
static_assert(std::is_move_assignable_v<Journal>, "");
|
||||
static_assert(std::is_nothrow_destructible_v<Journal>, "");
|
||||
static_assert(!std::is_default_constructible_v<Journal>);
|
||||
static_assert(std::is_copy_constructible_v<Journal>);
|
||||
static_assert(std::is_move_constructible_v<Journal>);
|
||||
static_assert(std::is_copy_assignable_v<Journal>);
|
||||
static_assert(std::is_move_assignable_v<Journal>);
|
||||
static_assert(std::is_nothrow_destructible_v<Journal>);
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -14,7 +14,7 @@ rngfill(void* const buffer, std::size_t const bytes, Generator& g)
|
||||
using result_type = Generator::result_type;
|
||||
constexpr std::size_t kResultSize = sizeof(result_type);
|
||||
|
||||
std::uint8_t* const bufferStart = static_cast<std::uint8_t*>(buffer);
|
||||
auto* const bufferStart = static_cast<std::uint8_t*>(buffer);
|
||||
std::size_t const completeIterations = bytes / kResultSize;
|
||||
std::size_t const bytesRemaining = bytes % kResultSize;
|
||||
|
||||
@@ -42,7 +42,7 @@ rngfill(std::array<std::uint8_t, N>& a, Generator& g)
|
||||
{
|
||||
using result_type = Generator::result_type;
|
||||
auto i = N / sizeof(result_type);
|
||||
result_type* p = reinterpret_cast<result_type*>(a.data());
|
||||
auto* p = reinterpret_cast<result_type*>(a.data());
|
||||
while (i--)
|
||||
*p++ = g();
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
[[nodiscard]] JobTypeInfo const&
|
||||
get(JobType jt) const
|
||||
{
|
||||
Map::const_iterator const iter(map.find(jt));
|
||||
auto const iter = map.find(jt);
|
||||
XRPL_ASSERT(iter != map.end(), "xrpl::JobTypes::get : valid input");
|
||||
|
||||
if (iter != map.end())
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <xrpl/beast/utility/instrumentation.h>
|
||||
#include <xrpl/ledger/ReadView.h>
|
||||
#include <xrpl/protocol/AccountID.h>
|
||||
#include <xrpl/protocol/Issue.h>
|
||||
#include <xrpl/protocol/Issue.h> // IWYU pragma: keep
|
||||
#include <xrpl/protocol/Keylet.h>
|
||||
#include <xrpl/protocol/LedgerFormats.h>
|
||||
#include <xrpl/protocol/MPTIssue.h>
|
||||
|
||||
@@ -141,7 +141,7 @@ template <class Base>
|
||||
class CachedView : public detail::CachedViewImpl
|
||||
{
|
||||
private:
|
||||
static_assert(std::is_base_of_v<DigestAwareReadView, Base>, "");
|
||||
static_assert(std::is_base_of_v<DigestAwareReadView, Base>);
|
||||
|
||||
std::shared_ptr<Base const> sp_;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <xrpl/ledger/detail/ReadViewFwdRange.h>
|
||||
#include <xrpl/protocol/AccountID.h>
|
||||
#include <xrpl/protocol/Fees.h>
|
||||
#include <xrpl/protocol/Issue.h>
|
||||
#include <xrpl/protocol/Issue.h> // IWYU pragma: keep
|
||||
#include <xrpl/protocol/Keylet.h>
|
||||
#include <xrpl/protocol/LedgerHeader.h>
|
||||
#include <xrpl/protocol/MPTIssue.h>
|
||||
|
||||
@@ -108,8 +108,8 @@ public:
|
||||
std::optional<value_type> mutable cache_;
|
||||
};
|
||||
|
||||
static_assert(std::is_nothrow_move_constructible<Iterator>{}, "");
|
||||
static_assert(std::is_nothrow_move_assignable<Iterator>{}, "");
|
||||
static_assert(std::is_nothrow_move_constructible<Iterator>{});
|
||||
static_assert(std::is_nothrow_move_assignable<Iterator>{});
|
||||
|
||||
using const_iterator = Iterator;
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ escrowUnlockApplyHelper<Issue>(
|
||||
bool createAsset,
|
||||
beast::Journal journal)
|
||||
{
|
||||
Issue const& issue = amount.get<Issue>();
|
||||
auto const& issue = amount.get<Issue>();
|
||||
Keylet const trustLineKey = keylet::trustLine(receiver, issue);
|
||||
bool const recvLow = issuer > receiver;
|
||||
bool const senderIssuer = issuer == sender;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <xrpl/ledger/ApplyView.h>
|
||||
#include <xrpl/ledger/ReadView.h>
|
||||
#include <xrpl/protocol/Asset.h>
|
||||
#include <xrpl/protocol/LedgerFormats.h>
|
||||
#include <xrpl/protocol/LedgerFormats.h> // IWYU pragma: keep
|
||||
#include <xrpl/protocol/Protocol.h>
|
||||
#include <xrpl/protocol/Rules.h>
|
||||
#include <xrpl/protocol/SField.h>
|
||||
|
||||
@@ -62,7 +62,7 @@ lz4Compress(void const* in, std::size_t inSize, BufferFactory&& bf)
|
||||
std::array<std::uint8_t, varint_traits<std::size_t>::kMax> vi{};
|
||||
auto const n = writeVarint(vi.data(), inSize);
|
||||
auto const outMax = LZ4_compressBound(inSize);
|
||||
std::uint8_t* out = reinterpret_cast<std::uint8_t*>(bf(n + outMax));
|
||||
auto* out = reinterpret_cast<std::uint8_t*>(bf(n + outMax));
|
||||
result.first = out;
|
||||
std::memcpy(out, vi.data(), n);
|
||||
auto const outSize = LZ4_compress_default(
|
||||
@@ -90,7 +90,7 @@ nodeobjectDecompress(void const* in, std::size_t inSize, BufferFactory&& bf)
|
||||
{
|
||||
using namespace nudb::detail;
|
||||
|
||||
std::uint8_t const* p = reinterpret_cast<std::uint8_t const*>(in);
|
||||
auto const* p = reinterpret_cast<std::uint8_t const*>(in);
|
||||
std::size_t type = 0;
|
||||
auto const vn = readVarint(p, inSize, type);
|
||||
if (vn == 0)
|
||||
@@ -237,7 +237,7 @@ nodeobjectCompress(void const* in, std::size_t inSize, BufferFactory&& bf)
|
||||
auto const vs = sizeVarint(type);
|
||||
result.second = vs + field<std::uint16_t>::size + // mask
|
||||
(n * 32); // hashes
|
||||
std::uint8_t* out = reinterpret_cast<std::uint8_t*>(bf(result.second));
|
||||
auto* out = reinterpret_cast<std::uint8_t*>(bf(result.second));
|
||||
result.first = out;
|
||||
ostream os(out, result.second);
|
||||
write<varint>(os, type);
|
||||
@@ -249,7 +249,7 @@ nodeobjectCompress(void const* in, std::size_t inSize, BufferFactory&& bf)
|
||||
auto const type = 3U;
|
||||
auto const vs = sizeVarint(type);
|
||||
result.second = vs + (n * 32); // hashes
|
||||
std::uint8_t* out = reinterpret_cast<std::uint8_t*>(bf(result.second));
|
||||
auto* out = reinterpret_cast<std::uint8_t*>(bf(result.second));
|
||||
result.first = out;
|
||||
ostream os(out, result.second);
|
||||
write<varint>(os, type);
|
||||
|
||||
@@ -39,7 +39,7 @@ readVarint(void const* buf, std::size_t buflen, std::size_t& t)
|
||||
if (buflen == 0)
|
||||
return 0;
|
||||
t = 0;
|
||||
std::uint8_t const* p = reinterpret_cast<std::uint8_t const*>(buf);
|
||||
auto const* p = reinterpret_cast<std::uint8_t const*>(buf);
|
||||
std::size_t n = 0;
|
||||
while (p[n] & 0x80)
|
||||
{
|
||||
@@ -86,7 +86,7 @@ std::size_t
|
||||
writeVarint(void* p0, std::size_t v)
|
||||
{
|
||||
// NOLINTNEXTLINE(misc-const-correctness)
|
||||
std::uint8_t* p = reinterpret_cast<std::uint8_t*>(p0);
|
||||
auto* p = reinterpret_cast<std::uint8_t*>(p0);
|
||||
do
|
||||
{
|
||||
std::uint8_t d = v % 127;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <xrpl/protocol/XRPAmount.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <limits> // IWYU pragma: keep
|
||||
#include <stdexcept>
|
||||
#include <type_traits>
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ public:
|
||||
auto const maxVMantissa = mantissa(maxV);
|
||||
auto const expDiff = exponent(maxV) - exponent(minV);
|
||||
|
||||
double const minVD = static_cast<double>(minVMantissa);
|
||||
auto const minVD = static_cast<double>(minVMantissa);
|
||||
double const maxVD =
|
||||
(expDiff != 0) ? maxVMantissa * pow(10, expDiff) : static_cast<double>(maxVMantissa);
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ template <int Bits>
|
||||
bool
|
||||
STBitString<Bits>::isEquivalent(STBase const& t) const
|
||||
{
|
||||
STBitString const* v = dynamic_cast<STBitString const*>(&t);
|
||||
auto const* v = dynamic_cast<STBitString const*>(&t);
|
||||
return v && (value_ == v->value_);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ template <typename Integer>
|
||||
inline bool
|
||||
STInteger<Integer>::isEquivalent(STBase const& t) const
|
||||
{
|
||||
STInteger const* v = dynamic_cast<STInteger const*>(&t);
|
||||
auto const* v = dynamic_cast<STInteger const*>(&t);
|
||||
return v && (value_ == v->value_);
|
||||
}
|
||||
|
||||
|
||||
@@ -1241,7 +1241,7 @@ template <typename T, typename V>
|
||||
void
|
||||
STObject::setFieldUsingSetValue(SField const& field, V value)
|
||||
{
|
||||
static_assert(!std::is_lvalue_reference_v<V>, "");
|
||||
static_assert(!std::is_lvalue_reference_v<V>);
|
||||
|
||||
STBase* rf = getPField(field, true);
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ public:
|
||||
template <int N>
|
||||
explicit SerialIter(std::uint8_t const (&data)[N]) : SerialIter(&data[0], N)
|
||||
{
|
||||
static_assert(N > 0, "");
|
||||
static_assert(N > 0);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
// Add new amendments to the top of this list.
|
||||
// Keep it sorted in reverse chronological order.
|
||||
|
||||
XRPL_FEATURE(BatchV1_1, Supported::No, VoteBehavior::DefaultNo)
|
||||
XRPL_FEATURE(BatchV1_1, Supported::Yes, VoteBehavior::DefaultNo)
|
||||
XRPL_FEATURE(LendingProtocolV1_1, Supported::No, VoteBehavior::DefaultNo)
|
||||
XRPL_FEATURE(ConfidentialTransfer, Supported::No, VoteBehavior::DefaultNo)
|
||||
XRPL_FEATURE(ConfidentialTransfer, Supported::Yes, VoteBehavior::DefaultNo)
|
||||
XRPL_FIX (Cleanup3_3_0, Supported::Yes, VoteBehavior::DefaultNo)
|
||||
XRPL_FIX (Cleanup3_2_0, Supported::Yes, VoteBehavior::DefaultNo)
|
||||
XRPL_FEATURE(MPTokensV2, Supported::No, VoteBehavior::DefaultNo)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <xrpl/protocol/MPTAmount.h> // IWYU pragma: keep
|
||||
#include <xrpl/protocol/XRPAmount.h>
|
||||
|
||||
#include <ostream>
|
||||
#include <ostream> // IWYU pragma: keep
|
||||
#include <stdexcept>
|
||||
#include <variant>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user