From 2ed61b0ee1d18547d1dc662bf538c7eaab4886f7 Mon Sep 17 00:00:00 2001 From: Phil Christensen Date: Wed, 15 Feb 2017 20:37:04 -0800 Subject: C++ conformance fixes (MSVC /permissive-) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We (the Microsoft C++ team) use the dolphin project as part of our "Real world code" tests. I noticed a few issues in windows specific code when building dolphin with the MSVC compiler in its conformance mode (/permissive-). For more information on /permissive- see our blog https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/. These changes are to address 3 different types of issues: 1) Use of qualified names in member declarations struct A {      void A::f() { } // error C4596: illegal qualified name in member declaration                      // remove redundant 'A::' to fix }; 2) Binding a non-const reference to a temporary struct S{};    // If arg is in 'in' parameter, then it should be made const. void func(S& arg){}    int main() {    //error C2664: 'void func(S &)': cannot convert argument 1 from 'S' to 'S &'    //note: A non-const reference may only be bound to an lvalue    func( S() );       //Work around this by creating a local, and using it to call the function    S s;    func( s ); } 3) Add missing #include Because of the workaround you are using in the code you will need to include this. This is because of changes in the libraries and not /permissive- --- Source/Core/AudioCommon/XAudio2_7Stream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/AudioCommon/XAudio2_7Stream.cpp') diff --git a/Source/Core/AudioCommon/XAudio2_7Stream.cpp b/Source/Core/AudioCommon/XAudio2_7Stream.cpp index 74df4d35c4..06fb645c95 100644 --- a/Source/Core/AudioCommon/XAudio2_7Stream.cpp +++ b/Source/Core/AudioCommon/XAudio2_7Stream.cpp @@ -28,8 +28,8 @@ public: ~StreamingVoiceContext2_7(); - void StreamingVoiceContext2_7::Stop(); - void StreamingVoiceContext2_7::Play(); + void Stop(); + void Play(); STDMETHOD_(void, OnVoiceError)(THIS_ void* pBufferContext, HRESULT Error) {} STDMETHOD_(void, OnVoiceProcessingPassStart)(UINT32) {} -- cgit v1.2.3