From 9d67b9683701a9b2db7011f9fc133469272e86ba Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Sat, 9 Aug 2014 12:16:25 -0700 Subject: [PATCH] Fix some errors and warnings when compiling with Clang --- Sources/Plasma/CoreLib/hsRefCnt.h | 5 +++-- Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.h | 1 + Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/CoreLib/hsRefCnt.h b/Sources/Plasma/CoreLib/hsRefCnt.h index 78ac15f0..8ed42012 100644 --- a/Sources/Plasma/CoreLib/hsRefCnt.h +++ b/Sources/Plasma/CoreLib/hsRefCnt.h @@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define hsRefCnt_Defiend #include +#include class hsRefCnt { private: @@ -83,7 +84,7 @@ class hsRef { public: hsRef() : fObj(nullptr) { } - hsRef(nullptr_t) : fObj(nullptr) { } + hsRef(std::nullptr_t) : fObj(nullptr) { } hsRef(_Ref *obj) : fObj(obj) { if (fObj) fObj->Ref(); } hsRef(const hsRef<_Ref> ©) : fObj(copy.fObj) { if (fObj) fObj->Ref(); } hsRef(hsRef<_Ref> &&move) : fObj(move.fObj) { move.fObj = nullptr; } @@ -110,7 +111,7 @@ public: return *this; } - hsRef<_Ref> &operator=(nullptr_t) + hsRef<_Ref> &operator=(std::nullptr_t) { if (fObj) fObj->UnRef(); diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.h b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.h index 50df5494..41be533c 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.h +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.h @@ -226,6 +226,7 @@ class pfGUIDropTargetProc public: pfGUIDropTargetProc() { fRefCnt = 0; } + virtual ~pfGUIDropTargetProc() { } virtual bool CanEat( pfGUIListElement *element, pfGUIControlMod *source ) = 0; virtual void Eat( pfGUIListElement *element, pfGUIControlMod *source, pfGUIControlMod *parent ) = 0; diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp index 7e54b398..1922461e 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp @@ -154,7 +154,7 @@ void CryptKeyClose ( if (!key) return; - delete key->handle; + delete (RC4_KEY *)key->handle; delete key; }