aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-23 18:59:58 +0200
committerStefan Boberg <[email protected]>2021-10-23 18:59:58 +0200
commitc63acd947853cc05721b327075ac78f91e58df8e (patch)
treed209eec1ba7c22e21e55b571b435b3a605c4df48
parentcompactcas: Changed CasDiskLocation implementation so it can store chunks > 4... (diff)
downloadzen-c63acd947853cc05721b327075ac78f91e58df8e.tar.xz
zen-c63acd947853cc05721b327075ac78f91e58df8e.zip
cas: fixed some warnings
unsure why we don't get these when building in VS
-rw-r--r--zenstore/CAS.cpp8
-rw-r--r--zenstore/compactcas.cpp1
-rw-r--r--zenstore/filecas.cpp14
3 files changed, 14 insertions, 9 deletions
diff --git a/zenstore/CAS.cpp b/zenstore/CAS.cpp
index ec8e8f570..86c6eb849 100644
--- a/zenstore/CAS.cpp
+++ b/zenstore/CAS.cpp
@@ -121,7 +121,7 @@ private:
StorageScheme m_StorageScheme = StorageScheme::Legacy;
bool OpenOrCreateManifest();
- void UpdateManifest(bool IsNewStore);
+ void UpdateManifest();
};
CasImpl::CasImpl(CasGc& Gc) : m_TinyStrategy(m_Config), m_SmallStrategy(m_Config), m_LargeStrategy(m_Config, Gc)
@@ -210,14 +210,14 @@ CasImpl::OpenOrCreateManifest()
if (!ManifestIsOk)
{
- UpdateManifest(true);
+ UpdateManifest();
}
return IsNewStore;
}
void
-CasImpl::UpdateManifest(bool IsNewStore)
+CasImpl::UpdateManifest()
{
if (!m_ManifestObject)
{
@@ -312,7 +312,7 @@ CasImpl::Scrub(ScrubContext& Ctx)
m_LargeStrategy.Scrub(Ctx);
}
-void
+void
CasImpl::GarbageCollect(GcContext& GcCtx)
{
m_LargeStrategy.CollectGarbage(GcCtx);
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp
index bb2f92858..dbe5572b9 100644
--- a/zenstore/compactcas.cpp
+++ b/zenstore/compactcas.cpp
@@ -268,6 +268,7 @@ CasContainerStrategy::Scrub(ScrubContext& Ctx)
void
CasContainerStrategy::CollectGarbage(GcContext& GcCtx)
{
+ ZEN_UNUSED(GcCtx);
}
void
diff --git a/zenstore/filecas.cpp b/zenstore/filecas.cpp
index 8c4df4029..0714637c6 100644
--- a/zenstore/filecas.cpp
+++ b/zenstore/filecas.cpp
@@ -90,7 +90,7 @@ FileCasStrategy::Initialize(bool IsNewStore)
m_CasLog.Open(m_Config.RootDirectory / "cas.ulog", IsNewStore);
- m_CasLog.Replay([&](const FileCasIndexEntry& Entry) {});
+ m_CasLog.Replay([&](const FileCasIndexEntry& Entry) { ZEN_UNUSED(Entry); });
}
CasStore::InsertResult
@@ -364,6 +364,7 @@ FileCasStrategy::HaveChunk(const IoHash& ChunkHash)
return false;
}
+
void
FileCasStrategy::DeleteChunk(const IoHash& ChunkHash, std::error_code& Ec)
{
@@ -399,7 +400,7 @@ void
FileCasStrategy::IterateChunks(std::function<void(const IoHash& Hash, BasicFile& PayloadFile)>&& Callback)
{
ZEN_ASSERT(m_IsInitialized);
-
+
struct Visitor : public FileSystemTraversal::TreeVisitor
{
Visitor(const std::filesystem::path& RootDir) : RootDirectory(RootDir) {}
@@ -535,7 +536,10 @@ FileCasStrategy::CollectGarbage(GcContext& GcCtx)
bool KeepThis = false;
CandidateCas.clear();
CandidateCas.push_back(Hash);
- GcCtx.FilterCas(CandidateCas, [&](const IoHash& Hash) { KeepThis = true; });
+ GcCtx.FilterCas(CandidateCas, [&](const IoHash& Hash) {
+ ZEN_UNUSED(Hash);
+ KeepThis = true;
+ });
const uint64_t FileSize = Payload.FileSize();
@@ -566,7 +570,7 @@ FileCasStrategy::CollectGarbage(GcContext& GcCtx)
if (Ec)
{
ZEN_WARN("failed to delete file for chunk {}: '{}'", Hash, Ec.message());
- }
+ }
}
}
@@ -587,7 +591,7 @@ TEST_CASE("cas.file.move")
CasConfig.RootDirectory = TempDir.Path() / "cas";
FileCasStrategy FileCas(CasConfig, Gc);
- FileCas.Initialize(/* IsNewStore */true);
+ FileCas.Initialize(/* IsNewStore */ true);
{
std::filesystem::path Payload1Path{TempDir.Path() / "payload_1"};