From d35df614722024ccdb746332eceda2b7a6cd0b80 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Mon, 21 Mar 2022 12:42:45 +0100 Subject: clang-format --- zencore/compactbinary.cpp | 4 ++-- zencore/filesystem.cpp | 2 +- zencore/include/zencore/iobuffer.h | 3 +-- zencore/include/zencore/refcount.h | 5 ++--- zencore/include/zencore/zencore.h | 15 ++++++++------- zencore/iobuffer.cpp | 2 +- zencore/thread.cpp | 6 +++--- 7 files changed, 18 insertions(+), 19 deletions(-) (limited to 'zencore') diff --git a/zencore/compactbinary.cpp b/zencore/compactbinary.cpp index 7cc6db68a..808e4f39a 100644 --- a/zencore/compactbinary.cpp +++ b/zencore/compactbinary.cpp @@ -54,7 +54,7 @@ GetPlatformToDateTimeBiasInSeconds() #if ZEN_PLATFORM_WINDOWS const uint64_t PlatformEpochYear = 1601; #else - const uint64_t PlatformEpochYear = 1970; + const uint64_t PlatformEpochYear = 1970; #endif const uint64_t DateTimeEpochYear = 1; return uint64_t(double(PlatformEpochYear - DateTimeEpochYear) * 365.2425) * 86400; @@ -71,7 +71,7 @@ DateTime::Now() GetSystemTimeAsFileTime(&SysTime); return DateTime{(EpochBias * SecsTo100nsTicks) + (uint64_t(SysTime.dwHighDateTime) << 32) | SysTime.dwLowDateTime}; #else - int64_t SecondsSinceUnixEpoch = time(nullptr); + int64_t SecondsSinceUnixEpoch = time(nullptr); return DateTime{(EpochBias + SecondsSinceUnixEpoch) * SecsTo100nsTicks}; #endif } diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp index 79563190c..041abaf1d 100644 --- a/zencore/filesystem.cpp +++ b/zencore/filesystem.cpp @@ -707,7 +707,7 @@ ScanFile(std::filesystem::path Path, const uint64_t ChunkSize, std::functionRelease(); } template - requires DerivedFrom inline Ref(const Ref& Rhs) : Ref(Rhs.m_Ref) - { - } + requires DerivedFrom + inline Ref(const Ref& Rhs) : Ref(Rhs.m_Ref) {} [[nodiscard]] inline bool IsNull() const { return m_Ref == nullptr; } inline explicit operator bool() const { return m_Ref != nullptr; } diff --git a/zencore/include/zencore/zencore.h b/zencore/include/zencore/zencore.h index 60ebd0f5f..1e5689d87 100644 --- a/zencore/include/zencore/zencore.h +++ b/zencore/include/zencore/zencore.h @@ -154,7 +154,7 @@ concept DerivedFrom = std::derived_from; template concept Integral = std::is_integral_v; template -concept SignedIntegral = Integral&& std::is_signed_v; +concept SignedIntegral = Integral && std::is_signed_v; template concept UnsignedIntegral = Integral && !std::is_signed_v; template @@ -163,7 +163,7 @@ concept Invocable = requires(F&& f, A&&... a) std::invoke(std::forward(f), std::forward(a)...); }; template -concept DerivedFrom = std::is_base_of_v&& std::is_convertible_v; +concept DerivedFrom = std::is_base_of_v && std::is_convertible_v; #endif #if defined(__cpp_lib_ranges) @@ -240,12 +240,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 diff --git a/zencore/iobuffer.cpp b/zencore/iobuffer.cpp index 57abbfb48..e2aaa3169 100644 --- a/zencore/iobuffer.cpp +++ b/zencore/iobuffer.cpp @@ -513,7 +513,7 @@ IoBufferBuilder::MakeFromTemporaryFile(const std::filesystem::path& FileName) Handle = DataFile.Detach(); #else - int Fd = open(FileName.native().c_str(), O_RDONLY); + int Fd = open(FileName.native().c_str(), O_RDONLY); if (Fd < 0) { return {}; diff --git a/zencore/thread.cpp b/zencore/thread.cpp index c2ecc8d72..77b75bae3 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -180,7 +180,7 @@ Event::Set() #if ZEN_PLATFORM_WINDOWS SetEvent(m_EventHandle); #else - auto* Inner = (EventInner*)m_EventHandle; + auto* Inner = (EventInner*)m_EventHandle; { std::unique_lock Lock(Inner->Mutex); Inner->bSet = true; @@ -334,7 +334,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) { @@ -599,7 +599,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) -- cgit v1.2.3