mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
chore: Enable most clang-tidy bugprone checks (#6929)
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
This commit is contained in:
@@ -265,7 +265,7 @@ inline Scheduler::queue_type::~queue_type()
|
||||
auto e = &*iter;
|
||||
++iter;
|
||||
e->~event();
|
||||
alloc_->deallocate(e, sizeof(e));
|
||||
alloc_->deallocate(e, sizeof(e)); // NOLINT(bugprone-sizeof-expression)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -452,7 +452,7 @@ private:
|
||||
bool ssl;
|
||||
|
||||
lambda(int id_, TrustedPublisherServer& self_, socket_type&& sock_, bool ssl_)
|
||||
: id(id_), self(self_), sock(std::move(sock_)), work(sock_.get_executor()), ssl(ssl_)
|
||||
: id(id_), self(self_), sock(std::move(sock_)), work(sock.get_executor()), ssl(ssl_)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -75,9 +75,10 @@ public:
|
||||
return hotTRANSACTION_NODE;
|
||||
case 3:
|
||||
return hotUNKNOWN;
|
||||
default:
|
||||
// will never happen, but make static analysis tool happy.
|
||||
return hotUNKNOWN;
|
||||
}
|
||||
// will never happen, but make static analysis tool happy.
|
||||
return hotUNKNOWN;
|
||||
}();
|
||||
|
||||
uint256 hash;
|
||||
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
parallel_for(std::size_t const n, std::size_t number_of_threads, Args const&... args)
|
||||
{
|
||||
std::atomic<std::size_t> c(0);
|
||||
std::vector<beast::unit_test::thread> t;
|
||||
std::vector<beast::unit_test::Thread> t;
|
||||
t.reserve(number_of_threads);
|
||||
for (std::size_t id = 0; id < number_of_threads; ++id)
|
||||
t.emplace_back(*this, parallel_for_lambda<Body>(n, c), args...);
|
||||
@@ -224,7 +224,7 @@ public:
|
||||
parallel_for_id(std::size_t const n, std::size_t number_of_threads, Args const&... args)
|
||||
{
|
||||
std::atomic<std::size_t> c(0);
|
||||
std::vector<beast::unit_test::thread> t;
|
||||
std::vector<beast::unit_test::Thread> t;
|
||||
t.reserve(number_of_threads);
|
||||
for (std::size_t id = 0; id < number_of_threads; ++id)
|
||||
t.emplace_back(*this, parallel_for_lambda<Body>(n, c), id, args...);
|
||||
|
||||
@@ -16,15 +16,6 @@
|
||||
|
||||
namespace xrpl {
|
||||
|
||||
namespace unl {
|
||||
class Manager;
|
||||
} // namespace unl
|
||||
namespace Resource {
|
||||
class Manager;
|
||||
} // namespace Resource
|
||||
namespace NodeStore {
|
||||
class Database;
|
||||
} // namespace NodeStore
|
||||
namespace perf {
|
||||
class PerfLog;
|
||||
} // namespace perf
|
||||
|
||||
@@ -21,7 +21,6 @@ namespace xrpl {
|
||||
//
|
||||
|
||||
class Application;
|
||||
class Database;
|
||||
class Rules;
|
||||
|
||||
enum TransStatus {
|
||||
|
||||
@@ -47,7 +47,7 @@ protected:
|
||||
endpoint_type lastEndpoint_;
|
||||
bool lastStatus_;
|
||||
|
||||
public:
|
||||
private:
|
||||
WorkBase(
|
||||
std::string const& host,
|
||||
std::string const& path,
|
||||
@@ -56,6 +56,8 @@ public:
|
||||
endpoint_type const& lastEndpoint,
|
||||
bool lastStatus,
|
||||
callback_type cb);
|
||||
|
||||
public:
|
||||
~WorkBase();
|
||||
|
||||
Impl&
|
||||
@@ -91,6 +93,8 @@ public:
|
||||
private:
|
||||
void
|
||||
close();
|
||||
|
||||
friend Impl;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -49,7 +49,7 @@ decompress(
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
catch (...) // NOLINT(bugprone-empty-catch)
|
||||
{
|
||||
}
|
||||
return 0;
|
||||
@@ -88,7 +88,7 @@ compress(
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
catch (...) // NOLINT(bugprone-empty-catch)
|
||||
{
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -24,7 +24,7 @@ class AssetCache;
|
||||
class PathRequestManager;
|
||||
|
||||
// Return values from parseJson <0 = invalid, >0 = valid
|
||||
#define PFR_PJ_INVALID -1
|
||||
#define PFR_PJ_INVALID (-1)
|
||||
#define PFR_PJ_NOCHANGE 0
|
||||
|
||||
class PathRequest final : public InfoSubRequest,
|
||||
|
||||
Reference in New Issue
Block a user