Bug 708277 - Replace PR_MAX with NS_MAX. r=roc
☠☠ backed out by cf7878e0d886 ☠ ☠
authorThomas Prip Vestergaard <thomas@prip.nu>
Thu, 22 Dec 2011 11:47:59 +0100
changeset 83247 b02402b95e5cbfa6058d5ecae230604f64ed5fe4
parent 83246 a63f8ea052b6fb5f95ec621fbe4e21c219ed6e41
child 83248 7eb0c2f08597cb12dda6f124ee086c892f252674
push id21744
push userbmo@edmorley.co.uk
push dateFri, 23 Dec 2011 23:56:40 +0000
treeherdermozilla-central@ede336ccaed0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs708277
milestone12.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 708277 - Replace PR_MAX with NS_MAX. r=roc
content/media/nsBuiltinDecoderStateMachine.cpp
netwerk/cache/nsMemoryCacheDevice.cpp
xpcom/glue/pldhash.cpp
--- a/content/media/nsBuiltinDecoderStateMachine.cpp
+++ b/content/media/nsBuiltinDecoderStateMachine.cpp
@@ -2110,17 +2110,17 @@ nsresult nsBuiltinDecoderStateMachine::S
 nsresult nsBuiltinDecoderStateMachine::ScheduleStateMachine(PRInt64 aUsecs) {
   mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();
   NS_ABORT_IF_FALSE(GetStateMachineThread(),
     "Must have a state machine thread to schedule");
 
   if (mState == DECODER_STATE_SHUTDOWN) {
     return NS_ERROR_FAILURE;
   }
-  aUsecs = PR_MAX(aUsecs, 0);
+  aUsecs = NS_MAX(aUsecs, 0);
 
   TimeStamp timeout = TimeStamp::Now() + UsecsToDuration(aUsecs);
   if (!mTimeout.IsNull()) {
     if (timeout >= mTimeout) {
       // We've already scheduled a timer set to expire at or before this time,
       // or have an event dispatched to run the state machine.
       return NS_OK;
     }
--- a/netwerk/cache/nsMemoryCacheDevice.cpp
+++ b/netwerk/cache/nsMemoryCacheDevice.cpp
@@ -405,17 +405,17 @@ nsMemoryCacheDevice::EvictEntriesIfNeces
             while ((entry != &mEvictionList[i]) &&
                    (entry->IsInUse())) {
                 entry = (nsCacheEntry *)PR_NEXT_LINK(entry);
             }
 
             if (entry != &mEvictionList[i]) {
                 entryCost = (PRUint64)
                     (now - entry->LastFetched()) * entry->Size() / 
-                    PR_MAX(1, entry->FetchCount());
+                    NS_MAX(1, entry->FetchCount());
                 if (!maxEntry || (entryCost > maxCost)) {
                     maxEntry = entry;
                     maxCost = entryCost;
                 }
             }
         }
         if (maxEntry) {
             EvictEntry(maxEntry, DELETE_ENTRY);
--- a/xpcom/glue/pldhash.cpp
+++ b/xpcom/glue/pldhash.cpp
@@ -305,30 +305,30 @@ PL_DHashTableSetAlphaBounds(PLDHashTable
      * Ensure that at least one entry will always be free.  If maxAlpha at
      * minimum size leaves no entries free, reduce maxAlpha based on minimum
      * size and the precision limit of maxAlphaFrac's fixed point format.
      */
     NS_ASSERTION(PL_DHASH_MIN_SIZE - (maxAlpha * PL_DHASH_MIN_SIZE) >= 1,
                  "PL_DHASH_MIN_SIZE - (maxAlpha * PL_DHASH_MIN_SIZE) >= 1");
     if (PL_DHASH_MIN_SIZE - (maxAlpha * PL_DHASH_MIN_SIZE) < 1) {
         maxAlpha = (float)
-                   (PL_DHASH_MIN_SIZE - PR_MAX(PL_DHASH_MIN_SIZE / 256, 1))
+                   (PL_DHASH_MIN_SIZE - NS_MAX(PL_DHASH_MIN_SIZE / 256, 1))
                    / PL_DHASH_MIN_SIZE;
     }
 
     /*
      * Ensure that minAlpha is strictly less than half maxAlpha.  Take care
      * not to truncate an entry's worth of alpha when storing in minAlphaFrac
      * (8-bit fixed point format).
      */
     NS_ASSERTION(minAlpha < maxAlpha / 2,
                  "minAlpha < maxAlpha / 2");
     if (minAlpha >= maxAlpha / 2) {
         size = PL_DHASH_TABLE_SIZE(table);
-        minAlpha = (size * maxAlpha - PR_MAX(size / 256, 1)) / (2 * size);
+        minAlpha = (size * maxAlpha - NS_MAX(size / 256, 1)) / (2 * size);
     }
 
     table->maxAlphaFrac = (PRUint8)(maxAlpha * 256);
     table->minAlphaFrac = (PRUint8)(minAlpha * 256);
 }
 
 /*
  * Double hashing needs the second hash code to be relatively prime to table