mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 09:01:16 +00:00
Bug 652559: Fix signed/unsigned comparison build warning in nsGlobalWindow.cpp. r=bz
This commit is contained in:
parent
86080d0500
commit
0544e9d3a8
@ -8808,14 +8808,14 @@ nsGlobalWindow::SetTimeoutOrInterval(nsIScriptTimeoutHandler *aHandler,
|
||||
interval = NS_MAX(aIsInterval ? 1 : 0, interval);
|
||||
|
||||
// Make sure we don't proceed with an interval larger than our timer
|
||||
// code can handle.
|
||||
if (interval > PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE)) {
|
||||
interval = PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE);
|
||||
// code can handle. (Note: we already forced |interval| to be non-negative,
|
||||
// so the PRUint32 cast (to avoid compiler warnings) is ok.)
|
||||
PRUint32 maxTimeoutMs = PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE);
|
||||
if (static_cast<PRUint32>(interval) > maxTimeoutMs) {
|
||||
interval = maxTimeoutMs;
|
||||
}
|
||||
|
||||
nsTimeout *timeout = new nsTimeout();
|
||||
if (!timeout)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// Increment the timeout's reference count to represent this function's hold
|
||||
// on the timeout.
|
||||
|
Loading…
Reference in New Issue
Block a user