Bug 530374 - Replace PR_MIN/PR_MAX with NS_MIN/NS_MAX in xslt, r=jonas
☠☠ backed out by ba2968f7fe46 ☠ ☠
authorJae-Seong Lee-Russo <lusian@gmail.com>
Wed, 30 Dec 2009 18:27:30 -0500
changeset 36758 dfc79d02e945f241872e0b1009fc09b581c398a3
parent 36757 15d6851096b963c3a9619df1b0fa8c2af90daa00
child 36759 8522f262360819120d766661ad247f8f05ddfce0
child 36761 ba2968f7fe46a45b9805a3c133aa1a052d18c964
push idunknown
push userunknown
push dateunknown
reviewersjonas
bugs530374
milestone1.9.3a1pre
Bug 530374 - Replace PR_MIN/PR_MAX with NS_MIN/NS_MAX in xslt, r=jonas
content/xslt/src/base/txDouble.cpp
content/xslt/src/base/txStringUtils.cpp
content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
content/xslt/src/xpath/txNodeSet.cpp
content/xslt/src/xslt/txMozillaXMLOutput.cpp
content/xul/content/src/nsXULElement.cpp
--- a/content/xslt/src/base/txDouble.cpp
+++ b/content/xslt/src/base/txDouble.cpp
@@ -260,17 +260,17 @@ void Double::toString(double aValue, nsA
     if (intDigits < 1) {
         *dest = '0'; ++dest;
         *dest = '.'; ++dest;
         for (i = 0; i > intDigits; --i) {
             *dest = '0'; ++dest;
         }
     }
     // mantissa
-    int firstlen = PR_MIN(intDigits, endp - buf);
+    int firstlen = NS_MIN(intDigits, endp - buf);
     for (i = 0; i < firstlen; i++) {
         *dest = buf[i]; ++dest;
     }
     if (i < endp - buf) {
         if (i > 0) {
             *dest = '.'; ++dest;
         }
         for (; i < endp - buf; i++) {
--- a/content/xslt/src/base/txStringUtils.cpp
+++ b/content/xslt/src/base/txStringUtils.cpp
@@ -116,17 +116,17 @@ public:
   typedef PRUnichar value_type;
 
   CopyToLowerCase(nsAString::iterator& aDestIter) : mIter(aDestIter)
   {
   }
 
   void write(const PRUnichar* aSource, PRUint32 aSourceLength)
   {
-    PRUint32 len = PR_MIN(PRUint32(mIter.size_forward()), aSourceLength);
+    PRUint32 len = NS_MIN(PRUint32(mIter.size_forward()), aSourceLength);
     PRUnichar* cp = mIter.get();
     const PRUnichar* end = aSource + len;
     while (aSource != end) {
       PRUnichar ch = *aSource;
       if ((ch >= 'A') && (ch <= 'Z'))
         *cp = ch + ('a' - 'A');
       else
         *cp = ch;
--- a/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
+++ b/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
@@ -717,17 +717,17 @@ txXPathNodeUtils::comparePosition(const 
         otherNode = otherNode->GetNodeParent();
     }
 
     // Walk back down along the parent-chains until we find where they split.
     PRInt32 total = parents.Length() - 1;
     PRInt32 otherTotal = otherParents.Length() - 1;
     NS_ASSERTION(total != otherTotal, "Can't have same number of parents");
 
-    PRInt32 lastIndex = PR_MIN(total, otherTotal);
+    PRInt32 lastIndex = NS_MIN(total, otherTotal);
     PRInt32 i;
     parent = nsnull;
     for (i = 0; i <= lastIndex; ++i) {
         node = parents.ElementAt(total - i);
         otherNode = otherParents.ElementAt(otherTotal - i);
         if (node != otherNode) {
             if (!parent) {
                 // The two nodes are in different orphan subtrees.
--- a/content/xslt/src/xpath/txNodeSet.cpp
+++ b/content/xslt/src/xpath/txNodeSet.cpp
@@ -547,17 +547,17 @@ PRBool txNodeSet::ensureGrowSize(PRInt32
         mStart = dest;
         mEnd = dest + oldSize;
             
         return PR_TRUE;
     }
 
     // This isn't 100% safe. But until someone manages to make a 1gig nodeset
     // it should be ok.
-    PRInt32 newLength = PR_MAX(oldLength, kTxNodeSetMinSize);
+    PRInt32 newLength = NS_MAX(oldLength, kTxNodeSetMinSize);
 
     while (newLength < ensureSize) {
         newLength *= kTxNodeSetGrowFactor;
     }
 
     txXPathNode* newArr = static_cast<txXPathNode*>
                                      (nsMemory::Alloc(newLength *
                                                          sizeof(txXPathNode)));
--- a/content/xslt/src/xslt/txMozillaXMLOutput.cpp
+++ b/content/xslt/src/xslt/txMozillaXMLOutput.cpp
@@ -655,17 +655,17 @@ txMozillaXMLOutput::createTxWrapper()
         }
 #endif
 
         if (childContent->Tag() == nsGkAtoms::documentTypeNodeName) {
 #ifdef DEBUG
             // The new documentElement should go after the document type.
             // This is needed for cases when there is no existing
             // documentElement in the document.
-            rootLocation = PR_MAX(rootLocation, j + 1);
+            rootLocation = NS_MAX(rootLocation, j + 1);
 #endif
             ++j;
         }
         else {
             rv = mDocument->RemoveChildAt(j, PR_TRUE);
             NS_ENSURE_SUCCESS(rv, rv);
 
             rv = wrapper->AppendChildTo(childContent, PR_TRUE);
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -979,17 +979,17 @@ nsXULElement::RemoveChildAt(PRUint32 aIn
     
     if (newCurrentIndex == -2)
         controlElement->SetCurrentItem(nsnull);
     else if (newCurrentIndex > -1) {
         // Make sure the index is still valid
         PRInt32 treeRows;
         listBox->GetRowCount(&treeRows);
         if (treeRows > 0) {
-            newCurrentIndex = PR_MIN((treeRows - 1), newCurrentIndex);
+            newCurrentIndex = NS_MIN((treeRows - 1), newCurrentIndex);
             nsCOMPtr<nsIDOMElement> newCurrentItem;
             listBox->GetItemAtIndex(newCurrentIndex, getter_AddRefs(newCurrentItem));
             nsCOMPtr<nsIDOMXULSelectControlItemElement> xulCurItem = do_QueryInterface(newCurrentItem);
             if (xulCurItem)
                 controlElement->SetCurrentItem(xulCurItem);
         } else {
             controlElement->SetCurrentItem(nsnull);
         }