Bug 653295 - Fixing warning of comparision between signed and unsigned integer expressions in nsFrameSetFrame.cpp. r=bz
authorAtul Aggarwal <atulagrwl@gmail.com>
Mon, 26 Sep 2011 01:47:43 +0530
changeset 77568 7d983fc8a13c41fef193013d146474284bc4e877
parent 77567 29f857ce7e31b5a2166943d3539a93c53148905d
child 77569 44ef245b870628514f0fd9ba667788b56b0ecd65
child 77573 0c880a09186d4afeddeda29bc191a1691e86804a
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersbz
bugs653295
milestone9.0a1
Bug 653295 - Fixing warning of comparision between signed and unsigned integer expressions in nsFrameSetFrame.cpp. r=bz
layout/generic/nsFrameSetFrame.cpp
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -1356,23 +1356,20 @@ nsHTMLFramesetFrame::RecalculateBorderRe
   PR_STATIC_ASSERT(NS_MAX_FRAMESET_SPEC_COUNT < PR_INT32_MAX / NS_MAX_FRAMESET_SPEC_COUNT);
   PRInt32 numCells = mNumRows * mNumCols; // max number of cells
   PR_STATIC_ASSERT(NS_MAX_FRAMESET_SPEC_COUNT
                    < UINT_MAX / sizeof(PRInt32) / NS_MAX_FRAMESET_SPEC_COUNT); 
   nsAutoArrayPtr<PRInt32> childTypes(new PRInt32[numCells]);
   if (NS_UNLIKELY(!childTypes)) {
     return;
   }
-  PRUint32 childIndex, childTypeIndex = 0;
+  PRInt32 childTypeIndex = 0;
 
-  // number of any type of children
-  PRUint32 numChildren = mContent->GetChildCount();
-  for (childIndex = 0; childIndex < numChildren; childIndex++) {
-    nsIContent *child = mContent->GetChildAt(childIndex);
-
+  for (nsIContent *child = mContent->GetFirstChild(); child;
+       child = child->GetNextSibling()) {
     if (child->IsHTML()) {
       nsINodeInfo *ni = child->NodeInfo();
 
       if (ni->Equals(nsGkAtoms::frameset)) {
         childTypes[childTypeIndex++] = FRAMESET;
       } else if (ni->Equals(nsGkAtoms::frame)) {
         childTypes[childTypeIndex++] = FRAME;
       }