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:
StreamingVoiceContext(IXAudio2* pXAudio2, CMixer* pMixer, Common::Event& pSyncEvent);
~StreamingVoiceContext();
virtual ~StreamingVoiceContext();
void Stop();
void Play();

View File

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

View File

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

View File

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

View File

@ -117,6 +117,14 @@
Currently jits use some annoying code patterns which makes this common
-->
<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 Debug-->
<ClCompile Condition="'$(Configuration)'=='Debug'">