Bug 829112: Fix "comparison between signed and unsigned integer expressions" warnings in nsStyleSet.cpp. r=bz
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 10 Jan 2013 10:40:53 -0800
changeset 118450 5b042b636671dd61e242c8f396ad1f35b56d493f
parent 118449 fdfa7133f2079cb8897925d0bdc49d8f13eb59d3
child 118451 33e9b69e55cc0a16471d3d3228ef299118d9806c
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)
reviewersbz
bugs829112
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 829112: Fix "comparison between signed and unsigned integer expressions" warnings in nsStyleSet.cpp. r=bz
layout/style/nsStyleSet.cpp
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -290,17 +290,17 @@ SortStyleSheetsByScope(nsTArray<nsCSSSty
   }
 }
 
 nsresult
 nsStyleSet::GatherRuleProcessors(sheetType aType)
 {
   mRuleProcessors[aType] = nullptr;
   if (aType == eScopedDocSheet) {
-    for (int i = 0; i < mScopedDocSheetRuleProcessors.Length(); i++) {
+    for (uint32_t i = 0; i < mScopedDocSheetRuleProcessors.Length(); i++) {
       nsIStyleRuleProcessor* processor = mScopedDocSheetRuleProcessors[i].get();
       Element* scope =
         static_cast<nsCSSRuleProcessor*>(processor)->GetScopeElement();
       scope->ClearIsScopedStyleRoot();
     }
     mScopedDocSheetRuleProcessors.Clear();
   }
   if (mAuthorStyleDisabled && (aType == eDocSheet || 
@@ -327,17 +327,17 @@ nsStyleSet::GatherRuleProcessors(sheetTy
   if (aType == eScopedDocSheet) {
     // Create a rule processor for each scope.
     uint32_t count = mSheets[eScopedDocSheet].Count();
     if (count) {
       // Gather the scoped style sheets into an array as
       // nsCSSStyleSheets, and mark all of their scope elements
       // as scoped style roots.
       nsTArray<nsCSSStyleSheet*> sheets(count);
-      for (int32_t i = 0; i < count; i++) {
+      for (uint32_t i = 0; i < count; i++) {
         nsRefPtr<nsCSSStyleSheet> sheet =
           do_QueryObject(mSheets[eScopedDocSheet].ObjectAt(i));
         sheets.AppendElement(sheet);
 
         Element* scope = sheet->GetScopeElement();
         scope->SetIsScopedStyleRoot();
       }
 
@@ -956,17 +956,17 @@ nsStyleSet::FileRules(nsIStyleRuleProces
   bool haveImportantDocRules = !aRuleWalker->GetCheckForImportantRules();
   nsTArray<nsRuleNode*> lastScopedRNs;
   nsTArray<bool> haveImportantScopedRules;
   bool haveAnyImportantScopedRules = false;
   if (!skipUserStyles && !cutOffInheritance &&
       aElement && aElement->IsElementInStyleScope()) {
     lastScopedRNs.SetLength(mScopedDocSheetRuleProcessors.Length());
     haveImportantScopedRules.SetLength(mScopedDocSheetRuleProcessors.Length());
-    for (int32_t i = 0; i < mScopedDocSheetRuleProcessors.Length(); i++) {
+    for (uint32_t i = 0; i < mScopedDocSheetRuleProcessors.Length(); i++) {
       aRuleWalker->SetLevel(eScopedDocSheet, false, true);
       nsCSSRuleProcessor* processor =
         static_cast<nsCSSRuleProcessor*>(mScopedDocSheetRuleProcessors[i].get());
       aData->mScope = processor->GetScopeElement();
       (*aCollectorFunc)(mScopedDocSheetRuleProcessors[i], aData);
       lastScopedRNs[i] = aRuleWalker->CurrentNode();
       haveImportantScopedRules[i] = !aRuleWalker->GetCheckForImportantRules();
       haveAnyImportantScopedRules = haveAnyImportantScopedRules || haveImportantScopedRules[i];
@@ -1105,17 +1105,17 @@ nsStyleSet::WalkRuleProcessors(nsIStyleR
     } else {
       mBindingManager->WalkRules(aFunc, aData, &cutOffInheritance);
     }
   }
   if (!skipUserStyles && !cutOffInheritance) {
     if (mRuleProcessors[eDocSheet]) // NOTE: different
       (*aFunc)(mRuleProcessors[eDocSheet], aData);
     if (aData->mElement->IsElementInStyleScope()) {
-      for (int32_t i = 0; i < mScopedDocSheetRuleProcessors.Length(); i++)
+      for (uint32_t i = 0; i < mScopedDocSheetRuleProcessors.Length(); i++)
         (*aFunc)(mScopedDocSheetRuleProcessors[i], aData);
     }
   }
   if (mRuleProcessors[eStyleAttrSheet])
     (*aFunc)(mRuleProcessors[eStyleAttrSheet], aData);
   if (mRuleProcessors[eOverrideSheet])
     (*aFunc)(mRuleProcessors[eOverrideSheet], aData);
   (*aFunc)(mRuleProcessors[eAnimationSheet], aData);