From 55857f41584f8b519bee188d7ad301f75e98a4b5 Mon Sep 17 00:00:00 2001 From: Reece Date: Wed, 23 Mar 2022 19:32:33 +0000 Subject: [PATCH] [*] Recrinkle posters --- Include/Aurora/Hashing/CE/CE.hpp | 10 -------- Include/Aurora/Hashing/CE/fnv1.hpp | 35 ---------------------------- Include/Aurora/Hashing/Hashing.hpp | 4 +--- Include/auROXTL/auContainerUtils.hpp | 3 +++ Include/auROXTL/auFNV1Utils.hpp | 2 ++ Include/auROXTL/auHashUtils.hpp | 6 ++++- Include/auROXTL/auMemory.hpp | 3 +++ Include/auROXTL/auMemoryModel.hpp | 3 +++ Include/auROXTL/auStringUtils.hpp | 4 ++++ Include/auROXTL/auTuple.hpp | 3 +++ Include/auROXTL/auTupleUtils.hpp | 3 +++ Include/auROXTL/auTypes.hpp | 3 +++ Include/auROXTL/auVector.hpp | 3 +++ Include/auROXTL/auWin32Utils.hpp | 3 +++ 14 files changed, 36 insertions(+), 49 deletions(-) delete mode 100644 Include/Aurora/Hashing/CE/CE.hpp delete mode 100644 Include/Aurora/Hashing/CE/fnv1.hpp diff --git a/Include/Aurora/Hashing/CE/CE.hpp b/Include/Aurora/Hashing/CE/CE.hpp deleted file mode 100644 index 8e2aa751..00000000 --- a/Include/Aurora/Hashing/CE/CE.hpp +++ /dev/null @@ -1,10 +0,0 @@ -/*** - Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved. - - File: CE.hpp - Date: 2021-6-10 - Author: Reece -***/ -#pragma once - -#include "fnv1.hpp" \ No newline at end of file diff --git a/Include/Aurora/Hashing/CE/fnv1.hpp b/Include/Aurora/Hashing/CE/fnv1.hpp deleted file mode 100644 index a5fe450e..00000000 --- a/Include/Aurora/Hashing/CE/fnv1.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*** - Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved. - - File: fnv1.hpp - Date: 2021-6-10 - Author: Reece -***/ -#pragma once - -namespace Aurora::Hashing -{ - namespace CE - { - constexpr AuUInt64 kFnv1MagicVal64 = 0xcbf29ce484222325; - constexpr AuUInt64 kFnv1MagicPrime64 = 0x100000001b3; - - inline constexpr AuUInt64 fnv1a(const char *const str, const AuUInt64 value = kFnv1MagicVal64) noexcept - { - return (str[0] == '\0') ? value : fnv1a(&str[1], (value ^ AuUInt64(str[0])) * kFnv1MagicPrime64); - } - - inline constexpr AuUInt32 fnv1a_trunc(const char *const str) noexcept - { - return static_cast(fnv1a(str)); - } - - constexpr AuUInt32 kFnv1MagicVal32 = 0x811c9dc5; - constexpr AuUInt32 kFnv1MagicPrime32 = 0x01000193; - - inline constexpr AuUInt32 fnv1a_32(const char *const str, const AuUInt32 value = kFnv1MagicVal32) noexcept - { - return (str[0] == '\0') ? value : fnv1a_32(&str[1], (value ^ AuUInt32(str[0])) * kFnv1MagicPrime32); - } - } -} \ No newline at end of file diff --git a/Include/Aurora/Hashing/Hashing.hpp b/Include/Aurora/Hashing/Hashing.hpp index 14f3b299..3af6019a 100644 --- a/Include/Aurora/Hashing/Hashing.hpp +++ b/Include/Aurora/Hashing/Hashing.hpp @@ -9,6 +9,4 @@ #include "EHashType.hpp" #include "HashStream.hpp" -#include "Digests.hpp" - -#include "CE/fnv1.hpp" \ No newline at end of file +#include "Digests.hpp" \ No newline at end of file diff --git a/Include/auROXTL/auContainerUtils.hpp b/Include/auROXTL/auContainerUtils.hpp index f9d8f1ed..301f5d24 100644 --- a/Include/auROXTL/auContainerUtils.hpp +++ b/Include/auROXTL/auContainerUtils.hpp @@ -3,6 +3,9 @@ File: auContainerUtils.hpp Date: 2022-2-1 + File: AuroraUtils.hpp + File: auROXTLUtils.hpp + Date: 2021-6-9 Author: Reece ***/ #pragma once diff --git a/Include/auROXTL/auFNV1Utils.hpp b/Include/auROXTL/auFNV1Utils.hpp index ad7289b6..ba64182a 100644 --- a/Include/auROXTL/auFNV1Utils.hpp +++ b/Include/auROXTL/auFNV1Utils.hpp @@ -3,6 +3,8 @@ File: auFNV1Utils.hpp Date: 2022-3-23 + File: fnv1.hpp + Date: 2021-6-10 Author: Reece ***/ #pragma once diff --git a/Include/auROXTL/auHashUtils.hpp b/Include/auROXTL/auHashUtils.hpp index 228b0f31..0ec0b5d8 100644 --- a/Include/auROXTL/auHashUtils.hpp +++ b/Include/auROXTL/auHashUtils.hpp @@ -136,6 +136,10 @@ struct AuEnableHashCodeOnData { AuUInt HashCode() const { - return AuFnv1aType(*AuStaticCast(this)); + #if defined(AURORA_IS_32BIT) + return AuFnv1a32Runtime(AuStaticCast(this), sizeof(T)); + #else + return AuFnv1a64Runtime(AuStaticCast(this), sizeof(T)); + #endif } }; \ No newline at end of file diff --git a/Include/auROXTL/auMemory.hpp b/Include/auROXTL/auMemory.hpp index 5d16b20b..83da3028 100644 --- a/Include/auROXTL/auMemory.hpp +++ b/Include/auROXTL/auMemory.hpp @@ -3,6 +3,9 @@ File: auMemory.hpp Date: 2022-2-1 + File: AuroraUtils.hpp + File: auROXTLUtils.hpp + Date: 2021-6-9 Author: Reece ***/ #pragma once diff --git a/Include/auROXTL/auMemoryModel.hpp b/Include/auROXTL/auMemoryModel.hpp index b7b7381a..9bf0687a 100644 --- a/Include/auROXTL/auMemoryModel.hpp +++ b/Include/auROXTL/auMemoryModel.hpp @@ -3,6 +3,9 @@ File: auMemoryModel.hpp Date: 2022-2-1 + File: AuroraUtils.hpp + File: auROXTLUtils.hpp + Date: 2021-6-9 Author: Reece ***/ #pragma once diff --git a/Include/auROXTL/auStringUtils.hpp b/Include/auROXTL/auStringUtils.hpp index 70495307..048fed63 100644 --- a/Include/auROXTL/auStringUtils.hpp +++ b/Include/auROXTL/auStringUtils.hpp @@ -3,6 +3,9 @@ File: auStringUtils.hpp Date: 2022-2-1 + File: AuroraUtils.hpp + File: auROXTLUtils.hpp + Date: 2021-6-9 Author: Reece ***/ #pragma once @@ -114,6 +117,7 @@ static auline AuString AuToString(const T &obj) // locale independent and better optimized! return fmt::format("{}", obj); #else + // TODO: to_chars (locale independent) return AURORA_RUNTIME_TO_STRING(obj); #endif } \ No newline at end of file diff --git a/Include/auROXTL/auTuple.hpp b/Include/auROXTL/auTuple.hpp index 3947c940..ae7640c1 100644 --- a/Include/auROXTL/auTuple.hpp +++ b/Include/auROXTL/auTuple.hpp @@ -3,6 +3,9 @@ File: auTuple.hpp Date: 2022-2-1 + File: AuroraUtils.hpp + File: auROXTLUtils.hpp + Date: 2021-6-9 Author: Reece ***/ #pragma once diff --git a/Include/auROXTL/auTupleUtils.hpp b/Include/auROXTL/auTupleUtils.hpp index 824c4899..9e5282c8 100644 --- a/Include/auROXTL/auTupleUtils.hpp +++ b/Include/auROXTL/auTupleUtils.hpp @@ -3,6 +3,9 @@ File: auTupleUtils.hpp Date: 2022-2-1 + File: AuroraUtils.hpp + File: auROXTLUtils.hpp + Date: 2021-6-9 Author: Reece ***/ #pragma once diff --git a/Include/auROXTL/auTypes.hpp b/Include/auROXTL/auTypes.hpp index ff64cbfa..cbb37b72 100644 --- a/Include/auROXTL/auTypes.hpp +++ b/Include/auROXTL/auTypes.hpp @@ -3,6 +3,9 @@ File: auTypes.hpp Date: 2022-2-1 + File: AuroraUtils.hpp + File: auROXTLUtils.hpp + Date: 2021-6-9 Author: Reece ***/ #pragma once diff --git a/Include/auROXTL/auVector.hpp b/Include/auROXTL/auVector.hpp index e5932c6e..b892ffef 100644 --- a/Include/auROXTL/auVector.hpp +++ b/Include/auROXTL/auVector.hpp @@ -3,6 +3,9 @@ File: auVector.hpp Date: 2022-2-1 + File: AuroraUtils.hpp + File: auROXTLUtils.hpp + Date: 2021-6-9 Author: Reece ***/ #pragma once diff --git a/Include/auROXTL/auWin32Utils.hpp b/Include/auROXTL/auWin32Utils.hpp index 74fad27d..d791d4be 100644 --- a/Include/auROXTL/auWin32Utils.hpp +++ b/Include/auROXTL/auWin32Utils.hpp @@ -3,6 +3,9 @@ File: auWin32Utils.hpp Date: 2022-2-1 + File: AuroraUtils.hpp + File: auROXTLUtils.hpp + Date: 2021-6-9 Author: Reece ***/ #pragma once