Bug 530364 - Replace PR_MIN/PR_MAX with NS_MIN/NS_MAX in /parser, r=mrbkap
authorJae-Seong Lee-Russo <lusian@gmail.com>
Sun, 13 Dec 2009 09:32:10 -0800
changeset 35669 868fcb4006046158a3ca4c17b46a213bd910ccf0
parent 35668 8499d4d2037ff3ccced54849f56b371f2d8e0f1a
child 35670 f952995d5044bd144fe27bad7084b41cb4a9b0b1
push id10672
push userphilringnalda@gmail.com
push dateSun, 13 Dec 2009 17:32:43 +0000
treeherdermozilla-central@e89ef920772f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs530364
milestone1.9.3a1pre
Bug 530364 - Replace PR_MIN/PR_MAX with NS_MIN/NS_MAX in /parser, r=mrbkap
parser/htmlparser/src/CNavDTD.cpp
parser/htmlparser/src/nsHTMLTags.cpp
parser/htmlparser/src/nsParser.cpp
--- a/parser/htmlparser/src/CNavDTD.cpp
+++ b/parser/htmlparser/src/CNavDTD.cpp
@@ -501,17 +501,17 @@ IsHiddenInput(CToken* aToken, nsITokeniz
                   "Must be start token");
   NS_PRECONDITION(eHTMLTags(aToken->GetTypeID()) == eHTMLTag_input,
                   "Must be <input> tag");
   
   PRInt32 ac = aToken->GetAttributeCount();
   NS_ASSERTION(ac <= aTokenizer->GetCount(),
                "Not enough tokens in the tokenizer");
   // But we don't really trust ourselves to get that right
-  ac = PR_MIN(ac, aTokenizer->GetCount());
+  ac = NS_MIN(ac, aTokenizer->GetCount());
   
   for (PRInt32 i = 0; i < ac; ++i) {
     NS_ASSERTION(eHTMLTokenTypes(aTokenizer->GetTokenAt(i)->GetTokenType()) ==
                    eToken_attribute, "Unexpected token type");
     // Again, we're not sure we actually manage to guarantee that
     if (eHTMLTokenTypes(aTokenizer->GetTokenAt(i)->GetTokenType()) !=
         eToken_attribute) {
       break;
--- a/parser/htmlparser/src/nsHTMLTags.cpp
+++ b/parser/htmlparser/src/nsHTMLTags.cpp
@@ -378,17 +378,17 @@ nsHTMLTags::AddRefTable(void)
         nsAutoString temp2; temp2.AssignWithConversion(sTagAtoms_info[i].mString);
         NS_ASSERTION(temp1.Equals(temp2), "Bad unicode tag name!");
       }
 
       // let's verify that NS_HTMLTAG_NAME_MAX_LENGTH is correct
       PRUint32 maxTagNameLength = 0;
       for (i = 0; i < NS_HTML_TAG_MAX; ++i) {
         PRUint32 len = nsCRT::strlen(sTagUnicodeTable[i]);
-        maxTagNameLength = PR_MAX(len, maxTagNameLength);        
+        maxTagNameLength = NS_MAX(len, maxTagNameLength);        
       }
       NS_ASSERTION(maxTagNameLength == NS_HTMLTAG_NAME_MAX_LENGTH,
                    "NS_HTMLTAG_NAME_MAX_LENGTH not set correctly!");
     }
 #endif
   }
 
   return NS_OK;
--- a/parser/htmlparser/src/nsParser.cpp
+++ b/parser/htmlparser/src/nsParser.cpp
@@ -498,17 +498,17 @@ nsSpeculativeScriptThread::StartParsing(
 
     nsScannerIterator start;
     context->mScanner->CurrentPosition(start);
 
     if (mNumConsumed > context->mNumConsumed) {
       // We consumed more the last time we tried speculatively parsing than we
       // did the last time we actually parsed.
       PRUint32 distance = Distance(start, end);
-      start.advance(PR_MIN(mNumConsumed - context->mNumConsumed, distance));
+      start.advance(NS_MIN(mNumConsumed - context->mNumConsumed, distance));
     }
 
     if (start == end) {
       // We're at the end of this context's buffer, nothing else to do.
       return NS_OK;
     }
 
     CopyUnicodeTo(start, end, toScan);
@@ -2716,17 +2716,17 @@ nsParser::DetectMetaTag(const char* aByt
   // documents we should be looking inside the XMLDecl.
   if (!mParserContext->mMimeType.EqualsLiteral(kHTMLTextContentType)) {
     return PR_FALSE;
   }
 
   // Fast and loose parsing to determine if we have a complete
   // META tag in this block, looking upto 2k into it.
   const nsASingleFragmentCString& str =
-      Substring(aBytes, aBytes + PR_MIN(aLen, 2048));
+      Substring(aBytes, aBytes + NS_MIN(aLen, 2048));
   // XXXldb Should be const_char_iterator when FindInReadable supports it.
   nsACString::const_iterator begin, end;
 
   str.BeginReading(begin);
   str.EndReading(end);
   nsACString::const_iterator currPos(begin);
   nsACString::const_iterator tokEnd;
   nsACString::const_iterator tagEnd(begin);