2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 10:37:41 -04:00

Fix a cast error and check UUID size.

This commit is contained in:
2013-01-04 22:30:46 -08:00
committed by Darryl Pogue
parent f455ee25ec
commit 6681b1d596
4 changed files with 9 additions and 3 deletions

View File

@ -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<plUUID*>(fieldAddr)->AsString();
StrPrintf(dst, dstChars, L"hextoraw('%s')", tmp.c_str());
}

View File

@ -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()

View File

@ -45,6 +45,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <uuid/uuid.h>
// 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 )

View File

@ -43,10 +43,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifdef HS_BUILD_FOR_WIN32
#include <rpc.h>
// Check UUID size
static_assert(sizeof(plUUID) == sizeof(GUID), "plUUID and Win32 GUID types differ in size");
void plUUID::Clear()
{
UuidCreateNil( (GUID *)this );