Bug 754643 - Enable FAIL_ON_WARNINGS in content/media; r=cpearce f=roc
authorMs2ger <ms2ger@gmail.com>
Fri, 18 May 2012 10:29:38 +0200
changeset 94300 358a6096a0dae97978e1e658f5c009b917790750
parent 94299 812c0d95cd0d5950e795a7f31a284a85370768eb
child 94301 f7d7fad55752f335dce540a1b3af49b03132ca45
push id22706
push userMs2ger@gmail.com
push dateFri, 18 May 2012 08:31:47 +0000
treeherdermozilla-central@4b74c82dd5ab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs754643
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 754643 - Enable FAIL_ON_WARNINGS in content/media; r=cpearce f=roc
content/media/AudioSegment.h
content/media/Makefile.in
content/media/gstreamer/Makefile.in
content/media/nsBuiltinDecoderStateMachine.cpp
content/media/ogg/Makefile.in
content/media/ogg/nsOggCodecState.cpp
content/media/ogg/nsOggReader.cpp
content/media/raw/Makefile.in
content/media/test/Makefile.in
content/media/wave/Makefile.in
content/media/webm/Makefile.in
xpcom/glue/nsCycleCollectionParticipant.h
--- a/content/media/AudioSegment.h
+++ b/content/media/AudioSegment.h
@@ -118,16 +118,17 @@ public:
   }
   void ApplyVolume(float aVolume);
   /**
    * aOutput must have a matching number of channels, but we will automatically
    * convert sample formats.
    */
   void WriteTo(nsAudioStream* aOutput);
 
+  using MediaSegmentBase<AudioSegment, AudioChunk>::AppendFrom;
   void AppendFrom(AudioSegment* aSource)
   {
     NS_ASSERTION(aSource->mChannels == mChannels, "Non-matching channels");
     MediaSegmentBase<AudioSegment, AudioChunk>::AppendFrom(aSource);
   }
 
   // Segment-generic methods not in MediaSegmentBase
   void InitFrom(const AudioSegment& aOther)
--- a/content/media/Makefile.in
+++ b/content/media/Makefile.in
@@ -33,16 +33,17 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH     = ../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
+FAIL_ON_WARNINGS = 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = content
 LIBRARY_NAME = gkconmedia_s
 LIBXUL_LIBRARY = 1
 XPIDL_MODULE = content_media
 
--- a/content/media/gstreamer/Makefile.in
+++ b/content/media/gstreamer/Makefile.in
@@ -1,16 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
+FAIL_ON_WARNINGS = 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= content
 LIBRARY_NAME	= gkcongstreamer_s
 LIBXUL_LIBRARY 	= 1
 
 
--- a/content/media/nsBuiltinDecoderStateMachine.cpp
+++ b/content/media/nsBuiltinDecoderStateMachine.cpp
@@ -431,19 +431,19 @@ nsBuiltinDecoderStateMachine::nsBuiltinD
   mDecodeThreadIdle(false),
   mStopAudioThread(true),
   mQuickBuffering(false),
   mIsRunning(false),
   mRunAgain(false),
   mDispatchedRunEvent(false),
   mDecodeThreadWaiting(false),
   mRealTime(aRealTime),
-  mRequestedNewDecodeThread(false),
   mDidThrottleAudioDecoding(false),
   mDidThrottleVideoDecoding(false),
+  mRequestedNewDecodeThread(false),
   mEventManager(aDecoder)
 {
   MOZ_COUNT_CTOR(nsBuiltinDecoderStateMachine);
   NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
 
   StateMachineTracker::Instance().EnsureGlobalStateMachine();
 
   // only enable realtime mode when "media.realtime_decoder.enabled" is true.
@@ -534,17 +534,17 @@ void nsBuiltinDecoderStateMachine::SendO
 
   if (aAudio->mTime <= aStream->mLastAudioPacketTime) {
     // ignore packet that we've already processed
     return;
   }
   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
   // the exact same silences
   CheckedInt64 audioWrittenOffset = UsecsToFrames(mInfo.mAudioRate,
       aStream->mAudioFramesWrittenBaseTime + mStartTime) + aStream->mAudioFramesWritten;
   CheckedInt64 frameOffset = UsecsToFrames(mInfo.mAudioRate, aAudio->mTime);
   if (!audioWrittenOffset.isValid() || !frameOffset.isValid())
@@ -630,17 +630,16 @@ void nsBuiltinDecoderStateMachine::SendO
     if (mInfo.mHasAudio) {
       nsAutoTArray<AudioData*,10> audio;
       // It's OK to hold references to the AudioData because while audio
       // is captured, only the decoder thread pops from the queue (see below).
       mReader->mAudioQueue.GetElementsAfter(stream->mLastAudioPacketTime, &audio);
       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) {
         mediaStream->AppendToTrack(TRACK_AUDIO, &output);
       }
       if (mReader->mAudioQueue.IsFinished() && !stream->mHaveSentFinishAudio) {
         mediaStream->EndTrack(TRACK_AUDIO);
         stream->mHaveSentFinishAudio = true;
--- a/content/media/ogg/Makefile.in
+++ b/content/media/ogg/Makefile.in
@@ -33,16 +33,17 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
+FAIL_ON_WARNINGS = 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= content
 LIBRARY_NAME	= gkconogg_s
 LIBXUL_LIBRARY 	= 1
 
 
--- a/content/media/ogg/nsOggCodecState.cpp
+++ b/content/media/ogg/nsOggCodecState.cpp
@@ -40,16 +40,19 @@
 #include "nsOggCodecState.h"
 #include "nsOggDecoder.h"
 #include <string.h>
 #include "nsTraceRefcnt.h"
 #include "VideoUtils.h"
 #include "nsBuiltinDecoderReader.h"
 
 #include "mozilla/StandardInteger.h"
+#include "mozilla/Util.h" // DebugOnly
+
+using namespace mozilla;
 
 #ifdef PR_LOGGING
 extern PRLogModuleInfo* gBuiltinDecoderLog;
 #define LOG(type, msg) PR_LOG(gBuiltinDecoderLog, type, msg)
 #else
 #define LOG(type, msg)
 #endif
 
@@ -916,17 +919,17 @@ nsresult nsOpusState::PageIn(ogg_page* a
   }
   mUnstamped.Clear();
   return NS_OK;
 }
 
 void nsOpusState::ReconstructGranulepos(void)
 {
   NS_ASSERTION(mUnstamped.Length() > 0, "Must have unstamped packets");
-  ogg_packet* last = mUnstamped[mUnstamped.Length()-1];
+  DebugOnly<ogg_packet*> last = mUnstamped[mUnstamped.Length()-1];
   NS_ASSERTION(last->e_o_s || last->granulepos > 0,
       "Must know last granulepos!");
 
   // Loop through the packets backwards, subtracting the next
   // packet's duration from its granulepos to get the value
   // for the current packet.
   for (PRUint32 i = mUnstamped.Length() - 1; i > 0; i--) {
     ogg_packet* next = mUnstamped[i];
--- a/content/media/ogg/nsOggReader.cpp
+++ b/content/media/ogg/nsOggReader.cpp
@@ -446,17 +446,17 @@ nsresult nsOggReader::DecodeOpus(ogg_pac
   // Trim the initial samples.
   if (endTime < 0)
     return NS_OK;
   if (startTime < 0) {
     PRInt32 skip = mOpusState->mPreSkip;
     PRInt32 goodFrames = frames - skip;
     NS_ASSERTION(goodFrames > 0, "endTime calculation was wrong");
     nsAutoArrayPtr<AudioDataValue> 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);
     duration = endTime - startTime;
     frames = goodFrames;
     buffer = goodBuffer;
   }
 
--- a/content/media/raw/Makefile.in
+++ b/content/media/raw/Makefile.in
@@ -31,37 +31,38 @@
 # decision by deleting the provisions above and replace them with the notice
 # and other provisions required by the GPL or the LGPL. If you do not delete
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** 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
 
 include $(topsrcdir)/config/rules.mk
 
 INCLUDES	+= \
 		-I$(srcdir)/../../base/src \
 		-I$(srcdir)/../../html/content/src \
--- a/content/media/test/Makefile.in
+++ b/content/media/test/Makefile.in
@@ -34,16 +34,17 @@
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 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
 
 # Media tests should be backend independent, i.e., not conditioned on
 # MOZ_OGG, MOZ_WAVE etc. (The only exception is the can_play_type tests,
 # which necessarily depend on the backend(s) configured.) As far as possible,
 # each test should work with any resource type. This makes it
--- a/content/media/wave/Makefile.in
+++ b/content/media/wave/Makefile.in
@@ -33,16 +33,17 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
+FAIL_ON_WARNINGS = 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= content
 LIBRARY_NAME	= gkconwave_s
 LIBXUL_LIBRARY 	= 1
 
 
--- a/content/media/webm/Makefile.in
+++ b/content/media/webm/Makefile.in
@@ -33,16 +33,17 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
+FAIL_ON_WARNINGS = 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= content
 LIBRARY_NAME	= gkconwebm_s
 LIBXUL_LIBRARY 	= 1
 
 
--- a/xpcom/glue/nsCycleCollectionParticipant.h
+++ b/xpcom/glue/nsCycleCollectionParticipant.h
@@ -1,9 +1,9 @@
-/* -*- 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
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -378,16 +378,17 @@ public:
 
 #define NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(_field)                     \
     tmp->_field.Clear();
 
 #define NS_IMPL_CYCLE_COLLECTION_UNLINK_NSTARRAY(_field)                       \
     tmp->_field.Clear();
 
 #define NS_IMPL_CYCLE_COLLECTION_UNLINK_END                                    \
+    (void)tmp;                                                                 \
     return NS_OK;                                                              \
   }
 
 #define NS_IMPL_CYCLE_COLLECTION_UNLINK_0(_class)                              \
   NS_IMETHODIMP                                                                \
   NS_CYCLE_COLLECTION_CLASSNAME(_class)::Unlink(void *p)                       \
   {                                                                            \
     NS_ASSERTION(CheckForRightISupports(static_cast<nsISupports*>(p)),         \