From 3d92167c95ddeb67042184fcf9d359226340f36d Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 18 May 2012 10:29:38 +0200 Subject: [PATCH] Bug 754643 - Enable FAIL_ON_WARNINGS in content/media; r=cpearce f=roc --- content/media/AudioSegment.h | 1 + content/media/Makefile.in | 1 + content/media/gstreamer/Makefile.in | 1 + .../media/nsBuiltinDecoderStateMachine.cpp | 5 ++- content/media/ogg/Makefile.in | 1 + content/media/ogg/nsOggCodecState.cpp | 5 ++- content/media/ogg/nsOggReader.cpp | 2 +- content/media/raw/Makefile.in | 33 ++++++++++--------- content/media/test/Makefile.in | 1 + content/media/wave/Makefile.in | 1 + content/media/webm/Makefile.in | 1 + xpcom/glue/nsCycleCollectionParticipant.h | 3 +- 12 files changed, 33 insertions(+), 22 deletions(-) diff --git a/content/media/AudioSegment.h b/content/media/AudioSegment.h index 396fabb452f..8422b514619 100644 --- a/content/media/AudioSegment.h +++ b/content/media/AudioSegment.h @@ -123,6 +123,7 @@ public: */ void WriteTo(nsAudioStream* aOutput); + using MediaSegmentBase::AppendFrom; void AppendFrom(AudioSegment* aSource) { NS_ASSERTION(aSource->mChannels == mChannels, "Non-matching channels"); diff --git a/content/media/Makefile.in b/content/media/Makefile.in index 63f974a0304..b6878e07403 100644 --- a/content/media/Makefile.in +++ b/content/media/Makefile.in @@ -38,6 +38,7 @@ DEPTH = ../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +FAIL_ON_WARNINGS = 1 include $(DEPTH)/config/autoconf.mk diff --git a/content/media/gstreamer/Makefile.in b/content/media/gstreamer/Makefile.in index 3e3b217bb73..ede2ca2956f 100644 --- a/content/media/gstreamer/Makefile.in +++ b/content/media/gstreamer/Makefile.in @@ -6,6 +6,7 @@ DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +FAIL_ON_WARNINGS = 1 include $(DEPTH)/config/autoconf.mk diff --git a/content/media/nsBuiltinDecoderStateMachine.cpp b/content/media/nsBuiltinDecoderStateMachine.cpp index f9aafc0cba5..085f9b22707 100644 --- a/content/media/nsBuiltinDecoderStateMachine.cpp +++ b/content/media/nsBuiltinDecoderStateMachine.cpp @@ -436,9 +436,9 @@ nsBuiltinDecoderStateMachine::nsBuiltinDecoderStateMachine(nsBuiltinDecoder* aDe mDispatchedRunEvent(false), mDecodeThreadWaiting(false), mRealTime(aRealTime), - mRequestedNewDecodeThread(false), mDidThrottleAudioDecoding(false), mDidThrottleVideoDecoding(false), + mRequestedNewDecodeThread(false), mEventManager(aDecoder) { MOZ_COUNT_CTOR(nsBuiltinDecoderStateMachine); @@ -539,7 +539,7 @@ void nsBuiltinDecoderStateMachine::SendOutputStreamAudio(AudioData* aAudio, aStream->mLastAudioPacketTime = aAudio->mTime; aStream->mLastAudioPacketEndTime = aAudio->GetEnd(); - NS_ASSERTION(aOutput->GetChannels() == aAudio->mChannels, + NS_ASSERTION(aOutput->GetChannels() == PRInt32(aAudio->mChannels), "Wrong number of channels"); // This logic has to mimic AudioLoop closely to make sure we write @@ -635,7 +635,6 @@ void nsBuiltinDecoderStateMachine::SendOutputStreamData() AudioSegment output; output.Init(mInfo.mAudioChannels); for (PRUint32 i = 0; i < audio.Length(); ++i) { - AudioData* a = audio[i]; SendOutputStreamAudio(audio[i], stream, &output); } if (output.GetDuration() > 0) { diff --git a/content/media/ogg/Makefile.in b/content/media/ogg/Makefile.in index 7384cab7629..18331e3528f 100644 --- a/content/media/ogg/Makefile.in +++ b/content/media/ogg/Makefile.in @@ -38,6 +38,7 @@ DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +FAIL_ON_WARNINGS = 1 include $(DEPTH)/config/autoconf.mk diff --git a/content/media/ogg/nsOggCodecState.cpp b/content/media/ogg/nsOggCodecState.cpp index 6608d2f562f..b9eb3cd10c3 100644 --- a/content/media/ogg/nsOggCodecState.cpp +++ b/content/media/ogg/nsOggCodecState.cpp @@ -45,6 +45,9 @@ #include "nsBuiltinDecoderReader.h" #include "mozilla/StandardInteger.h" +#include "mozilla/Util.h" // DebugOnly + +using namespace mozilla; #ifdef PR_LOGGING extern PRLogModuleInfo* gBuiltinDecoderLog; @@ -921,7 +924,7 @@ nsresult nsOpusState::PageIn(ogg_page* aPage) void nsOpusState::ReconstructGranulepos(void) { NS_ASSERTION(mUnstamped.Length() > 0, "Must have unstamped packets"); - ogg_packet* last = mUnstamped[mUnstamped.Length()-1]; + DebugOnly last = mUnstamped[mUnstamped.Length()-1]; NS_ASSERTION(last->e_o_s || last->granulepos > 0, "Must know last granulepos!"); diff --git a/content/media/ogg/nsOggReader.cpp b/content/media/ogg/nsOggReader.cpp index 25f9682ac4b..a85893c7efc 100644 --- a/content/media/ogg/nsOggReader.cpp +++ b/content/media/ogg/nsOggReader.cpp @@ -451,7 +451,7 @@ nsresult nsOggReader::DecodeOpus(ogg_packet* aPacket) { PRInt32 goodFrames = frames - skip; NS_ASSERTION(goodFrames > 0, "endTime calculation was wrong"); nsAutoArrayPtr goodBuffer(new AudioDataValue[goodFrames * channels]); - for (int i = 0; i < goodFrames*channels; i++) + for (PRInt32 i = 0; i < goodFrames * PRInt32(channels); i++) goodBuffer[i] = buffer[skip*channels + i]; startTime = mOpusState->Time(endFrame - goodFrames); diff --git a/content/media/raw/Makefile.in b/content/media/raw/Makefile.in index d263e492439..d82598d6e6e 100644 --- a/content/media/raw/Makefile.in +++ b/content/media/raw/Makefile.in @@ -36,27 +36,28 @@ # ***** END LICENSE BLOCK ***** -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ +DEPTH = ../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ +FAIL_ON_WARNINGS = 1 include $(DEPTH)/config/autoconf.mk -MODULE = content -LIBRARY_NAME = gkconraw_s -LIBXUL_LIBRARY = 1 +MODULE = content +LIBRARY_NAME = gkconraw_s +LIBXUL_LIBRARY = 1 -EXPORTS += \ - nsRawDecoder.h \ - nsRawReader.h \ - nsRawStructs.h \ - $(NULL) +EXPORTS += \ + nsRawDecoder.h \ + nsRawReader.h \ + nsRawStructs.h \ + $(NULL) -CPPSRCS += \ - nsRawDecoder.cpp \ - nsRawReader.cpp \ - $(NULL) +CPPSRCS += \ + nsRawDecoder.cpp \ + nsRawReader.cpp \ + $(NULL) FORCE_STATIC_LIB = 1 diff --git a/content/media/test/Makefile.in b/content/media/test/Makefile.in index f9896ef89aa..07cd4248352 100644 --- a/content/media/test/Makefile.in +++ b/content/media/test/Makefile.in @@ -39,6 +39,7 @@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ relativesrcdir = content/media/test +FAIL_ON_WARNINGS = 1 include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk diff --git a/content/media/wave/Makefile.in b/content/media/wave/Makefile.in index 213dab422a3..56085d48aae 100644 --- a/content/media/wave/Makefile.in +++ b/content/media/wave/Makefile.in @@ -38,6 +38,7 @@ DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +FAIL_ON_WARNINGS = 1 include $(DEPTH)/config/autoconf.mk diff --git a/content/media/webm/Makefile.in b/content/media/webm/Makefile.in index 95c52b39310..15176a92835 100644 --- a/content/media/webm/Makefile.in +++ b/content/media/webm/Makefile.in @@ -38,6 +38,7 @@ DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +FAIL_ON_WARNINGS = 1 include $(DEPTH)/config/autoconf.mk diff --git a/xpcom/glue/nsCycleCollectionParticipant.h b/xpcom/glue/nsCycleCollectionParticipant.h index e69cee1d6e4..51d973ace73 100644 --- a/xpcom/glue/nsCycleCollectionParticipant.h +++ b/xpcom/glue/nsCycleCollectionParticipant.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -383,6 +383,7 @@ public: tmp->_field.Clear(); #define NS_IMPL_CYCLE_COLLECTION_UNLINK_END \ + (void)tmp; \ return NS_OK; \ }