aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-02 18:08:48 +0200
committerStefan Boberg <[email protected]>2021-09-02 18:08:48 +0200
commit8fdc9549bde4e454b47be5149989c1f10fe635ae (patch)
tree7632ab04a38061a83a90a466869951988a053213
parentIoHash::HashMemory -> IoHash::HashBuffer for consistency with UE5 code (diff)
downloadzen-8fdc9549bde4e454b47be5149989c1f10fe635ae.tar.xz
zen-8fdc9549bde4e454b47be5149989c1f10fe635ae.zip
Made IoHash::Zero const, made IoHash alignment explicit
-rw-r--r--zencore/include/zencore/iohash.h4
-rw-r--r--zencore/iohash.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/zencore/include/zencore/iohash.h b/zencore/include/zencore/iohash.h
index 475bfe447..4a8fcd03f 100644
--- a/zencore/include/zencore/iohash.h
+++ b/zencore/include/zencore/iohash.h
@@ -25,7 +25,7 @@ class CompositeBuffer;
*/
struct IoHash
{
- uint8_t Hash[20];
+ alignas(uint32_t) uint8_t Hash[20];
static IoHash MakeFrom(const void* data /* 20 bytes */)
{
@@ -53,7 +53,7 @@ struct IoHash
static const int StringLength = 40;
typedef char String_t[StringLength + 1];
- static IoHash Zero; // Initialized to all zeros
+ static const IoHash Zero; // Initialized to all zeros
inline auto operator<=>(const IoHash& rhs) const = default;
diff --git a/zencore/iohash.cpp b/zencore/iohash.cpp
index 2b9bec120..fbfaf8363 100644
--- a/zencore/iohash.cpp
+++ b/zencore/iohash.cpp
@@ -11,7 +11,7 @@
namespace zen {
-IoHash IoHash::Zero; // Initialized to all zeros
+const IoHash IoHash::Zero; // Initialized to all zeros
IoHash
IoHash::HashBuffer(const void* data, size_t byteCount)