Bug 678209 - Fix c++0x initializer list error found by clang. r=jonas
authorRafael Ávila de Espíndola <respindola@mozilla.com>
Mon, 22 Aug 2011 15:35:19 -0400
changeset 75674 92ad56b41428f102e3b24d6280ffd41ae73c8567
parent 75673 98725bc76d7eb71380a381fd371253bac585f8af
child 75675 622e4cb255f1ca0cdb5ae0af152ca5072589273b
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersjonas
bugs678209
milestone9.0a1
Bug 678209 - Fix c++0x initializer list error found by clang. r=jonas The aLength argument is used in CharacterDataChangeInfo info = { PR_TRUE, oldLength, oldLength, aLength }; and the last field of CharacterDataChangeInfo is a PRUint32, so aLength should be one to for this to be valid c++0x.
parser/html/nsHtml5TreeOperation.cpp
parser/html/nsHtml5TreeOperation.h
--- a/parser/html/nsHtml5TreeOperation.cpp
+++ b/parser/html/nsHtml5TreeOperation.cpp
@@ -135,17 +135,17 @@ nsHtml5TreeOperation::~nsHtml5TreeOperat
       break;
     default: // keep the compiler happy
       break;
   }
 }
 
 nsresult
 nsHtml5TreeOperation::AppendTextToTextNode(const PRUnichar* aBuffer,
-                                           PRInt32 aLength,
+                                           PRUint32 aLength,
                                            nsIContent* aTextNode,
                                            nsHtml5TreeOpExecutor* aBuilder)
 {
   NS_PRECONDITION(aTextNode, "Got null text node.");
 
   if (aBuilder->HaveNotified(aTextNode)) {
     // This text node has already been notified on, so it's necessary to
     // notify on the append
@@ -167,17 +167,17 @@ nsHtml5TreeOperation::AppendTextToTextNo
   }
 
   return aTextNode->AppendText(aBuffer, aLength, PR_FALSE);
 }
 
 
 nsresult
 nsHtml5TreeOperation::AppendText(const PRUnichar* aBuffer,
-                                 PRInt32 aLength,
+                                 PRUint32 aLength,
                                  nsIContent* aParent,
                                  nsHtml5TreeOpExecutor* aBuilder)
 {
   nsresult rv = NS_OK;
   nsIContent* lastChild = aParent->GetLastChild();
   if (lastChild && lastChild->IsNodeOfType(nsINode::eTEXT)) {
     nsHtml5OtherDocUpdate update(aParent->GetOwnerDoc(),
                                  aBuilder->GetDocument());
@@ -491,17 +491,17 @@ nsHtml5TreeOperation::Perform(nsHtml5Tre
           !node->HasAttr(kNameSpaceID_None, nsGkAtoms::form)) {
         formControl->SetForm(formElement);
       }
       return rv;
     }
     case eTreeOpAppendText: {
       nsIContent* parent = *mOne.node;
       PRUnichar* buffer = mTwo.unicharPtr;
-      PRInt32 length = mInt;
+      PRUint32 length = mInt;
       return AppendText(buffer, length, parent, aBuilder);
     }
     case eTreeOpAppendIsindexPrompt: {
       nsIContent* parent = *mOne.node;
       nsXPIDLString prompt;
       nsresult rv =
           nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
                                              "IsIndexPromptWithSpace", prompt);
@@ -513,17 +513,17 @@ nsHtml5TreeOperation::Perform(nsHtml5Tre
         // Don't bother appending a zero-length text node.
         return NS_OK;
       }
       return AppendText(prompt.BeginReading(), len, parent, aBuilder);
     }
     case eTreeOpFosterParentText: {
       nsIContent* stackParent = *mOne.node;
       PRUnichar* buffer = mTwo.unicharPtr;
-      PRInt32 length = mInt;
+      PRUint32 length = mInt;
       nsIContent* table = *mThree.node;
       
       nsIContent* foster = table->GetParent();
 
       if (foster && foster->IsElement()) {
         aBuilder->FlushPendingAppendNotifications();
 
         nsHtml5OtherDocUpdate update(foster->GetOwnerDoc(),
--- a/parser/html/nsHtml5TreeOperation.h
+++ b/parser/html/nsHtml5TreeOperation.h
@@ -312,22 +312,22 @@ class nsHtml5TreeOperation {
       nsAutoString str;
       aAtom->ToString(str);
       return do_GetAtom(str);
     }
 
   private:
 
     nsresult AppendTextToTextNode(const PRUnichar* aBuffer,
-                                  PRInt32 aLength,
+                                  PRUint32 aLength,
                                   nsIContent* aTextNode,
                                   nsHtml5TreeOpExecutor* aBuilder);
 
     nsresult AppendText(const PRUnichar* aBuffer,
-                        PRInt32 aLength,
+                        PRUint32 aLength,
                         nsIContent* aParent,
                         nsHtml5TreeOpExecutor* aBuilder);
 
     nsresult Append(nsIContent* aNode,
                     nsIContent* aParent,
                     nsHtml5TreeOpExecutor* aBuilder);
 
     nsresult AppendToDocument(nsIContent* aNode,