Browse Source

Fix plKeyImp warning about comparison of this and nullptr.

Darryl Pogue 9 years ago
parent
commit
608afb4270
  1. 6
      Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp
  2. 3
      Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.h

6
Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp

@ -74,6 +74,10 @@ bool IsTrackedKey(const plKeyImp* key)
}
#endif
hsKeyedObject* plKeyImp::SafeGetObject(const plKeyImp* key) {
return key ? key->fObjectPtr : nullptr;
}
plKeyImp::plKeyImp() :
fObjectPtr(nil),
fStartPos(-1),
@ -156,7 +160,7 @@ hsKeyedObject* plKeyImp::GetObjectPtr()
hsKeyedObject* plKeyImp::ObjectIsLoaded() const
{
return this ? fObjectPtr : nil;
return plKeyImp::SafeGetObject(this);
}
// Copy the contents of p for cloning process

3
Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.h

@ -53,6 +53,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//------------------------------------
class plKeyImp : public plKeyData
{
private:
static hsKeyedObject* SafeGetObject(const plKeyImp* key);
public:
plKeyImp();
plKeyImp(plUoid, uint32_t pos,uint32_t len);

Loading…
Cancel
Save