1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Re-define nil as nullptr, cleaning up some potential issues along the way

This commit is contained in:
2013-01-20 20:48:41 -08:00
parent c65ac61fb8
commit f86b549293
36 changed files with 123 additions and 130 deletions

View File

@ -120,15 +120,6 @@ static const char* CloneString(const plKeyData* keyData)
#endif
plKey::plKey() : fKeyData(nil)
{
}
plKey::plKey(void* ptr) : fKeyData(nil)
{
hsAssert(!ptr, "Attempting to publically construct a non-nil key");
}
plKey::plKey(const plKey& rhs) : fKeyData(rhs.fKeyData)
{
#if TRACK_REFS // FOR DEBUGGING ONLY
@ -143,13 +134,13 @@ plKey::plKey(const plKey& rhs) : fKeyData(rhs.fKeyData)
IIncRef();
}
plKey::plKey(plKeyData* data, bool ignore) : fKeyData(data)
plKey::plKey(plKeyData* data) : fKeyData(data)
{
#if TRACK_REFS // FOR DEBUGGING ONLY
if( IsTracked(fKeyData) )
{
char msg[ 512 ];
sprintf( msg, "C: Key %s %s is being constructed using the plKey(plKeyData*, bool) constructor", keyNameToLookFor, CloneString(fKeyData) );
sprintf( msg, "C: Key %s %s is being constructed using the plKey(plKeyData*) constructor", keyNameToLookFor, CloneString(fKeyData) );
//hsAssert( false, msg );
hsStatusMessageF(msg);
}

View File

@ -61,9 +61,9 @@ class plKey
{
public:
// Constructors and destructors and copy stuff
plKey();
plKey() : fKeyData(nullptr) { }
plKey(std::nullptr_t) : fKeyData(nullptr) { }
plKey(const plKey& rhs);
plKey(void* ptr); // For constructing a nil key
~plKey();
plKey& operator=(const plKey& rhs);
@ -77,7 +77,7 @@ public:
operator plKeyImp*() const { return (plKeyImp*)fKeyData; }
static plKey Make(plKeyData* data) { return plKey(data, false); }
static plKey Make(plKeyData* data) { return plKey(data); }
protected:
// Pointer to our real key
@ -86,7 +86,7 @@ protected:
void IDecRef();
// Internal constructor, extra param is to distinguish it from the void* constructor
plKey(plKeyData* data, bool ignore);
plKey(plKeyData* data);
};
//// plKeyData ///////////////////////////////////////////////////////////////