Bug 751314 - fix -Wsign-compare warnings in nsGlobalWindow.cpp; r=khuey
authorNathan Froyd <froydnj@mozilla.com>
Wed, 02 May 2012 15:38:17 -0400
changeset 93410 9399d5faf9eee3a4289a035888a2a108342b2c3d
parent 93409 44e88a715dccfe56078b4d141633b4b7e707dcb8
child 93411 7a8607523522bfe8576614273bd8967469d60db1
push id22634
push useremorley@mozilla.com
push dateTue, 08 May 2012 09:48:43 +0000
treeherdermozilla-central@e4f9e2eab6b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs751314
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 751314 - fix -Wsign-compare warnings in nsGlobalWindow.cpp; r=khuey
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -9695,17 +9695,17 @@ nsGlobalWindow::SuspendTimeouts(PRUint32
   FORWARD_TO_INNER_VOID(SuspendTimeouts, (aIncrease, aFreezeChildren));
 
   bool suspended = (mTimeoutsSuspendDepth != 0);
   mTimeoutsSuspendDepth += aIncrease;
 
   if (!suspended) {
     nsCOMPtr<nsIDeviceSensors> ac = do_GetService(NS_DEVICE_SENSORS_CONTRACTID);
     if (ac) {
-      for (int i = 0; i < mEnabledSensors.Length(); i++)
+      for (PRUint32 i = 0; i < mEnabledSensors.Length(); i++)
         ac->RemoveWindowListener(mEnabledSensors[i], this);
     }
 
     // Suspend all of the workers for this window.
     nsIScriptContext *scx = GetContextInternal();
     JSContext *cx = scx ? scx->GetNativeContext() : nsnull;
     mozilla::dom::workers::SuspendWorkersForWindow(cx, this);
 
@@ -9775,17 +9775,17 @@ nsGlobalWindow::ResumeTimeouts(bool aTha
   NS_ASSERTION(mTimeoutsSuspendDepth, "Mismatched calls to ResumeTimeouts!");
   --mTimeoutsSuspendDepth;
   bool shouldResume = (mTimeoutsSuspendDepth == 0);
   nsresult rv;
 
   if (shouldResume) {
     nsCOMPtr<nsIDeviceSensors> ac = do_GetService(NS_DEVICE_SENSORS_CONTRACTID);
     if (ac) {
-      for (int i = 0; i < mEnabledSensors.Length(); i++)
+      for (PRUint32 i = 0; i < mEnabledSensors.Length(); i++)
         ac->AddWindowListener(mEnabledSensors[i], this);
     }
 
     // Resume all of the workers for this window.
     nsIScriptContext *scx = GetContextInternal();
     JSContext *cx = scx ? scx->GetNativeContext() : nsnull;
     mozilla::dom::workers::ResumeWorkersForWindow(cx, this);
 
@@ -9883,17 +9883,17 @@ nsGlobalWindow::TimeoutSuspendCount()
   FORWARD_TO_INNER(TimeoutSuspendCount, (), 0);
   return mTimeoutsSuspendDepth;
 }
 
 void
 nsGlobalWindow::EnableDeviceSensor(PRUint32 aType)
 {
   bool alreadyEnabled = false;
-  for (int i = 0; i < mEnabledSensors.Length(); i++) {
+  for (PRUint32 i = 0; i < mEnabledSensors.Length(); i++) {
     if (mEnabledSensors[i] == aType) {
       alreadyEnabled = true;
       break;
     }
   }
 
   if (alreadyEnabled)
     return;
@@ -9903,18 +9903,18 @@ nsGlobalWindow::EnableDeviceSensor(PRUin
   nsCOMPtr<nsIDeviceSensors> ac = do_GetService(NS_DEVICE_SENSORS_CONTRACTID);
   if (ac)
     ac->AddWindowListener(aType, this);
 }
 
 void
 nsGlobalWindow::DisableDeviceSensor(PRUint32 aType)
 {
-  PRUint32 doomedElement = -1;
-  for (int i = 0; i < mEnabledSensors.Length(); i++) {
+  PRInt32 doomedElement = -1;
+  for (PRUint32 i = 0; i < mEnabledSensors.Length(); i++) {
     if (mEnabledSensors[i] == aType) {
       doomedElement = i;
       break;
     }
   }
 
   if (doomedElement == -1)
     return;