Bug 652559: Fix signed/unsigned comparison build warning in nsGlobalWindow.cpp. r=bz

This commit is contained in:
Daniel Holbert 2011-04-25 10:58:42 -07:00
Родитель 86080d0500
Коммит 0544e9d3a8
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -8808,14 +8808,14 @@ nsGlobalWindow::SetTimeoutOrInterval(nsIScriptTimeoutHandler *aHandler,
interval = NS_MAX(aIsInterval ? 1 : 0, interval); interval = NS_MAX(aIsInterval ? 1 : 0, interval);
// Make sure we don't proceed with an interval larger than our timer // Make sure we don't proceed with an interval larger than our timer
// code can handle. // code can handle. (Note: we already forced |interval| to be non-negative,
if (interval > PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE)) { // so the PRUint32 cast (to avoid compiler warnings) is ok.)
interval = PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE); PRUint32 maxTimeoutMs = PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE);
if (static_cast<PRUint32>(interval) > maxTimeoutMs) {
interval = maxTimeoutMs;
} }
nsTimeout *timeout = new nsTimeout(); nsTimeout *timeout = new nsTimeout();
if (!timeout)
return NS_ERROR_OUT_OF_MEMORY;
// Increment the timeout's reference count to represent this function's hold // Increment the timeout's reference count to represent this function's hold
// on the timeout. // on the timeout.