Bug 823921 - Fixed GCC warnings r=paul

This commit is contained in:
Jacek Caban 2012-12-26 11:27:28 +01:00
Родитель 353b341de4
Коммит c0e323b909
5 изменённых файлов: 14 добавлений и 16 удалений

Просмотреть файл

@ -35,9 +35,9 @@ DoGetInterface(IUnknown* aUnknown, void** aInterface)
WMFByteStream::WMFByteStream(MediaResource* aResource) WMFByteStream::WMFByteStream(MediaResource* aResource)
: mWorkQueueId(MFASYNC_CALLBACK_QUEUE_UNDEFINED), : mWorkQueueId(MFASYNC_CALLBACK_QUEUE_UNDEFINED),
mResource(aResource),
mReentrantMonitor("WMFByteStream"), mReentrantMonitor("WMFByteStream"),
mOffset(0), mOffset(0)
mResource(aResource)
{ {
NS_ASSERTION(NS_IsMainThread(), "Must be on main thread."); NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
NS_ASSERTION(mResource, "Must have a valid media resource"); NS_ASSERTION(mResource, "Must have a valid media resource");
@ -104,11 +104,11 @@ WMFByteStream::QueryInterface(REFIID aIId, void **aInterface)
return E_NOINTERFACE; return E_NOINTERFACE;
} }
NS_IMPL_THREADSAFE_ADDREF(WMFByteStream); NS_IMPL_THREADSAFE_ADDREF(WMFByteStream)
NS_IMPL_THREADSAFE_RELEASE(WMFByteStream); NS_IMPL_THREADSAFE_RELEASE(WMFByteStream)
NS_IMPL_THREADSAFE_ADDREF(WMFByteStream::AsyncReadRequestState); NS_IMPL_THREADSAFE_ADDREF(WMFByteStream::AsyncReadRequestState)
NS_IMPL_THREADSAFE_RELEASE(WMFByteStream::AsyncReadRequestState); NS_IMPL_THREADSAFE_RELEASE(WMFByteStream::AsyncReadRequestState)
// IUnknown Methods // IUnknown Methods
STDMETHODIMP STDMETHODIMP

Просмотреть файл

@ -11,6 +11,7 @@
#include "nsISupportsImpl.h" #include "nsISupportsImpl.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "mozilla/ReentrantMonitor.h" #include "mozilla/ReentrantMonitor.h"
#include "mozilla/Attributes.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
namespace mozilla { namespace mozilla {
@ -22,7 +23,7 @@ class MediaResource;
// on which blocking I/O is performed. The SourceReader requests reads // on which blocking I/O is performed. The SourceReader requests reads
// asynchronously using {Begin,End}Read(). The synchronous I/O methods aren't // asynchronously using {Begin,End}Read(). The synchronous I/O methods aren't
// used by the SourceReader, so they're not implemented on this class. // used by the SourceReader, so they're not implemented on this class.
class WMFByteStream : public IMFByteStream, class WMFByteStream MOZ_FINAL : public IMFByteStream,
public IMFAsyncCallback public IMFAsyncCallback
{ {
public: public:
@ -77,7 +78,7 @@ private:
DWORD mWorkQueueId; DWORD mWorkQueueId;
// Stores data regarding an async read opreation. // Stores data regarding an async read opreation.
class AsyncReadRequestState : public IUnknown { class AsyncReadRequestState MOZ_FINAL : public IUnknown {
public: public:
AsyncReadRequestState(int64_t aOffset, BYTE* aBuffer, ULONG aLength) AsyncReadRequestState(int64_t aOffset, BYTE* aBuffer, ULONG aLength)
: mOffset(aOffset), : mOffset(aOffset),
@ -98,7 +99,7 @@ private:
// IUnknown ref counting. // IUnknown ref counting.
nsAutoRefCnt mRefCnt; nsAutoRefCnt mRefCnt;
NS_DECL_OWNINGTHREAD; NS_DECL_OWNINGTHREAD
}; };
// Resource we're wrapping. Note this object's methods are threadsafe, // Resource we're wrapping. Note this object's methods are threadsafe,
@ -117,7 +118,7 @@ private:
// IUnknown ref counting. // IUnknown ref counting.
nsAutoRefCnt mRefCnt; nsAutoRefCnt mRefCnt;
NS_DECL_OWNINGTHREAD; NS_DECL_OWNINGTHREAD
}; };
} // namespace mozilla } // namespace mozilla

Просмотреть файл

@ -90,7 +90,6 @@ WMFDecoder::UnloadDLLs()
bool IsWindows7OrLater() bool IsWindows7OrLater()
{ {
OSVERSIONINFO versionInfo; OSVERSIONINFO versionInfo;
BOOL isWin7OrLater = FALSE;
versionInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); versionInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
if (!GetVersionEx(&versionInfo)) { if (!GetVersionEx(&versionInfo)) {
return false; return false;

Просмотреть файл

@ -52,10 +52,10 @@ WMFReader::~WMFReader()
// Note: We must shutdown the byte stream before calling MFShutdown, else we // Note: We must shutdown the byte stream before calling MFShutdown, else we
// get assertion failures when unlocking the byte stream's work queue. // get assertion failures when unlocking the byte stream's work queue.
if (mByteStream) { if (mByteStream) {
nsresult rv = mByteStream->Shutdown(); DebugOnly<nsresult> rv = mByteStream->Shutdown();
NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to shutdown WMFByteStream"); NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to shutdown WMFByteStream");
} }
HRESULT hr = wmf::MFShutdown(); DebugOnly<HRESULT> hr = wmf::MFShutdown();
NS_ASSERTION(SUCCEEDED(hr), "MFShutdown failed"); NS_ASSERTION(SUCCEEDED(hr), "MFShutdown failed");
MOZ_COUNT_DTOR(WMFReader); MOZ_COUNT_DTOR(WMFReader);
} }

Просмотреть файл

@ -203,8 +203,6 @@ namespace wmf {
static bool sDLLsLoaded = false; static bool sDLLsLoaded = false;
static bool sFailedToLoadDlls = false; static bool sFailedToLoadDlls = false;
static HMODULE sMfPlatMod = NULL;
struct WMFModule { struct WMFModule {
const char* name; const char* name;
HMODULE handle; HMODULE handle;