aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2022-01-22 11:11:34 +0100
committerPer Larsson <[email protected]>2022-01-22 11:11:34 +0100
commitaef9c292beae2245da35f60fa8c8bd9c52fd248f (patch)
tree798c254a0a3c867b5bc79c676684de7d47de6cc9
parentUse ExtendablePathBuilders (diff)
downloadzen-aef9c292beae2245da35f60fa8c8bd9c52fd248f.tar.xz
zen-aef9c292beae2245da35f60fa8c8bd9c52fd248f.zip
Format fix.
-rw-r--r--zen/chunk/chunk.cpp6
-rw-r--r--zen/cmds/print.cpp4
-rw-r--r--zen/internalfile.cpp2
-rw-r--r--zencore/base64.cpp2
-rw-r--r--zencore/filesystem.cpp10
-rw-r--r--zencore/include/zencore/except.h2
-rw-r--r--zencore/include/zencore/memory.h6
-rw-r--r--zencore/include/zencore/string.h6
-rw-r--r--zencore/include/zencore/zencore.h53
-rw-r--r--zencore/iobuffer.cpp8
-rw-r--r--zencore/md5.cpp2
-rw-r--r--zencore/stats.cpp5
-rw-r--r--zencore/thread.cpp31
-rw-r--r--zenhttp/httpasio.cpp6
-rw-r--r--zenhttp/httpserver.cpp2
-rw-r--r--zenhttp/httpsys.cpp3
-rw-r--r--zenserver-test/zenserver-test.cpp35
-rw-r--r--zenserver/cache/structuredcachestore.cpp2
-rw-r--r--zenserver/compute/apply.cpp6
-rw-r--r--zenserver/config.cpp7
-rw-r--r--zenserver/projectstore.cpp3
-rw-r--r--zenserver/upstream/upstreamcache.cpp28
-rw-r--r--zenserver/zenserver.cpp2
-rw-r--r--zenstore/filecas.cpp3
24 files changed, 127 insertions, 107 deletions
diff --git a/zen/chunk/chunk.cpp b/zen/chunk/chunk.cpp
index f7ee8275e..42ea8eddc 100644
--- a/zen/chunk/chunk.cpp
+++ b/zen/chunk/chunk.cpp
@@ -64,15 +64,13 @@ struct combinable
struct task_group
{
- template <class Function>
+ template<class Function>
void run(const Function& Func)
{
Func();
}
- void wait()
- {
- }
+ void wait() {}
};
} // namespace Concurrency
diff --git a/zen/cmds/print.cpp b/zen/cmds/print.cpp
index fe9117c04..f66f433f1 100644
--- a/zen/cmds/print.cpp
+++ b/zen/cmds/print.cpp
@@ -54,7 +54,9 @@ PrintCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
if (CbValidateError Result = ValidateCompactBinary(Data, CbValidateMode::All); Result != CbValidateError::None)
{
- zen::ConsoleLog().error("Data in file '{}' does not appear to be compact binary (validation error {:#x})", m_Filename, uint32_t(Result));
+ zen::ConsoleLog().error("Data in file '{}' does not appear to be compact binary (validation error {:#x})",
+ m_Filename,
+ uint32_t(Result));
return 1;
}
diff --git a/zen/internalfile.cpp b/zen/internalfile.cpp
index dbafcb549..c1ffe6f5f 100644
--- a/zen/internalfile.cpp
+++ b/zen/internalfile.cpp
@@ -265,7 +265,7 @@ InternalFile::Read(void* Data, uint64_t Size, uint64_t Offset)
if (Success)
{
- zen::ThrowLastError(fmt::format("Failed to read from file '{}'", "")); // zen::PathFromHandle(m_File)));
+ zen::ThrowLastError(fmt::format("Failed to read from file '{}'", "")); // zen::PathFromHandle(m_File)));
}
}
diff --git a/zencore/base64.cpp b/zencore/base64.cpp
index 0448d7c2f..b97dfebbf 100644
--- a/zencore/base64.cpp
+++ b/zencore/base64.cpp
@@ -30,7 +30,7 @@ static const uint8_t DecodingAlphabet[256] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // 0xe0-0xef
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF // 0xf0-0xff
};
-#endif // 0
+#endif // 0
template<typename CharType>
uint32_t
diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp
index bed08b3f5..ee49aa474 100644
--- a/zencore/filesystem.cpp
+++ b/zencore/filesystem.cpp
@@ -765,7 +765,7 @@ DiskSpace
DiskSpaceInfo(std::filesystem::path Directory, std::error_code& Error)
{
using namespace std::filesystem;
-
+
space_info SpaceInfo = space(Directory, Error);
if (Error)
{
@@ -940,7 +940,7 @@ PathFromHandle(void* NativeHandle)
Link[BytesRead] = '\0';
return Link;
#elif ZEN_PLATFORM_MAC
- int Fd = int(uintptr_t(NativeHandle));
+ int Fd = int(uintptr_t(NativeHandle));
char Path[MAXPATHLEN];
if (fcntl(Fd, F_GETPATH, Path) < 0)
{
@@ -968,10 +968,10 @@ GetRunningExecutablePath()
Link[BytesRead] = '\0';
return Link;
#elif ZEN_PLATFORM_MAC
- char Buffer[PROC_PIDPATHINFO_MAXSIZE];
+ char Buffer[PROC_PIDPATHINFO_MAXSIZE];
int SelfPid = GetCurrentProcessId();
- if (proc_pidpath(SelfPid, Buffer, sizeof(Buffer)) <= 0)
+ if (proc_pidpath(SelfPid, Buffer, sizeof(Buffer)) <= 0)
return {};
return Buffer;
@@ -1100,7 +1100,7 @@ TEST_CASE("DiskSpaceInfo")
CHECK(Okay);
CHECK(int64_t(Space.Total) > 0);
- CHECK(int64_t(Space.Free) > 0); // Hopefully there's at least one byte free
+ CHECK(int64_t(Space.Free) > 0); // Hopefully there's at least one byte free
}
TEST_CASE("PathBuilder")
diff --git a/zencore/include/zencore/except.h b/zencore/include/zencore/except.h
index d714b6ade..c61db5ba9 100644
--- a/zencore/include/zencore/except.h
+++ b/zencore/include/zencore/except.h
@@ -22,7 +22,7 @@ ZENCORE_API void ThrowSystemException [[noreturn]] (HRESULT hRes, std::string_vi
#if defined(__cpp_lib_source_location)
ZENCORE_API void ThrowLastErrorImpl [[noreturn]] (std::string_view Message, const std::source_location& Location);
-#define ThrowLastError(Message) ThrowLastErrorImpl(Message, std::source_location::current())
+# define ThrowLastError(Message) ThrowLastErrorImpl(Message, std::source_location::current())
#else
ZENCORE_API void ThrowLastError [[noreturn]] (std::string_view Message);
#endif
diff --git a/zencore/include/zencore/memory.h b/zencore/include/zencore/memory.h
index 40a3be18c..560fa9ffc 100644
--- a/zencore/include/zencore/memory.h
+++ b/zencore/include/zencore/memory.h
@@ -15,9 +15,11 @@
namespace zen {
#if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 201911L
- template <typename T> concept ContiguousRange = std::ranges::contiguous_range<T>;
+template<typename T>
+concept ContiguousRange = std::ranges::contiguous_range<T>;
#else
- template <typename T> concept ContiguousRange = true;
+template<typename T>
+concept ContiguousRange = true;
#endif
struct MemoryView;
diff --git a/zencore/include/zencore/string.h b/zencore/include/zencore/string.h
index 1afacc089..1e8907906 100644
--- a/zencore/include/zencore/string.h
+++ b/zencore/include/zencore/string.h
@@ -664,9 +664,9 @@ template<typename Fn>
uint32_t
ForEachStrTok(const std::string_view& Str, char Delim, Fn&& Func)
{
- const char* It = Str.data();
- const char* End = It + Str.length();
- uint32_t Count = 0;
+ const char* It = Str.data();
+ const char* End = It + Str.length();
+ uint32_t Count = 0;
while (It != End)
{
diff --git a/zencore/include/zencore/zencore.h b/zencore/include/zencore/zencore.h
index 9f8af8c41..023b237cd 100644
--- a/zencore/include/zencore/zencore.h
+++ b/zencore/include/zencore/zencore.h
@@ -139,23 +139,38 @@
// of std::integral. Some platforms like Ubuntu and Mac OS are still on 12.
#if defined(__cpp_lib_concepts)
# include <concepts>
- template <class T> concept Integral = std::integral<T>;
- template <class T> concept SignedIntegral = std::signed_integral<T>;
- template <class T> concept UnsignedIntegral = std::unsigned_integral<T>;
- template <class F, class... A> concept Invocable = std::invocable<F, A...>;
- template <class D, class B> concept DerivedFrom = std::derived_from<D, B>;
+template<class T>
+concept Integral = std::integral<T>;
+template<class T>
+concept SignedIntegral = std::signed_integral<T>;
+template<class T>
+concept UnsignedIntegral = std::unsigned_integral<T>;
+template<class F, class... A>
+concept Invocable = std::invocable<F, A...>;
+template<class D, class B>
+concept DerivedFrom = std::derived_from<D, B>;
#else
- template <class T> concept Integral = std::is_integral_v<T>;
- template <class T> concept SignedIntegral = Integral<T> && std::is_signed_v<T>;
- template <class T> concept UnsignedIntegral = Integral<T> && !std::is_signed_v<T>;
- template <class F, class... A> concept Invocable = requires(F&& f, A&&... a) { std::invoke(std::forward<F>(f), std::forward<A>(a)...); };
- template <class D, class B> concept DerivedFrom = std::is_base_of_v<B, D> && std::is_convertible_v<const volatile D*, const volatile B*>;
+template<class T>
+concept Integral = std::is_integral_v<T>;
+template<class T>
+concept SignedIntegral = Integral<T> && std::is_signed_v<T>;
+template<class T>
+concept UnsignedIntegral = Integral<T> && !std::is_signed_v<T>;
+template<class F, class... A>
+concept Invocable = requires(F&& f, A&&... a)
+{
+ std::invoke(std::forward<F>(f), std::forward<A>(a)...);
+};
+template<class D, class B>
+concept DerivedFrom = std::is_base_of_v<B, D> && std::is_convertible_v<const volatile D*, const volatile B*>;
#endif
#if defined(__cpp_lib_ranges)
- template <typename T> concept ContiguousRange = std::ranges::contiguous_range<T>;
+template<typename T>
+concept ContiguousRange = std::ranges::contiguous_range<T>;
#else
- template <typename T> concept ContiguousRange = true;
+template<typename T>
+concept ContiguousRange = true;
#endif
//////////////////////////////////////////////////////////////////////////
@@ -224,13 +239,13 @@ static_assert(sizeof(wchar_t) == 2, "wchar_t is expected to be two bytes in size
# define ZEN_DEBUG_SECTION ZEN_CODE_SECTION(".zcold")
#endif
-namespace zen {
-
-class AssertException : public std::logic_error
+namespace zen
{
-public:
- AssertException(const char* Msg) : std::logic_error(Msg) {}
-};
+ class AssertException : public std::logic_error
+ {
+ public:
+ AssertException(const char* Msg) : std::logic_error(Msg) {}
+ };
} // namespace zen
@@ -315,7 +330,7 @@ ZENCORE_API void zencore_forcelinktests();
#ifndef ZEN_USE_MIMALLOC
# if ZEN_ARCH_ARM64
- // The vcpkg mimalloc port doesn't support Arm targets
+ // The vcpkg mimalloc port doesn't support Arm targets
# define ZEN_USE_MIMALLOC 0
# else
# define ZEN_USE_MIMALLOC 1
diff --git a/zencore/iobuffer.cpp b/zencore/iobuffer.cpp
index e4c1ad75a..e2aaa3169 100644
--- a/zencore/iobuffer.cpp
+++ b/zencore/iobuffer.cpp
@@ -288,9 +288,11 @@ IoBufferExtendedCore::Materialize() const
if (MappedBase == nullptr)
{
- throw std::system_error(
- std::error_code(zen::GetLastError(), std::system_category()),
- fmt::format("MapViewOfFile failed (offset {:#x}, size {:#x}) file: '{}'", MapOffset, MapSize, zen::PathFromHandle(m_FileHandle)));
+ throw std::system_error(std::error_code(zen::GetLastError(), std::system_category()),
+ fmt::format("MapViewOfFile failed (offset {:#x}, size {:#x}) file: '{}'",
+ MapOffset,
+ MapSize,
+ zen::PathFromHandle(m_FileHandle)));
}
m_MappedPointer = MappedBase;
diff --git a/zencore/md5.cpp b/zencore/md5.cpp
index a5a5ea41d..faece3862 100644
--- a/zencore/md5.cpp
+++ b/zencore/md5.cpp
@@ -441,7 +441,7 @@ TEST_CASE("MD5")
{
using namespace std::literals;
- auto Input = "jumblesmcgee"sv;
+ auto Input = "jumblesmcgee"sv;
auto Output = "28f2200a59c60b75947099d750c2cc50"sv;
MD5Stream Stream;
diff --git a/zencore/stats.cpp b/zencore/stats.cpp
index 595c45c3f..f783ccd3d 100644
--- a/zencore/stats.cpp
+++ b/zencore/stats.cpp
@@ -56,8 +56,7 @@ RawEWMA::Tick(double Alpha, uint64_t Interval, uint64_t Count, bool IsInitialUpd
do
{
Next = Value + Delta;
- }
- while (!m_Rate.compare_exchange_weak(Value, Next, std::memory_order_relaxed));
+ } while (!m_Rate.compare_exchange_weak(Value, Next, std::memory_order_relaxed));
#endif
}
}
@@ -706,4 +705,4 @@ stats_forcelink()
#endif
-} // namespace zen
+} // namespace zen::metrics
diff --git a/zencore/thread.cpp b/zencore/thread.cpp
index fa149321f..2cc4d8a96 100644
--- a/zencore/thread.cpp
+++ b/zencore/thread.cpp
@@ -10,7 +10,7 @@
#if ZEN_PLATFORM_LINUX
# if !defined(_GNU_SOURCE)
-# define _GNU_SOURCE // for semtimedop()
+# define _GNU_SOURCE // for semtimedop()
# endif
#endif
@@ -94,11 +94,11 @@ SetCurrentThreadName([[maybe_unused]] std::string_view ThreadName)
SetNameInternal(GetCurrentThreadId(), ThreadNameZ.c_str());
#else
std::string ThreadNameZ{ThreadName};
-#if ZEN_PLATFORM_MAC
+# if ZEN_PLATFORM_MAC
pthread_setname_np(ThreadNameZ.c_str());
-#else
+# else
pthread_setname_np(pthread_self(), ThreadNameZ.c_str());
-#endif
+# endif
#endif
} // namespace zen
@@ -257,7 +257,7 @@ NamedEvent::NamedEvent(std::string_view EventName)
ExtendableStringBuilder<64> EventPath;
EventPath << "/tmp/" << EventName;
- int Fd = open(EventPath.c_str(), O_RDWR|O_CREAT, 0644);
+ int Fd = open(EventPath.c_str(), O_RDWR | O_CREAT, 0644);
if (Fd < 0)
{
ThrowLastError(fmt::format("Failed to create '{}' for named event", EventPath));
@@ -294,8 +294,8 @@ NamedEvent::NamedEvent(std::string_view EventName)
// Pack into the handle
static_assert(sizeof(Sem) + sizeof(Fd) <= sizeof(void*), "Semaphore packing assumptions not met");
intptr_t Packed;
- Packed = intptr_t(Sem) << 32;
- Packed |= intptr_t(Fd) & 0xffff'ffff;
+ Packed = intptr_t(Sem) << 32;
+ Packed |= intptr_t(Fd) & 0xffff'ffff;
m_EventHandle = (void*)Packed;
#endif
}
@@ -316,7 +316,7 @@ NamedEvent::Close()
#if ZEN_PLATFORM_WINDOWS
CloseHandle(m_EventHandle);
#elif ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC
- int Fd = int(intptr_t(m_EventHandle) & 0xffff'ffff);
+ int Fd = int(intptr_t(m_EventHandle) & 0xffff'ffff);
if (flock(Fd, LOCK_EX | LOCK_NB) == 0)
{
@@ -363,7 +363,7 @@ NamedEvent::Wait(int TimeoutMs)
#elif ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC
int Sem = int(intptr_t(m_EventHandle) >> 32);
- int Result;
+ int Result;
struct sembuf SemOp = {};
if (TimeoutMs < 0)
@@ -372,15 +372,15 @@ NamedEvent::Wait(int TimeoutMs)
return Result == 0;
}
-#if defined(_GNU_SOURCE)
+# if defined(_GNU_SOURCE)
struct timespec TimeoutValue = {
.tv_sec = TimeoutMs >> 10,
.tv_nsec = (TimeoutMs & 0x3ff) << 20,
};
Result = semtimedop(Sem, &SemOp, 1, &TimeoutValue);
-#else
+# else
const int SleepTimeMs = 10;
- SemOp.sem_flg = IPC_NOWAIT;
+ SemOp.sem_flg = IPC_NOWAIT;
do
{
Result = semop(Sem, &SemOp, 1);
@@ -391,9 +391,8 @@ NamedEvent::Wait(int TimeoutMs)
Sleep(SleepTimeMs);
TimeoutMs -= SleepTimeMs;
- }
- while (TimeoutMs > 0);
-#endif // _GNU_SOURCE
+ } while (TimeoutMs > 0);
+# endif // _GNU_SOURCE
return Result == 0;
#endif
@@ -581,7 +580,7 @@ ProcessHandle::Terminate(int ExitCode)
bSuccess = (WaitResult != WAIT_OBJECT_0);
#elif ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC
ZEN_UNUSED(ExitCode);
- bSuccess = (kill(m_Pid, SIGKILL) == 0);
+ bSuccess = (kill(m_Pid, SIGKILL) == 0);
#endif
if (!bSuccess)
diff --git a/zenhttp/httpasio.cpp b/zenhttp/httpasio.cpp
index 7a6efd884..801bb51ac 100644
--- a/zenhttp/httpasio.cpp
+++ b/zenhttp/httpasio.cpp
@@ -155,11 +155,7 @@ private:
{
HeaderEntry() = default;
- HeaderEntry(std::string_view InName, std::string_view InValue)
- : Name(InName)
- , Value(InValue)
- {
- }
+ HeaderEntry(std::string_view InName, std::string_view InValue) : Name(InName), Value(InValue) {}
std::string_view Name;
std::string_view Value;
diff --git a/zenhttp/httpserver.cpp b/zenhttp/httpserver.cpp
index 62b8d11a1..c8e11468e 100644
--- a/zenhttp/httpserver.cpp
+++ b/zenhttp/httpserver.cpp
@@ -400,7 +400,7 @@ HttpServerRequest::GetQueryParams()
continue;
}
- size_t QueryLen = ptrdiff_t(QueryEnd - QueryIt);
+ size_t QueryLen = ptrdiff_t(QueryEnd - QueryIt);
const std::string_view Query{QueryIt, QueryLen};
size_t DelimIndex = Query.find('&', 0);
diff --git a/zenhttp/httpsys.cpp b/zenhttp/httpsys.cpp
index 67ff6b46b..b3d109b6a 100644
--- a/zenhttp/httpsys.cpp
+++ b/zenhttp/httpsys.cpp
@@ -703,7 +703,8 @@ HttpAsyncWorkRequest::AsyncWorkItem::Execute()
}
catch (std::exception& Ex)
{
- return (void)Tx.IssueNextRequest(new HttpMessageResponseRequest(Tx, 500, fmt::format("Exception thrown in async work: '{}'", Ex.what())));
+ return (void)Tx.IssueNextRequest(
+ new HttpMessageResponseRequest(Tx, 500, fmt::format("Exception thrown in async work: '{}'", Ex.what())));
}
}
diff --git a/zenserver-test/zenserver-test.cpp b/zenserver-test/zenserver-test.cpp
index d5e68caed..75aae6321 100644
--- a/zenserver-test/zenserver-test.cpp
+++ b/zenserver-test/zenserver-test.cpp
@@ -1577,8 +1577,8 @@ TEST_CASE("zcache.policy")
}
{
- cpr::Response Result =
- cpr::Get(cpr::Url{fmt::format("{}/{}/{}", LocalCfg.BaseUri, Bucket, Key)}, cpr::Header{{"Accept", "application/octet-stream"}});
+ cpr::Response Result = cpr::Get(cpr::Url{fmt::format("{}/{}/{}", LocalCfg.BaseUri, Bucket, Key)},
+ cpr::Header{{"Accept", "application/octet-stream"}});
CHECK(Result.status_code == 200);
}
}
@@ -1612,8 +1612,8 @@ TEST_CASE("zcache.policy")
}
{
- cpr::Response Result =
- cpr::Get(cpr::Url{fmt::format("{}/{}/{}", LocalCfg.BaseUri, Bucket, Key)}, cpr::Header{{"Accept", "application/octet-stream"}});
+ cpr::Response Result = cpr::Get(cpr::Url{fmt::format("{}/{}/{}", LocalCfg.BaseUri, Bucket, Key)},
+ cpr::Header{{"Accept", "application/octet-stream"}});
CHECK(Result.status_code == 200);
}
}
@@ -1680,14 +1680,14 @@ TEST_CASE("zcache.policy")
}
{
- cpr::Response Result =
- cpr::Get(cpr::Url{fmt::format("{}/{}/{}", UpstreamCfg.BaseUri, Bucket, Key)}, cpr::Header{{"Accept", "application/x-ue-cbpkg"}});
+ cpr::Response Result = cpr::Get(cpr::Url{fmt::format("{}/{}/{}", UpstreamCfg.BaseUri, Bucket, Key)},
+ cpr::Header{{"Accept", "application/x-ue-cbpkg"}});
CHECK(Result.status_code == 404);
}
{
- cpr::Response Result =
- cpr::Get(cpr::Url{fmt::format("{}/{}/{}", LocalCfg.BaseUri, Bucket, Key)}, cpr::Header{{"Accept", "application/x-ue-cbpkg"}});
+ cpr::Response Result = cpr::Get(cpr::Url{fmt::format("{}/{}/{}", LocalCfg.BaseUri, Bucket, Key)},
+ cpr::Header{{"Accept", "application/x-ue-cbpkg"}});
CHECK(Result.status_code == 200);
}
}
@@ -1717,14 +1717,14 @@ TEST_CASE("zcache.policy")
}
{
- cpr::Response Result =
- cpr::Get(cpr::Url{fmt::format("{}/{}/{}", UpstreamCfg.BaseUri, Bucket, Key)}, cpr::Header{{"Accept", "application/x-ue-cbpkg"}});
+ cpr::Response Result = cpr::Get(cpr::Url{fmt::format("{}/{}/{}", UpstreamCfg.BaseUri, Bucket, Key)},
+ cpr::Header{{"Accept", "application/x-ue-cbpkg"}});
CHECK(Result.status_code == 200);
}
{
- cpr::Response Result =
- cpr::Get(cpr::Url{fmt::format("{}/{}/{}", LocalCfg.BaseUri, Bucket, Key)}, cpr::Header{{"Accept", "application/x-ue-cbpkg"}});
+ cpr::Response Result = cpr::Get(cpr::Url{fmt::format("{}/{}/{}", LocalCfg.BaseUri, Bucket, Key)},
+ cpr::Header{{"Accept", "application/x-ue-cbpkg"}});
CHECK(Result.status_code == 200);
}
}
@@ -1775,8 +1775,8 @@ TEST_CASE("zcache.policy")
}
{
- cpr::Response Result =
- cpr::Get(cpr::Url{fmt::format("{}/{}/{}", LocalCfg.BaseUri, Bucket, Key)}, cpr::Header{{"Accept", "application/x-ue-cbpkg"}});
+ cpr::Response Result = cpr::Get(cpr::Url{fmt::format("{}/{}/{}", LocalCfg.BaseUri, Bucket, Key)},
+ cpr::Header{{"Accept", "application/x-ue-cbpkg"}});
CHECK(Result.status_code == 200);
zen::IoBuffer Body(zen::IoBuffer::Wrap, Result.text.data(), Result.text.size());
@@ -1838,8 +1838,8 @@ TEST_CASE("zcache.policy")
}
{
- cpr::Response Result =
- cpr::Get(cpr::Url{fmt::format("{}/{}/{}", LocalCfg.BaseUri, Bucket, Key)}, cpr::Header{{"Accept", "application/x-ue-cbpkg"}});
+ cpr::Response Result = cpr::Get(cpr::Url{fmt::format("{}/{}/{}", LocalCfg.BaseUri, Bucket, Key)},
+ cpr::Header{{"Accept", "application/x-ue-cbpkg"}});
CHECK(Result.status_code == 200);
zen::IoBuffer Body(zen::IoBuffer::Wrap, Result.text.data(), Result.text.size());
@@ -2256,7 +2256,8 @@ struct RemoteExecutionRequest
void Prep()
{
- cpr::Response Response = cpr::Post(cpr::Url(fmt::format("{}/prep", m_BaseUri)), cpr::Body((const char*)m_MemOut.Data(), m_MemOut.Size()));
+ cpr::Response Response =
+ cpr::Post(cpr::Url(fmt::format("{}/prep", m_BaseUri)), cpr::Body((const char*)m_MemOut.Data(), m_MemOut.Size()));
if (Response.status_code < 300)
{
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp
index 53dd3d5c5..2bba2e8e6 100644
--- a/zenserver/cache/structuredcachestore.cpp
+++ b/zenserver/cache/structuredcachestore.cpp
@@ -857,7 +857,7 @@ ZenCacheDiskLayer::CacheBucket::CollectGarbage(GcContext& GcCtx)
// Remove all standalone file(s)
// NOTE: This can probably be made asynchronously
{
- std::error_code Ec;
+ std::error_code Ec;
ExtendablePathBuilder<256> Path;
for (const auto& Entry : ExpiredEntries)
diff --git a/zenserver/compute/apply.cpp b/zenserver/compute/apply.cpp
index 95902a752..fe2889c7f 100644
--- a/zenserver/compute/apply.cpp
+++ b/zenserver/compute/apply.cpp
@@ -737,7 +737,8 @@ HttpFunctionService::ExecAction(const WorkerDesc& Worker, CbObject Action)
if (DataBuffer.Size() != Size)
{
- throw std::runtime_error(fmt::format("worker CAS chunk '{}' size: {}, action spec expected {}", ChunkHash, DataBuffer.Size(), Size));
+ throw std::runtime_error(
+ fmt::format("worker CAS chunk '{}' size: {}, action spec expected {}", ChunkHash, DataBuffer.Size(), Size));
}
zen::WriteFile(FilePath, DataBuffer);
@@ -768,7 +769,8 @@ HttpFunctionService::ExecAction(const WorkerDesc& Worker, CbObject Action)
if (DataBuffer.Size() != Size)
{
- throw std::runtime_error(fmt::format("worker CAS chunk '{}' size: {}, action spec expected {}", ChunkHash, DataBuffer.Size(), Size));
+ throw std::runtime_error(
+ fmt::format("worker CAS chunk '{}' size: {}, action spec expected {}", ChunkHash, DataBuffer.Size(), Size));
}
zen::WriteFile(FilePath, DataBuffer);
diff --git a/zenserver/config.cpp b/zenserver/config.cpp
index 4cb949b0e..da37efbb7 100644
--- a/zenserver/config.cpp
+++ b/zenserver/config.cpp
@@ -32,11 +32,8 @@ std::filesystem::path
PickDefaultStateDirectory()
{
// Pick sensible default
- PWSTR programDataDir = nullptr;
- HRESULT hRes = SHGetKnownFolderPath(FOLDERID_ProgramData,
- 0,
- NULL,
- &programDataDir);
+ PWSTR programDataDir = nullptr;
+ HRESULT hRes = SHGetKnownFolderPath(FOLDERID_ProgramData, 0, NULL, &programDataDir);
if (SUCCEEDED(hRes))
{
diff --git a/zenserver/projectstore.cpp b/zenserver/projectstore.cpp
index 42d785126..fa4f77209 100644
--- a/zenserver/projectstore.cpp
+++ b/zenserver/projectstore.cpp
@@ -152,7 +152,8 @@ struct ProjectStore::OplogStorage : public RefCounted
}
else
{
- throw std::runtime_error(fmt::format("column family iteration failed for '{}': '{}'", RocksdbPath, Status.getState()).c_str());
+ throw std::runtime_error(
+ fmt::format("column family iteration failed for '{}': '{}'", RocksdbPath, Status.getState()).c_str());
}
Status = rocksdb::DB::Open(Options, RocksdbPath, ColumnDescriptors, &m_RocksDbColumnHandles, &Db);
diff --git a/zenserver/upstream/upstreamcache.cpp b/zenserver/upstream/upstreamcache.cpp
index 520833a3c..65624ef17 100644
--- a/zenserver/upstream/upstreamcache.cpp
+++ b/zenserver/upstream/upstreamcache.cpp
@@ -348,9 +348,10 @@ namespace detail {
if (!RefResult.Success)
{
- return {.Reason = fmt::format("upload cache record '{}/{}' FAILED, reason '{}'", CacheRecord.Key.Bucket,
- CacheRecord.Key.Hash,
- RefResult.Reason),
+ return {.Reason = fmt::format("upload cache record '{}/{}' FAILED, reason '{}'",
+ CacheRecord.Key.Bucket,
+ CacheRecord.Key.Hash,
+ RefResult.Reason),
.Success = false};
}
@@ -369,9 +370,10 @@ namespace detail {
if (!FinalizeResult.Success)
{
- return {.Reason = fmt::format("finalize cache record '{}/{}' FAILED, reason '{}'", CacheRecord.Key.Bucket,
- CacheRecord.Key.Hash,
- FinalizeResult.Reason),
+ return {.Reason = fmt::format("finalize cache record '{}/{}' FAILED, reason '{}'",
+ CacheRecord.Key.Bucket,
+ CacheRecord.Key.Hash,
+ FinalizeResult.Reason),
.Success = false};
}
@@ -387,9 +389,10 @@ namespace detail {
if (!FinalizeResult.Success)
{
- return {.Reason = fmt::format("finalize '{}/{}' FAILED, reason '{}'", CacheRecord.Key.Bucket,
- CacheRecord.Key.Hash,
- FinalizeResult.Reason),
+ return {.Reason = fmt::format("finalize '{}/{}' FAILED, reason '{}'",
+ CacheRecord.Key.Bucket,
+ CacheRecord.Key.Hash,
+ FinalizeResult.Reason),
.Success = false};
}
@@ -401,9 +404,10 @@ namespace detail {
Sb << MissingHash.ToHexString() << ",";
}
- return {.Reason = fmt::format("finalize '{}/{}' FAILED, still needs payload(s) '{}'", CacheRecord.Key.Bucket,
- CacheRecord.Key.Hash,
- Sb.ToString()),
+ return {.Reason = fmt::format("finalize '{}/{}' FAILED, still needs payload(s) '{}'",
+ CacheRecord.Key.Bucket,
+ CacheRecord.Key.Hash,
+ Sb.ToString()),
.Success = false};
}
}
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp
index 96b04bdcd..60691222b 100644
--- a/zenserver/zenserver.cpp
+++ b/zenserver/zenserver.cpp
@@ -70,7 +70,7 @@ ZEN_THIRD_PARTY_INCLUDES_END
#if !defined(ZEN_USE_SENTRY)
# if ZEN_PLATFORM_MAC && ZEN_ARCH_ARM64
- // vcpkg's sentry-native port does not support Arm on Mac.
+// vcpkg's sentry-native port does not support Arm on Mac.
# define ZEN_USE_SENTRY 0
# else
# define ZEN_USE_SENTRY 1
diff --git a/zenstore/filecas.cpp b/zenstore/filecas.cpp
index 533c99569..6c137e128 100644
--- a/zenstore/filecas.cpp
+++ b/zenstore/filecas.cpp
@@ -567,7 +567,8 @@ FileCasStrategy::IterateChunks(std::function<void(const IoHash& Hash, BasicFile&
}
}
- virtual bool VisitDirectory([[maybe_unused]] const std::filesystem::path& Parent, [[maybe_unused]] const path_view& DirectoryName) override
+ virtual bool VisitDirectory([[maybe_unused]] const std::filesystem::path& Parent,
+ [[maybe_unused]] const path_view& DirectoryName) override
{
return true;
}