diff options
| author | Stefan Boberg <[email protected]> | 2021-08-20 13:54:05 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-08-20 13:54:05 +0200 |
| commit | 25dc6d46f65f0f3d20a5ad1da573f9267f2af2c2 (patch) | |
| tree | c79f022ae3574aae7b803c84f0b07a4fe3b4adcd | |
| parent | CL16570338: CompactBinary: Added validation to LoadCompactBinary and removed ... (diff) | |
| download | zen-25dc6d46f65f0f3d20a5ad1da573f9267f2af2c2.tar.xz zen-25dc6d46f65f0f3d20a5ad1da573f9267f2af2c2.zip | |
clang-format
| -rw-r--r-- | zencore/compactbinary.cpp | 4 | ||||
| -rw-r--r-- | zencore/include/zencore/compactbinary.h | 5 | ||||
| -rw-r--r-- | zencore/include/zencore/uid.h | 6 | ||||
| -rw-r--r-- | zencore/uid.cpp | 6 | ||||
| -rw-r--r-- | zenserver/cache/structuredcachestore.cpp | 2 | ||||
| -rw-r--r-- | zenserver/upstream/zen.cpp | 2 |
6 files changed, 11 insertions, 14 deletions
diff --git a/zencore/compactbinary.cpp b/zencore/compactbinary.cpp index 73ca9832f..b759e219e 100644 --- a/zencore/compactbinary.cpp +++ b/zencore/compactbinary.cpp @@ -2,10 +2,10 @@ #include "zencore/compactbinary.h" -#include "zencore/compactbinaryvalidation.h" #include <zencore/endian.h> #include <zencore/stream.h> #include <zencore/trace.h> +#include "zencore/compactbinaryvalidation.h" #include <doctest/doctest.h> #include <string_view> @@ -1091,7 +1091,7 @@ LoadCompactBinary(BinaryReader& Ar, BufferAllocator Allocator) } if (ValidateCompactBinary(Buffer, CbValidateMode::Default) != CbValidateError::None) { - return CbField(); + return CbField(); } return CbField(SharedBuffer(std::move(Buffer))); } diff --git a/zencore/include/zencore/compactbinary.h b/zencore/include/zencore/compactbinary.h index 4c9b48d3a..2dc9c0ce0 100644 --- a/zencore/include/zencore/compactbinary.h +++ b/zencore/include/zencore/compactbinary.h @@ -297,10 +297,7 @@ public: static constexpr inline bool IsFloat(CbFieldType Type) { return (Type & FloatMask) == FloatBase; } static constexpr inline bool IsBool(CbFieldType Type) { return (Type & BoolMask) == BoolBase; } - static constexpr inline bool IsObjectAttachment(CbFieldType Type) - { - return GetType(Type) == CbFieldType::ObjectAttachment; - } + static constexpr inline bool IsObjectAttachment(CbFieldType Type) { return GetType(Type) == CbFieldType::ObjectAttachment; } static constexpr inline bool IsBinaryAttachment(CbFieldType Type) { return GetType(Type) == CbFieldType::BinaryAttachment; } static constexpr inline bool IsAttachment(CbFieldType Type) { return (Type & AttachmentMask) == AttachmentBase; } diff --git a/zencore/include/zencore/uid.h b/zencore/include/zencore/uid.h index 2e2871910..2730b1415 100644 --- a/zencore/include/zencore/uid.h +++ b/zencore/include/zencore/uid.h @@ -42,9 +42,9 @@ class StringBuilderBase; ordered lexicographically. I.e they are in big-endian byte order. NOTE: The information above is only meant to explain the properties of - the identifiers. Client code should simply treat the identifier as an - opaque value and may not make any assumptions on the structure, as there - may be other ways of generating the identifiers in the future if an + the identifiers. Client code should simply treat the identifier as an + opaque value and may not make any assumptions on the structure, as there + may be other ways of generating the identifiers in the future if an application benefits. */ diff --git a/zencore/uid.cpp b/zencore/uid.cpp index b22ac7896..644d0aa77 100644 --- a/zencore/uid.cpp +++ b/zencore/uid.cpp @@ -35,7 +35,7 @@ Oid::Initialize() if (!detail::OidInitialised) { std::random_device Rng; - detail::RunId = Rng(); + detail::RunId = Rng(); detail::Serial = Rng(); detail::OidInitialised = true; @@ -50,8 +50,8 @@ Oid::Generate() Oid::Initialize(); } - const uint64_t kOffset = 1'609'459'200; // Seconds from 1970 -> 2021 - const uint64_t Time = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()) - kOffset; + const uint64_t kOffset = 1'609'459'200; // Seconds from 1970 -> 2021 + const uint64_t Time = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()) - kOffset; OidBits[0] = ToNetworkOrder(uint32_t(Time)); OidBits[1] = ToNetworkOrder(uint32_t(++detail::Serial)); diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp index e6eda05aa..fe662267c 100644 --- a/zenserver/cache/structuredcachestore.cpp +++ b/zenserver/cache/structuredcachestore.cpp @@ -233,7 +233,7 @@ struct ZenCacheDiskLayer::CacheBucket CacheBucket(CasStore& Cas); ~CacheBucket(); - void OpenOrCreate(std::filesystem::path BucketDir); + void OpenOrCreate(std::filesystem::path BucketDir); static bool Delete(std::filesystem::path BucketDir); bool Get(const zen::IoHash& HashKey, ZenCacheValue& OutValue); diff --git a/zenserver/upstream/zen.cpp b/zenserver/upstream/zen.cpp index c6f271e14..f7fe56a8b 100644 --- a/zenserver/upstream/zen.cpp +++ b/zenserver/upstream/zen.cpp @@ -387,7 +387,7 @@ ZenStructuredCacheSession::Get(std::string_view BucketId, const IoHash& Key) return {}; } -IoBuffer +IoBuffer ZenStructuredCacheSession::Get(std::string_view BucketId, const IoHash& Key, const IoHash& ContentId) { ZEN_UNUSED(BucketId, Key, ContentId); |