Bug 1032644 - Fix some -Wunused warnings in non-unified OS X build. r=ehsan
authorChris Peterson <cpeterson@mozilla.com>
Wed, 02 Jul 2014 18:55:19 -0700
changeset 212871 ed0d0844967e4858764259f7f6d5ecabc01d7ad9
parent 212870 63538074b343a05d39453e11356f057e6dade811
child 212872 91a55429c78b098926c8f23cacce69beede00178
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1032644
milestone33.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 1032644 - Fix some -Wunused warnings in non-unified OS X build. r=ehsan
caps/src/nsNullPrincipalURI.cpp
caps/src/nsScriptSecurityManager.cpp
extensions/spellcheck/hunspell/src/mozHunspell.cpp
extensions/spellcheck/src/moz.build
extensions/spellcheck/src/mozPersonalDictionary.cpp
extensions/universalchardet/src/base/moz.build
extensions/universalchardet/src/xpcom/moz.build
extensions/universalchardet/src/xpcom/nsUdetXPCOMWrapper.cpp
parser/html/moz.build
parser/html/nsParserUtils.cpp
toolkit/xre/nsSigHandlers.cpp
--- a/caps/src/nsNullPrincipalURI.cpp
+++ b/caps/src/nsNullPrincipalURI.cpp
@@ -1,31 +1,32 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: sw=2 ts=2 sts=2 expandtab
  * 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 "nsNullPrincipalURI.h"
 
+#include "mozilla/DebugOnly.h"
 #include "mozilla/MemoryReporting.h"
 
 #include "nsNetUtil.h"
 #include "nsEscape.h"
 #include "nsCRT.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsNullPrincipalURI
 
 nsNullPrincipalURI::nsNullPrincipalURI(const nsCString &aSpec)
 {
   int32_t dividerPosition = aSpec.FindChar(':');
   NS_ASSERTION(dividerPosition != -1, "Malformed URI!");
 
-  int32_t n = aSpec.Left(mScheme, dividerPosition);
+  mozilla::DebugOnly<int32_t> n = aSpec.Left(mScheme, dividerPosition);
   NS_ASSERTION(n == dividerPosition, "Storing the scheme failed!");
 
   int32_t count = aSpec.Length() - dividerPosition - 1;
   n = aSpec.Mid(mPath, dividerPosition + 1, count);
   NS_ASSERTION(n == count, "Storing the path failed!");
 
   ToLowerCase(mScheme);
 }
--- a/caps/src/nsScriptSecurityManager.cpp
+++ b/caps/src/nsScriptSecurityManager.cpp
@@ -66,18 +66,16 @@
 #include "nsJSUtils.h"
 
 // This should be probably defined on some other place... but I couldn't find it
 #define WEBAPPS_PERM_NAME "webapps-manage"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
-static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID);
-
 nsIIOService    *nsScriptSecurityManager::sIOService = nullptr;
 nsIStringBundle *nsScriptSecurityManager::sStrBundle = nullptr;
 JSRuntime       *nsScriptSecurityManager::sRuntime   = 0;
 bool nsScriptSecurityManager::sStrictFileOriginPolicy = true;
 
 ///////////////////////////
 // Convenience Functions //
 ///////////////////////////
--- a/extensions/spellcheck/hunspell/src/mozHunspell.cpp
+++ b/extensions/spellcheck/hunspell/src/mozHunspell.cpp
@@ -74,18 +74,16 @@
 #include "mozilla/Services.h"
 #include <stdlib.h>
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "mozilla/dom/EncodingUtils.h"
 
 using mozilla::dom::EncodingUtils;
 
-static NS_DEFINE_CID(kUnicharUtilCID, NS_UNICHARUTIL_CID);
-
 NS_IMPL_CYCLE_COLLECTING_ADDREF(mozHunspell)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(mozHunspell)
 
 NS_INTERFACE_MAP_BEGIN(mozHunspell)
   NS_INTERFACE_MAP_ENTRY(mozISpellCheckingEngine)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY(nsIMemoryReporter)
--- a/extensions/spellcheck/src/moz.build
+++ b/extensions/spellcheck/src/moz.build
@@ -19,8 +19,10 @@ LIBRARY_NAME = 'spellchecker'
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '../hunspell/src',
     '/content/base/src',
     '/editor/libeditor/base',
 ]
+
+FAIL_ON_WARNINGS = True
--- a/extensions/spellcheck/src/mozPersonalDictionary.cpp
+++ b/extensions/spellcheck/src/mozPersonalDictionary.cpp
@@ -16,30 +16,27 @@
 #include "nsNetUtil.h"
 #include "nsStringEnumerator.h"
 #include "nsUnicharInputStream.h"
 #include "nsIRunnable.h"
 #include "nsThreadUtils.h"
 
 #define MOZ_PERSONAL_DICT_NAME "persdict.dat"
 
-const int kMaxWordLen=256;
-
 /**
  * This is the most braindead implementation of a personal dictionary possible.
  * There is not much complexity needed, though.  It could be made much faster,
  *  and probably should, but I don't see much need for more in terms of interface.
  *
  * Allowing personal words to be associated with only certain dictionaries maybe.
  *
  * TODO:
  * Implement the suggestion record.
  */
 
-
 NS_IMPL_CYCLE_COLLECTING_ADDREF(mozPersonalDictionary)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(mozPersonalDictionary)
 
 NS_INTERFACE_MAP_BEGIN(mozPersonalDictionary)
   NS_INTERFACE_MAP_ENTRY(mozIPersonalDictionary)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, mozIPersonalDictionary)
@@ -385,9 +382,8 @@ NS_IMETHODIMP mozPersonalDictionary::Obs
     mIsLoaded = false;
     Load(); // load automatically clears out the existing dictionary table
   } else if (!nsCRT::strcmp(aTopic, "profile-before-change")) {
     Save();
   }
 
   return NS_OK;
 }
-
--- a/extensions/universalchardet/src/base/moz.build
+++ b/extensions/universalchardet/src/base/moz.build
@@ -28,8 +28,10 @@ UNIFIED_SOURCES += [
     'nsSBCharSetProber.cpp',
     'nsSBCSGroupProber.cpp',
     'nsSJISProber.cpp',
     'nsUniversalDetector.cpp',
     'nsUTF8Prober.cpp',
 ]
 
 FINAL_LIBRARY = 'universalchardet'
+
+FAIL_ON_WARNINGS = True
--- a/extensions/universalchardet/src/xpcom/moz.build
+++ b/extensions/universalchardet/src/xpcom/moz.build
@@ -11,8 +11,10 @@ UNIFIED_SOURCES += [
 
 LIBRARY_NAME = 'universalchardet'
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '../base',
 ]
+
+FAIL_ON_WARNINGS = True
--- a/extensions/universalchardet/src/xpcom/nsUdetXPCOMWrapper.cpp
+++ b/extensions/universalchardet/src/xpcom/nsUdetXPCOMWrapper.cpp
@@ -10,19 +10,16 @@
 #include "nsCharSetProber.h" // for DumpStatus
 
 #include "nsUniversalCharDetDll.h"
 //---- for XPCOM
 #include "nsIFactory.h"
 #include "nsISupports.h"
 #include "nsCOMPtr.h"
 
-static NS_DEFINE_CID(kUniversalDetectorCID, NS_UNIVERSAL_DETECTOR_CID);
-static NS_DEFINE_CID(kUniversalStringDetectorCID, NS_UNIVERSAL_STRING_DETECTOR_CID);
-
 //---------------------------------------------------------------------
 nsXPCOMDetector:: nsXPCOMDetector(uint32_t aLanguageFilter)
  : nsUniversalDetector(aLanguageFilter)
 {
 }
 //---------------------------------------------------------------------
 nsXPCOMDetector::~nsXPCOMDetector() 
 {
--- a/parser/html/moz.build
+++ b/parser/html/moz.build
@@ -95,8 +95,9 @@ MSVC_ENABLE_PGO = True
 FINAL_LIBRARY = 'gklayout'
 
 # DEFINES['ENABLE_VOID_MENUITEM'] = True
 
 LOCAL_INCLUDES += [
     '../../content/base/src',
 ]
 
+FAIL_ON_WARNINGS = True
--- a/parser/html/nsParserUtils.cpp
+++ b/parser/html/nsParserUtils.cpp
@@ -40,20 +40,16 @@
 #define XHTML_DIV_TAG "div xmlns=\"http://www.w3.org/1999/xhtml\""
 
 using namespace mozilla::dom;
 
 NS_IMPL_ISUPPORTS(nsParserUtils,
                   nsIScriptableUnescapeHTML,
                   nsIParserUtils)
 
-static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID);
-
-
-
 NS_IMETHODIMP
 nsParserUtils::ConvertToPlainText(const nsAString& aFromStr,
                                   uint32_t aFlags,
                                   uint32_t aWrapCol,
                                   nsAString& aToStr)
 {
   return nsContentUtils::ConvertToPlainText(aFromStr,
     aToStr,
--- a/toolkit/xre/nsSigHandlers.cpp
+++ b/toolkit/xre/nsSigHandlers.cpp
@@ -34,31 +34,31 @@
 #if defined(SOLARIS)
 #include <sys/resource.h>
 #include <ucontext.h>
 #endif
 
 static char _progname[1024] = "huh?";
 static unsigned int _gdb_sleep_duration = 300;
 
-// NB: keep me up to date with the same variable in
-// ipc/chromium/chrome/common/ipc_channel_posix.cc
-static const int kClientChannelFd = 3;
-
 #if defined(LINUX) && defined(DEBUG) && \
       (defined(__i386) || defined(__x86_64) || defined(PPC))
 #define CRAWL_STACK_ON_SIGSEGV
 #endif
 
 #if defined(CRAWL_STACK_ON_SIGSEGV)
 
 #include <unistd.h>
 #include "nsISupportsUtils.h"
 #include "nsStackWalk.h"
 
+// NB: keep me up to date with the same variable in
+// ipc/chromium/chrome/common/ipc_channel_posix.cc
+static const int kClientChannelFd = 3;
+
 extern "C" {
 
 static void PrintStackFrame(void *aPC, void *aSP, void *aClosure)
 {
   char buf[1024];
   nsCodeAddressDetails details;
 
   NS_DescribeCodeAddress(aPC, &details);