From c0e323b909740b7eb065180c0c32efdd22fc81b7 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 26 Dec 2012 11:27:28 +0100 Subject: [PATCH] Bug 823921 - Fixed GCC warnings r=paul --- content/media/wmf/WMFByteStream.cpp | 12 ++++++------ content/media/wmf/WMFByteStream.h | 11 ++++++----- content/media/wmf/WMFDecoder.cpp | 1 - content/media/wmf/WMFReader.cpp | 4 ++-- content/media/wmf/WMFUtils.cpp | 2 -- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/content/media/wmf/WMFByteStream.cpp b/content/media/wmf/WMFByteStream.cpp index c936792df27c..3b468552b45d 100644 --- a/content/media/wmf/WMFByteStream.cpp +++ b/content/media/wmf/WMFByteStream.cpp @@ -35,9 +35,9 @@ DoGetInterface(IUnknown* aUnknown, void** aInterface) WMFByteStream::WMFByteStream(MediaResource* aResource) : mWorkQueueId(MFASYNC_CALLBACK_QUEUE_UNDEFINED), + mResource(aResource), mReentrantMonitor("WMFByteStream"), - mOffset(0), - mResource(aResource) + mOffset(0) { NS_ASSERTION(NS_IsMainThread(), "Must be on main thread."); NS_ASSERTION(mResource, "Must have a valid media resource"); @@ -104,11 +104,11 @@ WMFByteStream::QueryInterface(REFIID aIId, void **aInterface) return E_NOINTERFACE; } -NS_IMPL_THREADSAFE_ADDREF(WMFByteStream); -NS_IMPL_THREADSAFE_RELEASE(WMFByteStream); +NS_IMPL_THREADSAFE_ADDREF(WMFByteStream) +NS_IMPL_THREADSAFE_RELEASE(WMFByteStream) -NS_IMPL_THREADSAFE_ADDREF(WMFByteStream::AsyncReadRequestState); -NS_IMPL_THREADSAFE_RELEASE(WMFByteStream::AsyncReadRequestState); +NS_IMPL_THREADSAFE_ADDREF(WMFByteStream::AsyncReadRequestState) +NS_IMPL_THREADSAFE_RELEASE(WMFByteStream::AsyncReadRequestState) // IUnknown Methods STDMETHODIMP diff --git a/content/media/wmf/WMFByteStream.h b/content/media/wmf/WMFByteStream.h index ce1380c297b7..89fa566f876d 100644 --- a/content/media/wmf/WMFByteStream.h +++ b/content/media/wmf/WMFByteStream.h @@ -11,6 +11,7 @@ #include "nsISupportsImpl.h" #include "nsCOMPtr.h" #include "mozilla/ReentrantMonitor.h" +#include "mozilla/Attributes.h" #include "nsAutoPtr.h" namespace mozilla { @@ -22,8 +23,8 @@ class MediaResource; // on which blocking I/O is performed. The SourceReader requests reads // asynchronously using {Begin,End}Read(). The synchronous I/O methods aren't // used by the SourceReader, so they're not implemented on this class. -class WMFByteStream : public IMFByteStream, - public IMFAsyncCallback +class WMFByteStream MOZ_FINAL : public IMFByteStream, + public IMFAsyncCallback { public: WMFByteStream(MediaResource* aResource); @@ -77,7 +78,7 @@ private: DWORD mWorkQueueId; // Stores data regarding an async read opreation. - class AsyncReadRequestState : public IUnknown { + class AsyncReadRequestState MOZ_FINAL : public IUnknown { public: AsyncReadRequestState(int64_t aOffset, BYTE* aBuffer, ULONG aLength) : mOffset(aOffset), @@ -98,7 +99,7 @@ private: // IUnknown ref counting. nsAutoRefCnt mRefCnt; - NS_DECL_OWNINGTHREAD; + NS_DECL_OWNINGTHREAD }; // Resource we're wrapping. Note this object's methods are threadsafe, @@ -117,7 +118,7 @@ private: // IUnknown ref counting. nsAutoRefCnt mRefCnt; - NS_DECL_OWNINGTHREAD; + NS_DECL_OWNINGTHREAD }; } // namespace mozilla diff --git a/content/media/wmf/WMFDecoder.cpp b/content/media/wmf/WMFDecoder.cpp index 1801a0fc074f..493fa0a6159a 100644 --- a/content/media/wmf/WMFDecoder.cpp +++ b/content/media/wmf/WMFDecoder.cpp @@ -90,7 +90,6 @@ WMFDecoder::UnloadDLLs() bool IsWindows7OrLater() { OSVERSIONINFO versionInfo; - BOOL isWin7OrLater = FALSE; versionInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); if (!GetVersionEx(&versionInfo)) { return false; diff --git a/content/media/wmf/WMFReader.cpp b/content/media/wmf/WMFReader.cpp index 784e810e7a05..c4e73e763883 100644 --- a/content/media/wmf/WMFReader.cpp +++ b/content/media/wmf/WMFReader.cpp @@ -52,10 +52,10 @@ WMFReader::~WMFReader() // Note: We must shutdown the byte stream before calling MFShutdown, else we // get assertion failures when unlocking the byte stream's work queue. if (mByteStream) { - nsresult rv = mByteStream->Shutdown(); + DebugOnly rv = mByteStream->Shutdown(); NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to shutdown WMFByteStream"); } - HRESULT hr = wmf::MFShutdown(); + DebugOnly hr = wmf::MFShutdown(); NS_ASSERTION(SUCCEEDED(hr), "MFShutdown failed"); MOZ_COUNT_DTOR(WMFReader); } diff --git a/content/media/wmf/WMFUtils.cpp b/content/media/wmf/WMFUtils.cpp index a48eb76d0d1b..03fbfb28d3db 100644 --- a/content/media/wmf/WMFUtils.cpp +++ b/content/media/wmf/WMFUtils.cpp @@ -203,8 +203,6 @@ namespace wmf { static bool sDLLsLoaded = false; static bool sFailedToLoadDlls = false; -static HMODULE sMfPlatMod = NULL; - struct WMFModule { const char* name; HMODULE handle;