Commit 35bc9a72 authored by foudfou's avatar foudfou
Browse files

Bug 785542 - Convert usages of PR_MIN and PR_MAX to NS_MIN and NS_MAX; r=ehsan

Occurences of PR_MAX in layout/style/nsCSSProps.cpp and xpcom/glue/nsTArray.h
can not be converted without C++11 support (constexpr).

--HG--
extra : rebase_source : 3b4f7e26690fad487dd11594449948411d4e79bc
parent 7cb47126
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2543,7 +2543,7 @@ nsresult nsBuiltinDecoderStateMachine::ScheduleStateMachine(int64_t aUsecs) {
  if (mState == DECODER_STATE_SHUTDOWN) {
    return NS_ERROR_FAILURE;
  }
  aUsecs = PR_MAX(aUsecs, 0);
  aUsecs = NS_MAX<int64_t>(aUsecs, 0);

  TimeStamp timeout = TimeStamp::Now() + UsecsToDuration(aUsecs);
  if (!mTimeout.IsNull()) {
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ private:
      const TimeStamp& frame = mFrames[i];
      if (!frame.IsNull() && frame > beginningOfWindow) {
        ++numFramesDrawnInWindow;
        earliestFrameInWindow = PR_MIN(earliestFrameInWindow, frame);
        earliestFrameInWindow = NS_MIN(earliestFrameInWindow, frame);
      }
    }
    double realWindowSecs = (aNow - earliestFrameInWindow).ToSeconds();
+1 −1
Original line number Diff line number Diff line
@@ -401,7 +401,7 @@ bool ReadFromFile(const char *filename, char (&buf)[n])
    return false;
  }

  buf[PR_MIN(numRead, n - 1)] = '\0';
  buf[NS_MIN(numRead, n - 1)] = '\0';
  return true;
}

+2 −2
Original line number Diff line number Diff line
@@ -2948,12 +2948,12 @@ DrawBorderImage(nsPresContext* aPresContext,
  };
  const int32_t sliceWidth[3] = {
    slice.left,
    PR_MAX(imageSize.width - slice.left - slice.right, 0),
    NS_MAX(imageSize.width - slice.left - slice.right, 0),
    slice.right,
  };
  const int32_t sliceHeight[3] = {
    slice.top,
    PR_MAX(imageSize.height - slice.top - slice.bottom, 0),
    NS_MAX(imageSize.height - slice.top - slice.bottom, 0),
    slice.bottom,
  };

+2 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@

#include <assert.h>
#include "nsAutoPtr.h"
#include "nsAlgorithm.h"
#include "BasePin.h"

namespace mozilla {
@@ -214,7 +215,7 @@ BasePin::QueryPinInfo(PIN_INFO * aInfo)
  if (!mName.empty()) {
    // Copy at most (max_buffer_size - sizeof(WCHAR)). The -1 is there to
    // ensure we always have a null terminator.
    unsigned int len = PR_MIN((MAX_PIN_NAME-1)*sizeof(WCHAR), (sizeof(WCHAR)*mName.length()));
    size_t len = NS_MIN<size_t>(MAX_PIN_NAME - 1, mName.length()) * sizeof(WCHAR);
    memcpy(aInfo->achName, mName.data(), len);
  }

Loading