зеркало из https://github.com/mozilla/gecko-dev.git
Bug 530300: Replace PR_MIN/PR_MAX with NS_MIN/NS_MAX in /dom r=peterv
This commit is contained in:
Родитель
9129ed63bf
Коммит
440d083761
|
@ -702,10 +702,10 @@ nsDOMWindowUtils::CompareCanvases(nsIDOMHTMLCanvasElement *aCanvas1,
|
|||
|
||||
different++;
|
||||
|
||||
dc = PR_MAX(abs(p1[0] - p2[0]), dc);
|
||||
dc = PR_MAX(abs(p1[1] - p2[1]), dc);
|
||||
dc = PR_MAX(abs(p1[2] - p2[2]), dc);
|
||||
dc = PR_MAX(abs(p1[3] - p2[3]), dc);
|
||||
dc = NS_MAX((PRUint32)abs(p1[0] - p2[0]), dc);
|
||||
dc = NS_MAX((PRUint32)abs(p1[1] - p2[1]), dc);
|
||||
dc = NS_MAX((PRUint32)abs(p1[2] - p2[2]), dc);
|
||||
dc = NS_MAX((PRUint32)abs(p1[3] - p2[3]), dc);
|
||||
}
|
||||
|
||||
p1 += 4;
|
||||
|
|
|
@ -1202,7 +1202,7 @@ nsFocusManager::GetCommonAncestor(nsPIDOMWindow* aWindow1,
|
|||
PRUint32 pos2 = parents2.Length();
|
||||
nsIDocShellTreeItem* parent = nsnull;
|
||||
PRUint32 len;
|
||||
for (len = PR_MIN(pos1, pos2); len > 0; --len) {
|
||||
for (len = NS_MIN(pos1, pos2); len > 0; --len) {
|
||||
nsIDocShellTreeItem* child1 = parents1.ElementAt(--pos1);
|
||||
nsIDocShellTreeItem* child2 = parents2.ElementAt(--pos2);
|
||||
if (child1 != child2) {
|
||||
|
|
|
@ -3748,10 +3748,10 @@ nsGlobalWindow::GetScrollMaxXY(PRInt32* aScrollMaxX, PRInt32* aScrollMaxY)
|
|||
nsRect scrollRange = sf->GetScrollRange();
|
||||
|
||||
if (aScrollMaxX)
|
||||
*aScrollMaxX = PR_MAX(0,
|
||||
*aScrollMaxX = NS_MAX(0,
|
||||
(PRInt32)floor(nsPresContext::AppUnitsToFloatCSSPixels(scrollRange.XMost())));
|
||||
if (aScrollMaxY)
|
||||
*aScrollMaxY = PR_MAX(0,
|
||||
*aScrollMaxY = NS_MAX(0,
|
||||
(PRInt32)floor(nsPresContext::AppUnitsToFloatCSSPixels(scrollRange.YMost())));
|
||||
|
||||
return NS_OK;
|
||||
|
@ -9096,8 +9096,8 @@ nsGlobalWindow::ResumeTimeouts(PRBool aThawChildren)
|
|||
// likely to always be positive here, but cast anyways for
|
||||
// consistency).
|
||||
PRUint32 delay =
|
||||
PR_MAX(((PRUint32)(t->mWhen / (PRTime)PR_USEC_PER_MSEC)),
|
||||
DOM_MIN_TIMEOUT_VALUE);
|
||||
NS_MAX(((PRUint32)(t->mWhen / (PRTime)PR_USEC_PER_MSEC)),
|
||||
(PRUint32)DOM_MIN_TIMEOUT_VALUE);
|
||||
|
||||
// Set mWhen back to the time when the timer is supposed to
|
||||
// fire.
|
||||
|
|
|
@ -548,7 +548,7 @@ nsGeolocationService::IsBetterPosition(nsIDOMGeoPosition *aSomewhere)
|
|||
|
||||
// The threshold is when the distance between the two positions exceeds the
|
||||
// worse (larger value) of the two accuracies.
|
||||
double max_accuracy = PR_MAX(oldAccuracy, newAccuracy);
|
||||
double max_accuracy = NS_MAX(oldAccuracy, newAccuracy);
|
||||
if (delta > max_accuracy)
|
||||
return PR_TRUE;
|
||||
|
||||
|
|
|
@ -607,7 +607,7 @@ nsJSONListener::OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext,
|
|||
while (bytesRemaining) {
|
||||
unsigned int bytesRead;
|
||||
rv = aStream->Read(buffer,
|
||||
PR_MIN(sizeof(buffer), bytesRemaining),
|
||||
NS_MIN((unsigned long)sizeof(buffer), bytesRemaining),
|
||||
&bytesRead);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = ProcessBytes(buffer, bytesRead);
|
||||
|
|
|
@ -119,7 +119,7 @@ nsresult
|
|||
nsDOMWorkerTimeout::FunctionCallback::Run(nsDOMWorkerTimeout* aTimeout,
|
||||
JSContext* aCx)
|
||||
{
|
||||
PRInt32 lateness = PR_MAX(0, PRInt32(PR_Now() - aTimeout->mTargetTime)) /
|
||||
PRInt32 lateness = NS_MAX(0, PRInt32(PR_Now() - aTimeout->mTargetTime)) /
|
||||
(PRTime)PR_USEC_PER_MSEC;
|
||||
mCallbackArgs[mCallbackArgsLength - 1] = INT_TO_JSVAL(lateness);
|
||||
|
||||
|
@ -383,7 +383,7 @@ nsDOMWorkerTimeout::Suspend()
|
|||
|
||||
mTimer->Cancel();
|
||||
|
||||
mSuspendInterval = PR_MAX(0, PRInt32(mTargetTime - PR_Now())) /
|
||||
mSuspendInterval = NS_MAX(0, PRInt32(mTargetTime - PR_Now())) /
|
||||
(PRTime)PR_USEC_PER_MSEC;
|
||||
|
||||
LOG(("Worker [0x%p] suspending timeout [0x%p] with id %u (interval = %u)",
|
||||
|
|
Загрузка…
Ссылка в новой задаче