diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp index 51ffd96e..fa3a7d9a 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp @@ -977,7 +977,7 @@ void NetVaultNodeFieldArray::GetFieldValueString_LCS ( case NetVaultNode::kUuid_2: case NetVaultNode::kUuid_3: case NetVaultNode::kUuid_4: { - plString tmp = plUUID((char*)fieldAddr).AsString(); + plString tmp = reinterpret_cast(fieldAddr)->AsString(); StrPrintf(dst, dstChars, L"hextoraw('%s')", tmp.c_str()); } diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp index 05bbc5ca..8ba9be82 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp @@ -42,6 +42,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUUID.h" #include "hsStream.h" +static_assert(sizeof(plUUID) == sizeof(uint8_t[16]), "plUUID Must be the same size as a UUID"); + const plUUID kNilUuid; plUUID::plUUID() diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp index 2154bfa1..2b1a5a41 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp @@ -45,6 +45,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include +// Check UUID size +static_assert(sizeof(plUUID) == sizeof(uuid_t), "plUUID and uuid_t types differ in size"); + struct plUUIDHelper { static inline void CopyToPlasma( plUUID * dst, const uuid_t & src ) diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp index 7eb4fbd9..aaf86253 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp @@ -43,10 +43,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifdef HS_BUILD_FOR_WIN32 - - #include +// Check UUID size +static_assert(sizeof(plUUID) == sizeof(GUID), "plUUID and Win32 GUID types differ in size"); + void plUUID::Clear() { UuidCreateNil( (GUID *)this );