Suppress build warning introduced in Catalogue (#499)

This commit is contained in:
tequ
2025-04-29 07:25:55 +09:00
committed by GitHub
parent 5400f43359
commit 7b581443d1
4 changed files with 25 additions and 27 deletions

View File

@@ -311,10 +311,10 @@ Ledger::Ledger(
Family& family,
SHAMap const& baseState)
: mImmutable(false)
, info_(info)
, txMap_(SHAMapType::TRANSACTION, family)
, stateMap_(baseState, true)
, rules_{config.features}
, info_(info)
, j_(beast::Journal(beast::Journal::getNullSink()))
{
}

View File

@@ -69,7 +69,7 @@ static constexpr uint16_t CATALOGUE_VERSION_MASK =
0x00FF; // Lower 8 bits for version
static constexpr uint16_t CATALOGUE_COMPRESS_LEVEL_MASK =
0x0F00; // Bits 8-11: compression level
static constexpr uint16_t CATALOGUE_RESERVED_MASK =
[[maybe_unused]] static constexpr uint16_t CATALOGUE_RESERVED_MASK =
0xF000; // Bits 12-15: reserved
std::string
@@ -229,7 +229,7 @@ class CatalogueSizePredictor
private:
uint32_t minLedger_;
uint32_t maxLedger_;
uint64_t headerSize_;
[[maybe_unused]] uint64_t headerSize_;
// Keep track of actual bytes
uint64_t totalBytesWritten_;
@@ -246,9 +246,9 @@ public:
: minLedger_(minLedger)
, maxLedger_(maxLedger)
, headerSize_(headerSize)
, processedLedgers_(0)
, totalBytesWritten_(headerSize)
, firstLedgerSize_(0)
, processedLedgers_(0)
{
}

View File

@@ -1301,10 +1301,8 @@ SHAMap::serializeToStream(
std::size_t nodeCount = 0;
auto serializeLeaf = [&stream,
&localBytesWritten,
flushThreshold,
&tryFlush](SHAMapLeafNode const& node) -> bool {
auto serializeLeaf = [&stream, &localBytesWritten, &tryFlush](
SHAMapLeafNode const& node) -> bool {
// write the node type
auto t = node.getType();
stream.write(reinterpret_cast<char const*>(&t), 1);
@@ -1335,10 +1333,8 @@ SHAMap::serializeToStream(
return !stream.fail();
};
auto serializeRemovedLeaf = [&stream,
&localBytesWritten,
flushThreshold,
&tryFlush](uint256 const& key) -> bool {
auto serializeRemovedLeaf =
[&stream, &localBytesWritten, &tryFlush](uint256 const& key) -> bool {
// to indicate a node is removed it is written with a removal type
auto t = SHAMapNodeType::tnREMOVE;
stream.write(reinterpret_cast<char const*>(&t), 1);

View File

@@ -401,18 +401,8 @@ class Catalogue_test : public beast::unit_test::suite
sourceLedger->info().accepted == loadedLedger->info().accepted);
// Check SLE counts
std::size_t sourceCount = 0;
std::size_t loadedCount = 0;
for (auto const& sle : sourceLedger->sles)
{
sourceCount++;
}
for (auto const& sle : loadedLedger->sles)
{
loadedCount++;
}
std::size_t sourceCount = std::ranges::distance(sourceLedger->sles);
std::size_t loadedCount = std::ranges::distance(loadedLedger->sles);
BEAST_EXPECT(sourceCount == loadedCount);
@@ -561,7 +551,13 @@ class Catalogue_test : public beast::unit_test::suite
using namespace test::jtx;
// Create environment and test data
Env env{*this, envconfig(), features};
Env env{
*this,
envconfig(),
features,
nullptr,
beast::severities::kDisabled,
};
prepareLedgerData(env, 3);
boost::filesystem::path tempDir =
@@ -652,7 +648,13 @@ class Catalogue_test : public beast::unit_test::suite
using namespace test::jtx;
// Create environment and test data
Env env{*this, envconfig(), features};
Env env{
*this,
envconfig(),
features,
nullptr,
beast::severities::kDisabled,
};
prepareLedgerData(env, 3);
boost::filesystem::path tempDir =
@@ -829,7 +831,7 @@ class Catalogue_test : public beast::unit_test::suite
{
auto result = env.client().invoke(
"catalogue_status", Json::objectValue)[jss::result];
std::cout << to_string(result) << "\n";
// std::cout << to_string(result) << "\n";
BEAST_EXPECT(result[jss::job_status] == "no_job_running");
}