diff options
| -rw-r--r-- | zencore-test/zencore-test.cpp | 2 | ||||
| -rw-r--r-- | zencore/except.cpp | 2 | ||||
| -rw-r--r-- | zencore/include/zencore/atomic.h | 4 | ||||
| -rw-r--r-- | zencore/include/zencore/except.h | 2 | ||||
| -rw-r--r-- | zencore/include/zencore/intmath.h | 2 | ||||
| -rw-r--r-- | zencore/include/zencore/iobuffer.h | 16 | ||||
| -rw-r--r-- | zencore/include/zencore/memory.h | 10 | ||||
| -rw-r--r-- | zencore/include/zencore/session.h | 4 | ||||
| -rw-r--r-- | zencore/include/zencore/zencore.h | 49 | ||||
| -rw-r--r-- | zencore/intmath.cpp | 2 | ||||
| -rw-r--r-- | zencore/memory.cpp | 6 | ||||
| -rw-r--r-- | zencore/session.cpp | 15 | ||||
| -rw-r--r-- | zencore/zencore.cpp | 6 | ||||
| -rw-r--r-- | zenhttp/httpshared.h | 4 | ||||
| -rw-r--r-- | zenhttp/include/zenhttp/httpclient.h | 4 | ||||
| -rw-r--r-- | zenhttp/include/zenhttp/httpshared.h | 4 | ||||
| -rw-r--r-- | zenhttp/include/zenhttp/zenhttp.h | 4 | ||||
| -rw-r--r-- | zenhttp/zenhttp.cpp | 6 |
18 files changed, 74 insertions, 68 deletions
diff --git a/zencore-test/zencore-test.cpp b/zencore-test/zencore-test.cpp index 1782f1926..559349076 100644 --- a/zencore-test/zencore-test.cpp +++ b/zencore-test/zencore-test.cpp @@ -1,8 +1,8 @@ // zencore-test.cpp : Defines the entry point for the console application. // -#include <zencore/zencore.h> #include <zencore/logging.h> +#include <zencore/zencore.h> #define DOCTEST_CONFIG_IMPLEMENT #include <doctest/doctest.h> diff --git a/zencore/except.cpp b/zencore/except.cpp index 834585522..9bf043f4a 100644 --- a/zencore/except.cpp +++ b/zencore/except.cpp @@ -20,7 +20,7 @@ ThrowSystemException([[maybe_unused]] HRESULT hRes, [[maybe_unused]] std::string } } -#endif // ZEN_PLATFORM_WINDOWS +#endif // ZEN_PLATFORM_WINDOWS void ThrowLastError(std::string_view Message) diff --git a/zencore/include/zencore/atomic.h b/zencore/include/zencore/atomic.h index 7e261771b..bf549e21d 100644 --- a/zencore/include/zencore/atomic.h +++ b/zencore/include/zencore/atomic.h @@ -5,9 +5,9 @@ #include <zencore/zencore.h> #if ZEN_COMPILER_MSC -#include <intrin.h> +# include <intrin.h> #else -#include <atomic> +# include <atomic> #endif #include <cinttypes> diff --git a/zencore/include/zencore/except.h b/zencore/include/zencore/except.h index 36cca895f..08330e4bc 100644 --- a/zencore/include/zencore/except.h +++ b/zencore/include/zencore/except.h @@ -51,7 +51,7 @@ private: }; ZENCORE_API void ThrowSystemException(HRESULT hRes, std::string_view Message); -#endif // ZEN_PLATFORM_WINDOWS +#endif // ZEN_PLATFORM_WINDOWS ZENCORE_API void ThrowLastError(std::string_view Message); diff --git a/zencore/include/zencore/intmath.h b/zencore/include/zencore/intmath.h index 814a03df4..b127c8993 100644 --- a/zencore/include/zencore/intmath.h +++ b/zencore/include/zencore/intmath.h @@ -179,6 +179,6 @@ Max(auto x, auto y) ////////////////////////////////////////////////////////////////////////// -void intmath_forcelink(); // internal +void intmath_forcelink(); // internal } // namespace zen diff --git a/zencore/include/zencore/iobuffer.h b/zencore/include/zencore/iobuffer.h index f8b8217d7..517cc7b69 100644 --- a/zencore/include/zencore/iobuffer.h +++ b/zencore/include/zencore/iobuffer.h @@ -13,14 +13,14 @@ struct IoBufferExtendedCore; enum class ZenContentType : uint8_t { - kBinary = 0, // Note that since this is zero, this will be the default value in IoBuffer - kText = 1, - kJSON = 2, - kCbObject = 3, - kCbPackage = 4, - kYAML = 5, - kCbPackageOffer = 6, - kCompressedBinary = 7, + kBinary = 0, // Note that since this is zero, this will be the default value in IoBuffer + kText = 1, + kJSON = 2, + kCbObject = 3, + kCbPackage = 4, + kYAML = 5, + kCbPackageOffer = 6, + kCompressedBinary = 7, kUnknownContentType = 8, kCOUNT }; diff --git a/zencore/include/zencore/memory.h b/zencore/include/zencore/memory.h index 9d6339595..3d4db1081 100644 --- a/zencore/include/zencore/memory.h +++ b/zencore/include/zencore/memory.h @@ -83,7 +83,7 @@ struct MutableMemoryView { } - inline bool IsEmpty() const { return m_Data == m_DataEnd; } + inline bool IsEmpty() const { return m_Data == m_DataEnd; } void* GetData() const { return m_Data; } void* GetDataEnd() const { return m_DataEnd; } size_t GetSize() const { return reinterpret_cast<uint8_t*>(m_DataEnd) - reinterpret_cast<uint8_t*>(m_Data); } @@ -194,10 +194,10 @@ struct MemoryView { } - inline bool Contains(const MemoryView& Other) const { return (m_Data <= Other.m_Data) && (m_DataEnd >= Other.m_DataEnd); } - inline bool IsEmpty() const { return m_Data == m_DataEnd; } - const void* GetData() const { return m_Data; } - const void* GetDataEnd() const { return m_DataEnd; } + inline bool Contains(const MemoryView& Other) const { return (m_Data <= Other.m_Data) && (m_DataEnd >= Other.m_DataEnd); } + inline bool IsEmpty() const { return m_Data == m_DataEnd; } + const void* GetData() const { return m_Data; } + const void* GetDataEnd() const { return m_DataEnd; } size_t GetSize() const { return reinterpret_cast<const uint8_t*>(m_DataEnd) - reinterpret_cast<const uint8_t*>(m_Data); } inline bool operator==(const MemoryView& Rhs) const { return m_Data == Rhs.m_Data && m_DataEnd == Rhs.m_DataEnd; } diff --git a/zencore/include/zencore/session.h b/zencore/include/zencore/session.h index e66794704..2da41b2c8 100644 --- a/zencore/include/zencore/session.h +++ b/zencore/include/zencore/session.h @@ -1,3 +1,5 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + #pragma once #include <zencore/zencore.h> @@ -8,4 +10,4 @@ struct Oid; ZENCORE_API Oid GetSessionId(); -} +} // namespace zen diff --git a/zencore/include/zencore/zencore.h b/zencore/include/zencore/zencore.h index abea4ecc8..54df7e85e 100644 --- a/zencore/include/zencore/zencore.h +++ b/zencore/include/zencore/zencore.h @@ -10,39 +10,39 @@ // Platform // -#define ZEN_PLATFORM_WINDOWS 0 -#define ZEN_PLATFORM_LINUX 0 -#define ZEN_PLATFORM_MACOS 0 +#define ZEN_PLATFORM_WINDOWS 0 +#define ZEN_PLATFORM_LINUX 0 +#define ZEN_PLATFORM_MACOS 0 #ifdef _WIN32 -# undef ZEN_PLATFORM_WINDOWS -# define ZEN_PLATFORM_WINDOWS 1 +# undef ZEN_PLATFORM_WINDOWS +# define ZEN_PLATFORM_WINDOWS 1 #elif defined(__linux__) -# undef ZEN_PLATFORM_LINUX -# define ZEN_PLATFORM_LINUX 1 +# undef ZEN_PLATFORM_LINUX +# define ZEN_PLATFORM_LINUX 1 #elif defined(__APPLE__) -# undef ZEN_PLATFORM_MACOS -# define ZEN_PLATFORM_MACOS 1 +# undef ZEN_PLATFORM_MACOS +# define ZEN_PLATFORM_MACOS 1 #endif ////////////////////////////////////////////////////////////////////////// // Compiler // -#define ZEN_COMPILER_CLANG 0 -#define ZEN_COMPILER_MSC 0 -#define ZEN_COMPILER_GCC 0 +#define ZEN_COMPILER_CLANG 0 +#define ZEN_COMPILER_MSC 0 +#define ZEN_COMPILER_GCC 0 // Clang can define __GNUC__ and/or _MSC_VER so we check for Clang first #ifdef __clang__ -# undef ZEN_COMPILER_CLANG -# define ZEN_COMPILER_CLANG 1 +# undef ZEN_COMPILER_CLANG +# define ZEN_COMPILER_CLANG 1 #elif defined(_MSC_VER) -# undef ZEN_COMPILER_MSC -# define ZEN_COMPILER_MSC 1 +# undef ZEN_COMPILER_MSC +# define ZEN_COMPILER_MSC 1 #elif defined(__GNUC__) -# undef ZEN_COMPILER_GCC -# define ZEN_COMPILER_GCC 1 +# undef ZEN_COMPILER_GCC +# define ZEN_COMPILER_GCC 1 #else # error Unknown compiler #endif @@ -56,17 +56,16 @@ # endif #endif - ////////////////////////////////////////////////////////////////////////// // Architecture // #if defined(__amd64__) || defined(_M_X64) -# define ZEN_ARCH_X64 1 -# define ZEN_ARCH_ARM64 0 +# define ZEN_ARCH_X64 1 +# define ZEN_ARCH_ARM64 0 #elif defined(__arm64__) || defined(_M_ARM64) -# define ZEN_ARCH_X64 0 -# define ZEN_ARCH_ARM64 1 +# define ZEN_ARCH_X64 0 +# define ZEN_ARCH_ARM64 1 #else # error Unknown architecture #endif @@ -142,9 +141,9 @@ char (&ZenArrayCountHelper(const T (&)[N]))[N + 1]; ////////////////////////////////////////////////////////////////////////// #if ZEN_COMPILER_MSC -# define ZEN_NOINLINE __declspec(noinline) +# define ZEN_NOINLINE __declspec(noinline) #else -# define ZEN_NOINLINE __attribute__((noinline)) +# define ZEN_NOINLINE __attribute__((noinline)) #endif #define ZEN_UNUSED(...) ((void)__VA_ARGS__) diff --git a/zencore/intmath.cpp b/zencore/intmath.cpp index 4039a3b39..2acfaebd8 100644 --- a/zencore/intmath.cpp +++ b/zencore/intmath.cpp @@ -53,4 +53,4 @@ TEST_CASE("intmath") CHECK(CountTrailingZeros64(0x0000'0001'0000'0000ull) == 32); } -} // namespace zen +} // namespace zen diff --git a/zencore/memory.cpp b/zencore/memory.cpp index 9c7fb8333..26c8321e5 100644 --- a/zencore/memory.cpp +++ b/zencore/memory.cpp @@ -15,7 +15,8 @@ namespace zen { ////////////////////////////////////////////////////////////////////////// -static void* AlignedAllocImpl(size_t size, size_t alignment) +static void* +AlignedAllocImpl(size_t size, size_t alignment) { #if ZEN_PLATFORM_WINDOWS // return _aligned_malloc(size, alignment); // MSVC alternative @@ -26,7 +27,8 @@ static void* AlignedAllocImpl(size_t size, size_t alignment) #endif } -void AlignedFreeImpl(void* ptr) +void +AlignedFreeImpl(void* ptr) { if (ptr == nullptr) return; diff --git a/zencore/session.cpp b/zencore/session.cpp index 195a9d97c..d57d3685b 100644 --- a/zencore/session.cpp +++ b/zencore/session.cpp @@ -1,3 +1,5 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + #include "zencore/session.h" #include <zencore/uid.h> @@ -6,16 +8,15 @@ namespace zen { -static Oid GlobalSessionId; +static Oid GlobalSessionId; static std::once_flag SessionInitFlag; -Oid GetSessionId() +Oid +GetSessionId() { - std::call_once(SessionInitFlag, [&] { - GlobalSessionId.Generate(); - }); + std::call_once(SessionInitFlag, [&] { GlobalSessionId.Generate(); }); - return GlobalSessionId; + return GlobalSessionId; } -}
\ No newline at end of file +} // namespace zen
\ No newline at end of file diff --git a/zencore/zencore.cpp b/zencore/zencore.cpp index c53fd218f..f179880e4 100644 --- a/zencore/zencore.cpp +++ b/zencore/zencore.cpp @@ -3,11 +3,11 @@ #include <zencore/zencore.h> #if ZEN_PLATFORM_WINDOWS -#include <zencore/windows.h> +# include <zencore/windows.h> #endif #if ZEN_PLATFORM_LINUX -#include <pthread.h> +# include <pthread.h> #endif #include <zencore/blake3.h> @@ -44,7 +44,7 @@ IsPointerToStack(const void* ptr) pthread_attr_t attr; pthread_getattr_np(self, &attr); - void* low; + void* low; size_t size; pthread_attr_getstack(&attr, &low, &size); diff --git a/zenhttp/httpshared.h b/zenhttp/httpshared.h index 06dc4a872..92c1ef9c6 100644 --- a/zenhttp/httpshared.h +++ b/zenhttp/httpshared.h @@ -33,8 +33,8 @@ struct CbAttachmentEntry enum { - kIsCompressed = (1u << 0), // Is marshaled using compressed buffer storage format - kIsObject = (1u << 1), // Is compact binary object + kIsCompressed = (1u << 0), // Is marshaled using compressed buffer storage format + kIsObject = (1u << 1), // Is compact binary object }; }; diff --git a/zenhttp/include/zenhttp/httpclient.h b/zenhttp/include/zenhttp/httpclient.h index 3e342f2bd..aa36a8027 100644 --- a/zenhttp/include/zenhttp/httpclient.h +++ b/zenhttp/include/zenhttp/httpclient.h @@ -24,8 +24,8 @@ namespace zen { class CbPackage; /** HTTP client implementation for Zen use cases - - Currently simple and synchronous, should become lean and asynchronous + + Currently simple and synchronous, should become lean and asynchronous */ class HttpClient { diff --git a/zenhttp/include/zenhttp/httpshared.h b/zenhttp/include/zenhttp/httpshared.h index 06dc4a872..92c1ef9c6 100644 --- a/zenhttp/include/zenhttp/httpshared.h +++ b/zenhttp/include/zenhttp/httpshared.h @@ -33,8 +33,8 @@ struct CbAttachmentEntry enum { - kIsCompressed = (1u << 0), // Is marshaled using compressed buffer storage format - kIsObject = (1u << 1), // Is compact binary object + kIsCompressed = (1u << 0), // Is marshaled using compressed buffer storage format + kIsObject = (1u << 1), // Is compact binary object }; }; diff --git a/zenhttp/include/zenhttp/zenhttp.h b/zenhttp/include/zenhttp/zenhttp.h index 586fc98b4..165f34b48 100644 --- a/zenhttp/include/zenhttp/zenhttp.h +++ b/zenhttp/include/zenhttp/zenhttp.h @@ -8,6 +8,6 @@ namespace zen { - ZENHTTP_API void zenhttp_forcelinktests(); - +ZENHTTP_API void zenhttp_forcelinktests(); + } diff --git a/zenhttp/zenhttp.cpp b/zenhttp/zenhttp.cpp index 148cf4499..637486f55 100644 --- a/zenhttp/zenhttp.cpp +++ b/zenhttp/zenhttp.cpp @@ -1,3 +1,5 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + #include <zenhttp/zenhttp.h> #include <zenhttp/httpserver.h> @@ -7,7 +9,7 @@ namespace zen { void zenhttp_forcelinktests() { - http_forcelink(); + http_forcelink(); } -}
\ No newline at end of file +} // namespace zen
\ No newline at end of file |