msbuild: obey some warnings about missing virtual destructors

This commit is contained in:
Shawn Hoffman 2017-06-07 15:25:13 -07:00
parent 1065dc4438
commit fd166032ab
5 changed files with 21 additions and 10 deletions

View File

@ -25,8 +25,7 @@ private:
public: public:
StreamingVoiceContext(IXAudio2* pXAudio2, CMixer* pMixer, Common::Event& pSyncEvent); StreamingVoiceContext(IXAudio2* pXAudio2, CMixer* pMixer, Common::Event& pSyncEvent);
virtual ~StreamingVoiceContext();
~StreamingVoiceContext();
void Stop(); void Stop();
void Play(); void Play();

View File

@ -25,8 +25,7 @@ private:
public: public:
StreamingVoiceContext2_7(IXAudio2* pXAudio2, CMixer* pMixer, Common::Event& pSyncEvent); StreamingVoiceContext2_7(IXAudio2* pXAudio2, CMixer* pMixer, Common::Event& pSyncEvent);
virtual ~StreamingVoiceContext2_7();
~StreamingVoiceContext2_7();
void Stop(); void Stop();
void Play(); void Play();

View File

@ -27,6 +27,7 @@ class Section
public: public:
Section(LayerType layer, System system, const std::string& name); Section(LayerType layer, System system, const std::string& name);
virtual ~Section() = default;
virtual bool Exists(const std::string& key) const; virtual bool Exists(const std::string& key) const;
bool Delete(const std::string& key); bool Delete(const std::string& key);

View File

@ -20,14 +20,14 @@ template <typename T>
class ReadHandlingMethod class ReadHandlingMethod
{ {
public: public:
virtual ~ReadHandlingMethod() {} virtual ~ReadHandlingMethod() = default;
virtual void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const = 0; virtual void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const = 0;
}; };
template <typename T> template <typename T>
class WriteHandlingMethod class WriteHandlingMethod
{ {
public: public:
virtual ~WriteHandlingMethod() {} virtual ~WriteHandlingMethod() = default;
virtual void AcceptWriteVisitor(WriteHandlingMethodVisitor<T>& v) const = 0; virtual void AcceptWriteVisitor(WriteHandlingMethodVisitor<T>& v) const = 0;
}; };
@ -39,7 +39,7 @@ class ConstantHandlingMethod : public ReadHandlingMethod<T>
{ {
public: public:
explicit ConstantHandlingMethod(T value) : value_(value) {} explicit ConstantHandlingMethod(T value) : value_(value) {}
virtual ~ConstantHandlingMethod() {} virtual ~ConstantHandlingMethod() = default;
void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override
{ {
v.VisitConstant(value_); v.VisitConstant(value_);
@ -62,7 +62,7 @@ class NopHandlingMethod : public WriteHandlingMethod<T>
{ {
public: public:
NopHandlingMethod() {} NopHandlingMethod() {}
virtual ~NopHandlingMethod() {} virtual ~NopHandlingMethod() = default;
void AcceptWriteVisitor(WriteHandlingMethodVisitor<T>& v) const override { v.VisitNop(); } void AcceptWriteVisitor(WriteHandlingMethodVisitor<T>& v) const override { v.VisitNop(); }
}; };
template <typename T> template <typename T>
@ -79,7 +79,7 @@ class DirectHandlingMethod : public ReadHandlingMethod<T>, public WriteHandlingM
{ {
public: public:
DirectHandlingMethod(T* addr, u32 mask) : addr_(addr), mask_(mask) {} DirectHandlingMethod(T* addr, u32 mask) : addr_(addr), mask_(mask) {}
virtual ~DirectHandlingMethod() {} virtual ~DirectHandlingMethod() = default;
void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override
{ {
v.VisitDirect(addr_, mask_); v.VisitDirect(addr_, mask_);
@ -132,7 +132,7 @@ public:
{ {
} }
virtual ~ComplexHandlingMethod() {} virtual ~ComplexHandlingMethod() = default;
void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override
{ {
v.VisitComplex(&read_lambda_); v.VisitComplex(&read_lambda_);
@ -304,6 +304,8 @@ void ReadHandler<T>::ResetMethod(ReadHandlingMethod<T>* method)
struct FuncCreatorVisitor : public ReadHandlingMethodVisitor<T> struct FuncCreatorVisitor : public ReadHandlingMethodVisitor<T>
{ {
virtual ~FuncCreatorVisitor() = default;
std::function<T(u32)> ret; std::function<T(u32)> ret;
void VisitConstant(T value) override void VisitConstant(T value) override
@ -356,6 +358,8 @@ void WriteHandler<T>::ResetMethod(WriteHandlingMethod<T>* method)
struct FuncCreatorVisitor : public WriteHandlingMethodVisitor<T> struct FuncCreatorVisitor : public WriteHandlingMethodVisitor<T>
{ {
virtual ~FuncCreatorVisitor() = default;
std::function<void(u32, T)> ret; std::function<void(u32, T)> ret;
void VisitNop() override void VisitNop() override

View File

@ -117,6 +117,14 @@
Currently jits use some annoying code patterns which makes this common Currently jits use some annoying code patterns which makes this common
--> -->
<DisableSpecificWarnings>4245;%(DisableSpecificWarnings)</DisableSpecificWarnings> <DisableSpecificWarnings>4245;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<!-- Enable some off-by-default warnings
4263 Non-virtual member function hides base class virtual function
4265 Class has virtual functions, but destructor is not virtual
4946 Reinterpret cast between related types
-->
<!-- Externals are currently not compatible with this. Can still uncomment locally.
<AdditionalOptions>/we4263 /we4265 /we4946 %(AdditionalOptions)</AdditionalOptions>
-->
</ClCompile> </ClCompile>
<!--ClCompile Debug--> <!--ClCompile Debug-->
<ClCompile Condition="'$(Configuration)'=='Debug'"> <ClCompile Condition="'$(Configuration)'=='Debug'">