Bug 792343 - Enable FAIL_ON_WARNINGS in some more of dom/ (second batch); r=mounir
authorMs2ger <ms2ger@gmail.com>
Thu, 20 Sep 2012 09:55:36 +0200
changeset 107585 1f282d4d436ca6eb2790b428bf666f2e3bba181b
parent 107584 7a9b27c4ea53af38dcac8e83973bb4cff1471831
child 107586 870c876a6976cc5971570d5e87684d309097437e
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersmounir
bugs792343
milestone18.0a1
Bug 792343 - Enable FAIL_ON_WARNINGS in some more of dom/ (second batch); r=mounir
dom/devicestorage/Makefile.in
dom/devicestorage/nsDeviceStorage.cpp
dom/icc/src/Makefile.in
dom/media/Makefile.in
dom/network/src/Makefile.in
dom/plugins/base/android/ANPWindow.cpp
dom/plugins/base/android/Makefile.in
dom/power/Makefile.in
media/webrtc/trunk/src/common_types.h
--- a/dom/devicestorage/Makefile.in
+++ b/dom/devicestorage/Makefile.in
@@ -9,16 +9,17 @@ VPATH            = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE           = dom
 LIBRARY_NAME     = domdevicestorage_s
 XPIDL_MODULE     = dom_devicestorage
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
+FAIL_ON_WARNINGS := 1
 
 include $(topsrcdir)/dom/dom-config.mk
 
 EXPORTS_NAMESPACES = mozilla/dom/devicestorage
 
 EXPORTS_mozilla/dom/devicestorage = \
   DeviceStorageRequestChild.h \
   DeviceStorageRequestParent.h \
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -1,22 +1,25 @@
 /* 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/. */
 
-#include "mozilla/dom/ContentChild.h"
-#include "mozilla/dom/PBrowserChild.h"
-#include "mozilla/dom/ipc/Blob.h"
-#include "mozilla/dom/devicestorage/PDeviceStorageRequestChild.h"
-#include "mozilla/Attributes.h"
-#include "mozilla/dom/PContentPermissionRequestChild.h"
-#include "mozilla/ClearOnShutdown.h"
+#include "base/basictypes.h"
 
 #include "nsDeviceStorage.h"
 
+#include "mozilla/Attributes.h"
+#include "mozilla/ClearOnShutdown.h"
+#include "mozilla/dom/ContentChild.h"
+#include "mozilla/dom/devicestorage/PDeviceStorageRequestChild.h"
+#include "mozilla/dom/ipc/Blob.h"
+#include "mozilla/dom/PBrowserChild.h"
+#include "mozilla/dom/PContentPermissionRequestChild.h"
+#include "mozilla/Util.h" // DebugOnly
+
 #include "nsAutoPtr.h"
 #include "nsDOMEvent.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIFile.h"
 #include "nsIDirectoryEnumerator.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIDOMFile.h"
@@ -229,30 +232,30 @@ DeviceStorageFile::DeviceStorageFile(con
   NS_ASSERTION(aFile, "Must not create a DeviceStorageFile with a null nsIFile");
   // always take a clone
   nsCOMPtr<nsIFile> file;
   aFile->Clone(getter_AddRefs(mFile));
 
   AppendRelativePath();
   NormalizeFilePath();
 
-  DeviceStorageTypeChecker* typeChecker = DeviceStorageTypeChecker::CreateOrGet();
+  DebugOnly<DeviceStorageTypeChecker*> typeChecker = DeviceStorageTypeChecker::CreateOrGet();
   NS_ASSERTION(typeChecker, "DeviceStorageTypeChecker is null");
 }
 
 DeviceStorageFile::DeviceStorageFile(const nsAString& aStorageType, nsIFile* aFile)
   : mStorageType(aStorageType)
   , mEditable(false)
 {
   NS_ASSERTION(aFile, "Must not create a DeviceStorageFile with a null nsIFile");
   // always take a clone
   nsCOMPtr<nsIFile> file;
   aFile->Clone(getter_AddRefs(mFile));
 
-  DeviceStorageTypeChecker* typeChecker = DeviceStorageTypeChecker::CreateOrGet();
+  DebugOnly<DeviceStorageTypeChecker*> typeChecker = DeviceStorageTypeChecker::CreateOrGet();
   NS_ASSERTION(typeChecker, "DeviceStorageTypeChecker is null");
 }
 
 void
 DeviceStorageFile::SetPath(const nsAString& aPath) {
   mPath.Assign(aPath);
   NormalizeFilePath();
 }
--- a/dom/icc/src/Makefile.in
+++ b/dom/icc/src/Makefile.in
@@ -7,16 +7,17 @@ topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = $(srcdir)
 
 include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME     = dom_icc_s
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
+FAIL_ON_WARNINGS := 1
 
 include $(topsrcdir)/dom/dom-config.mk
 
 EXPORTS_NAMESPACES = mozilla/dom/icc
 
 EXPORTS_mozilla/dom/icc = \
   StkCommandEvent.h \
   $(NULL)
--- a/dom/media/Makefile.in
+++ b/dom/media/Makefile.in
@@ -1,26 +1,26 @@
 # 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            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
-
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE           = dom
 XPIDL_MODULE     = dom_media
 LIBRARY_NAME     = dom_media_s
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
+FAIL_ON_WARNINGS := 1
 
 include $(topsrcdir)/dom/dom-config.mk
 
 XPIDLSRCS = \
   nsIDOMMediaStream.idl \
   nsIDOMNavigatorUserMedia.idl \
   $(NULL)
 
--- a/dom/network/src/Makefile.in
+++ b/dom/network/src/Makefile.in
@@ -7,16 +7,17 @@ topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = $(srcdir)
 
 include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME     = dom_network_s
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
+FAIL_ON_WARNINGS := 1
 
 EXTRA_COMPONENTS = \
 	TCPSocket.js \
 	TCPSocket.manifest \
 	$(NULL)
 
 include $(topsrcdir)/dom/dom-config.mk
 
--- a/dom/plugins/base/android/ANPWindow.cpp
+++ b/dom/plugins/base/android/ANPWindow.cpp
@@ -1,24 +1,25 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 #include "base/basictypes.h"
 #include "assert.h"
 #include "ANPBase.h"
 #include <android/log.h>
 #include "AndroidBridge.h"
 #include "nsNPAPIPluginInstance.h"
 #include "nsIPluginInstanceOwner.h"
 #include "nsPluginInstanceOwner.h"
 #include "nsWindow.h"
 #include "mozilla/dom/ScreenOrientation.h"
 
+#undef LOG
 #define LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
 #define ASSIGN(obj, name)   (obj)->name = anp_window_##name
 
 using namespace mozilla;
 using namespace mozilla::widget;
 using namespace mozilla::dom;
 
 static nsresult GetOwner(NPP instance, nsPluginInstanceOwner** owner) {
@@ -58,31 +59,27 @@ anp_window_showKeyboard(NPP instance, bo
   }
 
   window->SetInputContext(context, action);
 }
 
 void
 anp_window_requestFullScreen(NPP instance)
 {
-  nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
-
   nsRefPtr<nsPluginInstanceOwner> owner;
   if (NS_FAILED(GetOwner(instance, getter_AddRefs(owner)))) {
     return;
   }
 
   owner->RequestFullScreen();
 }
 
 void
 anp_window_exitFullScreen(NPP instance)
 {
-  nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
-
   nsRefPtr<nsPluginInstanceOwner> owner;
   if (NS_FAILED(GetOwner(instance, getter_AddRefs(owner)))) {
     return;
   }
 
   owner->ExitFullScreen();
 }
 
--- a/dom/plugins/base/android/Makefile.in
+++ b/dom/plugins/base/android/Makefile.in
@@ -7,20 +7,20 @@ DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= plugin
 LIBRARY_NAME	= gkpluginandroid_s
-
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
 EXPORT_LIBRARY = 1
+FAIL_ON_WARNINGS := 1
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
 EXPORTS = \
   ANPKeyCodes.h \
   android_npapi.h \
   $(NULL)
--- a/dom/power/Makefile.in
+++ b/dom/power/Makefile.in
@@ -8,16 +8,17 @@ srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME     = dom_power_s
 XPIDL_MODULE     = dom_power
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
+FAIL_ON_WARNINGS := 1
 
 include $(topsrcdir)/dom/dom-config.mk
 
 EXPORTS_NAMESPACES = mozilla/dom/power
 
 EXPORTS_mozilla/dom/power = \
   PowerManagerService.h \
   Types.h \
--- a/media/webrtc/trunk/src/common_types.h
+++ b/media/webrtc/trunk/src/common_types.h
@@ -342,17 +342,17 @@ enum TelephoneEventDetectionMethods
 enum NsModes    // type of Noise Suppression
 {
     kNsUnchanged = 0,   // previously set mode
     kNsDefault,         // platform default
     kNsConference,      // conferencing default
     kNsLowSuppression,  // lowest suppression
     kNsModerateSuppression,
     kNsHighSuppression,
-    kNsVeryHighSuppression,     // highest suppression
+    kNsVeryHighSuppression     // highest suppression
 };
 
 enum AgcModes                  // type of Automatic Gain Control
 {
     kAgcUnchanged = 0,        // previously set mode
     kAgcDefault,              // platform default
     // adaptive mode for use when analog volume control exists (e.g. for
     // PC softphone)
@@ -367,17 +367,17 @@ enum AgcModes                  // type o
 
 // EC modes
 enum EcModes                   // type of Echo Control
 {
     kEcUnchanged = 0,          // previously set mode
     kEcDefault,                // platform default
     kEcConference,             // conferencing default (aggressive AEC)
     kEcAec,                    // Acoustic Echo Cancellation
-    kEcAecm,                   // AEC mobile
+    kEcAecm                    // AEC mobile
 };
 
 // AECM modes
 enum AecmModes                 // mode of AECM
 {
     kAecmQuietEarpieceOrHeadset = 0,
                                // Quiet earpiece or headset use
     kAecmEarpiece,             // most earpiece use
@@ -416,43 +416,43 @@ enum NetEqModes             // NetEQ pla
     // Optimized trade-off between low delay and jitter robustness for two-way
     // communication.
     kNetEqDefault = 0,
     // Improved jitter robustness at the cost of increased delay. Can be
     // used in one-way communication.
     kNetEqStreaming = 1,
     // Optimzed for decodability of fax signals rather than for perceived audio
     // quality.
-    kNetEqFax = 2,
+    kNetEqFax = 2
 };
 
 enum NetEqBgnModes          // NetEQ Background Noise (BGN) configurations
 {
     // BGN is always on and will be generated when the incoming RTP stream
     // stops (default).
     kBgnOn = 0,
     // The BGN is faded to zero (complete silence) after a few seconds.
     kBgnFade = 1,
     // BGN is not used at all. Silence is produced after speech extrapolation
     // has faded.
-    kBgnOff = 2,
+    kBgnOff = 2
 };
 
 enum OnHoldModes            // On Hold direction
 {
     kHoldSendAndPlay = 0,    // Put both sending and playing in on-hold state.
     kHoldSendOnly,           // Put only sending in on-hold state.
     kHoldPlayOnly            // Put only playing in on-hold state.
 };
 
 enum AmrMode
 {
     kRfc3267BwEfficient = 0,
     kRfc3267OctetAligned = 1,
-    kRfc3267FileStorage = 2,
+    kRfc3267FileStorage = 2
 };
 
 // ==================================================================
 // Video specific types
 // ==================================================================
 
 // Raw video types
 enum RawVideoType