mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 03:09:13 +00:00
Remove all uses of GuidToString.
This commit is contained in:
@ -7,10 +7,12 @@ set(pnUUID_SOURCES
|
||||
|
||||
if(WIN32)
|
||||
set(pnUUID_SOURCES ${pnUUID_SOURCES} pnUUID_Win32.cpp)
|
||||
else(WIN32)
|
||||
set(pnUUID_SOURCES ${pnUUID_SOURCES} pnUUID_Unix.cpp)
|
||||
endif(WIN32)
|
||||
|
||||
if(UNIX)
|
||||
set(pnUUID_SOURCES ${pnUUID_SOURCES} pnUUID_Unix.cpp)
|
||||
endif(UNIX)
|
||||
|
||||
set(pnUUID_HEADERS
|
||||
pnUUID.h
|
||||
)
|
||||
|
@ -47,12 +47,7 @@ plUUID::plUUID()
|
||||
Clear();
|
||||
}
|
||||
|
||||
plUUID::plUUID(const plString & s)
|
||||
{
|
||||
FromString(s);
|
||||
}
|
||||
|
||||
plUUID::plUUID(const char * s)
|
||||
plUUID::plUUID(const plString& s)
|
||||
{
|
||||
FromString(s.c_str());
|
||||
}
|
||||
@ -67,13 +62,13 @@ plUUID::plUUID(const Uuid& uuid)
|
||||
memcpy(fData, uuid.data, sizeof(fData));
|
||||
}
|
||||
|
||||
void plUUID::Read(hsStream * s)
|
||||
void plUUID::Read(hsStream* s)
|
||||
{
|
||||
s->LogSubStreamPushDesc("plUUID");
|
||||
s->Read(sizeof(fData), (void*)fData);
|
||||
}
|
||||
|
||||
void plUUID::Write(hsStream * s)
|
||||
void plUUID::Write(hsStream* s)
|
||||
{
|
||||
s->Write(sizeof(fData), (const void*)fData);
|
||||
}
|
||||
|
@ -126,12 +126,4 @@ plUUID plUUID::Generate()
|
||||
return result;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// dummy function to prevent a linker warning complaining about no public symbols if the
|
||||
// contents of the file get compiled out via pre-processor
|
||||
void _preventLNK4221WarningStub()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -57,7 +57,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include <uuid/uuid.h>
|
||||
|
||||
COMPILER_ASSERT(sizeof(Uuid) >= sizeof(uuid_t));
|
||||
static_assert(sizeof(Uuid) >= sizeof(uuid_t), "UUID size does not match uuid_t");
|
||||
|
||||
#else
|
||||
|
||||
|
@ -147,30 +147,4 @@ bool GuidIsNil (const Uuid & uuid) {
|
||||
return 1 == UuidIsNil((GUID *)&uuid, &s );
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
const wchar_t * GuidToString (const Uuid & uuid, wchar_t * dst, unsigned chars) {
|
||||
wchar_t * src;
|
||||
RPC_STATUS s;
|
||||
s = UuidToStringW( (GUID *) &uuid, (unsigned short**)&src );
|
||||
if (RPC_S_OK == s)
|
||||
StrCopy(dst, src, chars);
|
||||
else
|
||||
StrCopy(dst, L"", chars);
|
||||
RpcStringFreeW( (unsigned short**)&src );
|
||||
return dst;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
const char * GuidToString (const Uuid & uuid, char * dst, unsigned chars) {
|
||||
uint8_t * src;
|
||||
RPC_STATUS s;
|
||||
s = UuidToStringA( (GUID *) &uuid, &src );
|
||||
if (RPC_S_OK == s)
|
||||
StrCopy(dst, (char *)src, chars);
|
||||
else
|
||||
StrCopy(dst, "", chars);
|
||||
RpcStringFreeA(&src);
|
||||
return dst;
|
||||
}
|
||||
|
||||
#endif // HS_BUILD_FOR_WIN32
|
||||
|
@ -64,17 +64,3 @@ Uuid::Uuid (const wchar_t str[]) {
|
||||
|
||||
GuidFromString(str, this);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
Uuid::Uuid (const uint8_t buf[], unsigned length) {
|
||||
|
||||
GuidFromHex(buf, length, this);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
bool GuidFromHex (const uint8_t buf[], unsigned length, Uuid * uuid) {
|
||||
|
||||
ASSERT(length == sizeof(uuid->data));
|
||||
memcpy(uuid->data, buf, sizeof(uuid->data));
|
||||
return true;
|
||||
}
|
||||
|
@ -80,9 +80,6 @@ bool GuidFromString (const char str[], Uuid * uuid);
|
||||
int GuidCompare (const Uuid & a, const Uuid & b);
|
||||
inline bool GuidsAreEqual (const Uuid & a, const Uuid & b) { return 0 == GuidCompare(a, b); }
|
||||
bool GuidIsNil (const Uuid & uuid);
|
||||
const wchar_t * GuidToString (const Uuid & uuid, wchar_t * dst, unsigned chars); // returns dst
|
||||
const char * GuidToString (const Uuid & uuid, char * dst, unsigned chars); // returns dst
|
||||
bool GuidFromHex (const uint8_t buf[], unsigned length, Uuid * uuid);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
@ -100,7 +97,6 @@ struct Uuid {
|
||||
|
||||
Uuid () {}
|
||||
Uuid (const wchar_t str[]);
|
||||
Uuid (const uint8_t buf[], unsigned length);
|
||||
operator bool () const { return !GuidIsNil(*this); }
|
||||
inline bool operator ! () const { return GuidIsNil(*this); }
|
||||
inline bool operator < (const Uuid & rhs) const { return GuidCompare(*this, rhs) < 0; }
|
||||
|
Reference in New Issue
Block a user