bug 829288 - fix some toolkit/ warnings r=ehsan
authorTrevor Saunders <trev.saunders@gmail.com>
Thu, 10 Jan 2013 06:44:15 -0500
changeset 118485 eaab0e962e4d4e38bfba418b67e8a66cc69a0572
parent 118484 ab93edfbb1ea72ebad9e9780ec44c02cd04004ce
child 118486 deab61ea49b612ee87b3f0b4da27a4a82e91f7d0
push id24166
push userMs2ger@gmail.com
push dateFri, 11 Jan 2013 13:57:41 +0000
treeherdermozilla-central@63c4b0f66a0c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs829288
milestone21.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 829288 - fix some toolkit/ warnings r=ehsan
toolkit/components/commandlines/nsCommandLine.cpp
toolkit/components/ctypes/ctypes.cpp
toolkit/components/telemetry/Telemetry.cpp
toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp
toolkit/xre/nsNativeAppSupportWin.cpp
--- a/toolkit/components/commandlines/nsCommandLine.cpp
+++ b/toolkit/components/commandlines/nsCommandLine.cpp
@@ -440,17 +440,16 @@ nsCommandLine::resolveShortcutURL(nsIFil
 
   uri->GetSpec(outURL);
 }
 
 NS_IMETHODIMP
 nsCommandLine::Init(int32_t argc, const char* const* argv, nsIFile* aWorkingDir,
                     uint32_t aState)
 {
-  NS_ENSURE_ARG_MIN(aState, 0);
   NS_ENSURE_ARG_MAX(aState, 2);
 
   int32_t i;
 
   mWorkingDir = aWorkingDir;
 
   // skip argv[0], we don't want it
   for (i = 1; i < argc; ++i) {
--- a/toolkit/components/ctypes/ctypes.cpp
+++ b/toolkit/components/ctypes/ctypes.cpp
@@ -115,17 +115,16 @@ NS_IMETHODIMP
 Module::Call(nsIXPConnectWrappedNative* wrapper,
              JSContext* cx,
              JSObject* obj,
              uint32_t argc,
              jsval* argv,
              jsval* vp,
              bool* _retval)
 {
-  bool reusingGlobal = Preferences::GetBool("jsloader.reuseGlobal");
   JSObject* targetObj = nullptr;
 
   mozJSComponentLoader* loader = mozJSComponentLoader::Get();
   nsresult rv = loader->FindTargetObject(cx, &targetObj);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *_retval = InitAndSealCTypesClass(cx, targetObj);
   return NS_OK;
--- a/toolkit/components/telemetry/Telemetry.cpp
+++ b/toolkit/components/telemetry/Telemetry.cpp
@@ -135,17 +135,17 @@ CombinedStacks::GetModule(unsigned aInde
 }
 
 void
 CombinedStacks::AddStack(const Telemetry::ProcessedStack& aStack) {
   mStacks.resize(mStacks.size() + 1);
   CombinedStacks::Stack& adjustedStack = mStacks.back();
 
   size_t stackSize = aStack.GetStackSize();
-  for (int i = 0; i < stackSize; ++i) {
+  for (size_t i = 0; i < stackSize; ++i) {
     const Telemetry::ProcessedStack::Frame& frame = aStack.GetFrame(i);
     uint16_t modIndex;
     if (frame.mModIndex == std::numeric_limits<uint16_t>::max()) {
       modIndex = frame.mModIndex;
     } else {
       const Telemetry::ProcessedStack::Module& module =
         aStack.GetModule(frame.mModIndex);
       std::vector<Telemetry::ProcessedStack::Module>::iterator modIterator =
--- a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp
+++ b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp
@@ -2,26 +2,27 @@
 /* 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 <windows.h>
 #include <ras.h>
 #include <wininet.h>
 
+#include "mozilla/Attributes.h"
 #include "mozilla/Util.h"
 #include "nsISystemProxySettings.h"
 #include "nsIServiceManager.h"
 #include "mozilla/ModuleUtils.h"
 #include "nsPrintfCString.h"
 #include "nsNetUtil.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIURI.h"
 
-class nsWindowsSystemProxySettings : public nsISystemProxySettings
+class nsWindowsSystemProxySettings MOZ_FINAL : public nsISystemProxySettings
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISYSTEMPROXYSETTINGS
 
     nsWindowsSystemProxySettings() {};
     nsresult Init();
 
--- a/toolkit/xre/nsNativeAppSupportWin.cpp
+++ b/toolkit/xre/nsNativeAppSupportWin.cpp
@@ -44,16 +44,18 @@
 #include <shellapi.h>
 #include <ddeml.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <io.h>
 #include <direct.h>
 #include <fcntl.h>
 
+using namespace mozilla;
+
 static HWND hwndForDOMWindow( nsISupports * );
 
 static
 nsresult
 GetMostRecentWindow(const PRUnichar* aType, nsIDOMWindow** aWindow) {
     nsresult rv;
     nsCOMPtr<nsIWindowMediator> med( do_GetService( NS_WINDOWMEDIATOR_CONTRACTID, &rv ) );
     if ( NS_FAILED( rv ) )
@@ -1468,17 +1470,17 @@ protected:
   JSContext                         *mContext;
 };
 
 SafeJSContext::SafeJSContext() : mContext(nullptr) {
 }
 
 SafeJSContext::~SafeJSContext() {
   JSContext *cx;
-  nsresult   rv;
+  DebugOnly<nsresult> rv;
 
   if(mContext) {
     rv = mService->Pop(&cx);
     NS_ASSERTION(NS_SUCCEEDED(rv) && cx == mContext, "JSContext push/pop mismatch");
   }
 }
 
 nsresult SafeJSContext::Push() {