mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-24 23:50:22 +00:00
Merge branch 'develop' into vlntb/mem-leak-ledger-history-3
This commit is contained in:
10
.clang-tidy
10
.clang-tidy
@@ -45,20 +45,10 @@ Checks: "-*,
|
||||
llvm-namespace-comment,
|
||||
|
||||
misc-*,
|
||||
-misc-anonymous-namespace-in-header,
|
||||
-misc-confusable-identifiers,
|
||||
-misc-coroutine-hostile-raii,
|
||||
-misc-misleading-bidirectional,
|
||||
-misc-misleading-identifier,
|
||||
-misc-multiple-inheritance,
|
||||
-misc-new-delete-overloads,
|
||||
-misc-no-recursion,
|
||||
-misc-non-copyable-objects,
|
||||
-misc-non-private-member-variables-in-classes,
|
||||
-misc-override-with-different-visibility,
|
||||
-misc-predictable-rand,
|
||||
-misc-unconventional-assign-operator,
|
||||
-misc-uniqueptr-reset-release,
|
||||
-misc-unused-parameters,
|
||||
-misc-use-anonymous-namespace,
|
||||
-misc-use-internal-linkage,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <xrpl/beast/utility/instrumentation.h> // IWYU pragma: keep
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace xrpl {
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
operator=(NodePtr node)
|
||||
{
|
||||
node_ = node;
|
||||
return static_cast<LockFreeStackIterator&>(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
LockFreeStackIterator&
|
||||
|
||||
@@ -49,6 +49,11 @@ public:
|
||||
impl_->set(value);
|
||||
}
|
||||
|
||||
// This is a write-through handle: assignment sets the value of the
|
||||
// referenced metric. It is const-qualified and returns Gauge const&
|
||||
// (a non-const Gauge& would require a const_cast), so it does not follow
|
||||
// the conventional assignment-operator signature.
|
||||
// NOLINTNEXTLINE(misc-unconventional-assign-operator)
|
||||
Gauge const&
|
||||
operator=(value_type value) const
|
||||
{
|
||||
|
||||
@@ -26,9 +26,7 @@ struct Zero
|
||||
explicit Zero() = default;
|
||||
};
|
||||
|
||||
namespace {
|
||||
constexpr Zero kZero{};
|
||||
} // namespace
|
||||
inline constexpr Zero kZero{};
|
||||
|
||||
/** Default implementation of signum calls the method on the class. */
|
||||
template <typename T>
|
||||
|
||||
@@ -555,7 +555,11 @@ public:
|
||||
ValueProxy&
|
||||
operator=(ValueProxy const&) = delete;
|
||||
|
||||
// Write-through proxy: assignment sets the referenced field to the given
|
||||
// value, so it intentionally takes the assigned value rather than a
|
||||
// ValueProxy.
|
||||
template <class U>
|
||||
// NOLINTNEXTLINE(misc-unconventional-assign-operator)
|
||||
ValueProxy&
|
||||
operator=(U&& u)
|
||||
requires(std::is_assignable_v<T, U>);
|
||||
@@ -800,6 +804,7 @@ STObject::Proxy<T>::assign(U&& u)
|
||||
|
||||
template <class T>
|
||||
template <class U>
|
||||
// NOLINTNEXTLINE(misc-unconventional-assign-operator)
|
||||
STObject::ValueProxy<T>&
|
||||
STObject::ValueProxy<T>::operator=(U&& u)
|
||||
requires(std::is_assignable_v<T, U>)
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <xrpl/basics/Slice.h>
|
||||
#include <xrpl/basics/base_uint.h>
|
||||
#include <xrpl/basics/random.h>
|
||||
#include <xrpl/beast/net/IPAddress.h>
|
||||
#include <xrpl/beast/net/IPEndpoint.h>
|
||||
#include <xrpl/beast/unit_test/suite.h>
|
||||
@@ -452,7 +453,7 @@ struct TestPeerSet : public PeerSet
|
||||
dropRate = 100;
|
||||
}
|
||||
|
||||
if (((rand() % 100) + 1) <= dropRate)
|
||||
if (randInt(1, 100) <= dropRate)
|
||||
return;
|
||||
|
||||
switch (type)
|
||||
|
||||
@@ -1094,6 +1094,7 @@ public:
|
||||
XRPAmount const xrp0{0};
|
||||
Number const n0 = xrp0;
|
||||
BEAST_EXPECT(n0 == Number{0});
|
||||
// NOLINTNEXTLINE(misc-confusable-identifiers)
|
||||
XRPAmount const xrp1{n0};
|
||||
BEAST_EXPECT(xrp1 == xrp0);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <xrpl/basics/Number.h>
|
||||
#include <xrpl/basics/base_uint.h>
|
||||
#include <xrpl/basics/random.h>
|
||||
#include <xrpl/beast/unit_test/suite.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
@@ -16,7 +17,7 @@
|
||||
#include <xrpl/protocol/SField.h>
|
||||
#include <xrpl/protocol/jss.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
@@ -173,7 +174,7 @@ public:
|
||||
Oracle const oracle(
|
||||
env,
|
||||
{.owner = owner,
|
||||
.documentID = rand(),
|
||||
.documentID = randInt<std::uint32_t>(),
|
||||
.series = {{"XRP", "USD", 740 + i, 1}, {"XRP", "EUR", 740, 1}},
|
||||
.fee = baseFee});
|
||||
oracles.emplace_back(owner, oracle.documentID());
|
||||
|
||||
Reference in New Issue
Block a user