Browse Source

Fix a cast error and check UUID size.

Michael Hansen 12 years ago committed by Darryl Pogue
parent
commit
6681b1d596
  1. 2
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp
  2. 2
      Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp
  3. 3
      Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp
  4. 5
      Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp

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

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

3
Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp

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

5
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 <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 );

Loading…
Cancel
Save