Bug 795351: Replace LL_MAXINT, LL_MININT, LL_MAXUINT with stdint versions; r=ehsan

This commit is contained in:
Isaac Aggrey 2012-09-28 14:55:23 -05:00
parent c034040abb
commit b95ab79e45
38 changed files with 74 additions and 74 deletions

View File

@ -1554,7 +1554,7 @@ nsXMLHttpRequest::DispatchProgressEvent(nsDOMEventTargetHelper* aTarget,
}
progress->InitProgressEvent(aType, false, false, aLengthComputable,
aLoaded, (aTotal == LL_MAXUINT) ? 0 : aTotal);
aLoaded, (aTotal == UINT64_MAX) ? 0 : aTotal);
if (aUseLSEventWrapper) {
nsCOMPtr<nsIDOMProgressEvent> xhrprogressEvent =
@ -3656,7 +3656,7 @@ nsXMLHttpRequest::OnProgress(nsIRequest *aRequest, nsISupports *aContext, uint64
bool upload = !!((XML_HTTP_REQUEST_OPENED | XML_HTTP_REQUEST_SENT) & mState);
// When uploading, OnProgress reports also headers in aProgress and aProgressMax.
// So, try to remove the headers, if possible.
bool lengthComputable = (aProgressMax != LL_MAXUINT);
bool lengthComputable = (aProgressMax != UINT64_MAX);
if (upload) {
uint64_t loaded = aProgress;
uint64_t total = aProgressMax;

View File

@ -457,7 +457,7 @@ public:
// doesn't bubble.
static nsresult CreateReadystatechangeEvent(nsIDOMEvent** aDOMEvent);
// For backwards compatibility aPosition should contain the headers for upload
// and aTotalSize is LL_MAXUINT when unknown. Both those values are
// and aTotalSize is UINT64_MAX when unknown. Both those values are
// used by nsXMLHttpProgressEvent. Normal progress event should not use
// headers in aLoaded and aTotal is 0 when unknown.
void DispatchProgressEvent(nsDOMEventTargetHelper* aTarget,
@ -477,7 +477,7 @@ public:
{
DispatchProgressEvent(aTarget, aType, false,
aLengthComputable, aLoaded, aTotal,
aLoaded, aLengthComputable ? aTotal : LL_MAXUINT);
aLoaded, aLengthComputable ? aTotal : UINT64_MAX);
}
// Dispatch the "progress" event on the XHR or XHR.upload object if we've

View File

@ -525,7 +525,7 @@ nsSMILAnimationController::DoMilestoneSamples()
// registered for those times. This way events can fire in the correct order,
// dependencies can be resolved etc.
nsSMILTime sampleTime = LL_MININT;
nsSMILTime sampleTime = INT64_MIN;
while (true) {
// We want to find any milestones AT OR BEFORE the current sample time so we

View File

@ -52,7 +52,7 @@ nsAttrValue::EnumTable nsSMILAnimationFunction::sCalcModeTable[] = {
nsSMILAnimationFunction::nsSMILAnimationFunction()
: mSampleTime(-1),
mRepeatIteration(0),
mBeginTime(LL_MININT),
mBeginTime(INT64_MIN),
mAnimationElement(nullptr),
mErrorFlags(0),
mIsActive(false),

View File

@ -5,7 +5,7 @@
#include "nsSMILTimeValue.h"
nsSMILTime nsSMILTimeValue::kUnresolvedMillis = LL_MAXINT;
nsSMILTime nsSMILTimeValue::kUnresolvedMillis = INT64_MAX;
//----------------------------------------------------------------------
// nsSMILTimeValue methods:

View File

@ -192,7 +192,7 @@ nsAttrValue::EnumTable nsSMILTimedElement::sRestartModeTable[] = {
{nullptr, 0}
};
const nsSMILMilestone nsSMILTimedElement::sMaxMilestone(LL_MAXINT, false);
const nsSMILMilestone nsSMILTimedElement::sMaxMilestone(INT64_MAX, false);
// The thresholds at which point we start filtering intervals and instance times
// indiscriminately.
@ -1630,7 +1630,7 @@ nsSMILTimedElement::GetNextInterval(const nsSMILInterval* aPrevInterval,
prevIntervalWasZeroDur
= aPrevInterval->End()->Time() == aPrevInterval->Begin()->Time();
} else {
beginAfter.SetMillis(LL_MININT);
beginAfter.SetMillis(INT64_MIN);
}
nsRefPtr<nsSMILInstanceTime> tempBegin;
@ -2104,7 +2104,7 @@ nsSMILTimedElement::AddInstanceTimeFromCurrentTime(nsSMILTime aCurrentTime,
double offset = aOffsetSeconds * PR_MSEC_PER_SEC;
// Check we won't overflow the range of nsSMILTime
if (aCurrentTime + NS_round(offset) > LL_MAXINT)
if (aCurrentTime + NS_round(offset) > INT64_MAX)
return NS_ERROR_ILLEGAL_VALUE;
nsSMILTimeValue timeVal(aCurrentTime + int64_t(NS_round(offset)));

View File

@ -288,10 +288,10 @@ nsSHistory::CalcMaxTotalViewers()
return 0;
// Conversion from unsigned int64 to double doesn't work on all platforms.
// We need to truncate the value at LL_MAXINT to make sure we don't
// We need to truncate the value at INT64_MAX to make sure we don't
// overflow.
if (LL_CMP(bytes, >, LL_MAXINT))
bytes = LL_MAXINT;
if (LL_CMP(bytes, >, INT64_MAX))
bytes = INT64_MAX;
uint64_t kbytes;
LL_SHR(kbytes, bytes, 10);

View File

@ -167,7 +167,7 @@ FileInputStreamWrapper::Read(char* aBuf, uint32_t aCount, uint32_t* _retval)
if (mFirstTime) {
mFirstTime = false;
if (mOffset != LL_MAXUINT) {
if (mOffset != UINT64_MAX) {
nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mInputStream);
if (seekable) {
rv = seekable->Seek(nsISeekableStream::NS_SEEK_SET, mOffset);
@ -293,7 +293,7 @@ FileOutputStreamWrapper::Write(const char* aBuf, uint32_t aCount,
nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mOutputStream);
if (seekable) {
if (mOffset == LL_MAXUINT) {
if (mOffset == UINT64_MAX) {
rv = seekable->Seek(nsISeekableStream::NS_SEEK_END, 0);
}
else {

View File

@ -507,7 +507,7 @@ LockedFile::GetLocation(JSContext* aCx,
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
if (mLocation == LL_MAXUINT) {
if (mLocation == UINT64_MAX) {
*aLocation = JSVAL_NULL;
}
else {
@ -524,7 +524,7 @@ LockedFile::SetLocation(JSContext* aCx,
// Null means the end-of-file.
if (JSVAL_IS_NULL(aLocation)) {
mLocation = LL_MAXUINT;
mLocation = UINT64_MAX;
return NS_OK;
}
@ -592,7 +592,7 @@ LockedFile::ReadAsArrayBuffer(uint64_t aSize,
return NS_ERROR_DOM_FILEHANDLE_LOCKEDFILE_INACTIVE_ERR;
}
if (mLocation == LL_MAXUINT) {
if (mLocation == UINT64_MAX) {
return NS_ERROR_DOM_FILEHANDLE_NOT_ALLOWED_ERR;
}
@ -634,7 +634,7 @@ LockedFile::ReadAsText(uint64_t aSize,
return NS_ERROR_DOM_FILEHANDLE_LOCKEDFILE_INACTIVE_ERR;
}
if (mLocation == LL_MAXUINT) {
if (mLocation == UINT64_MAX) {
return NS_ERROR_DOM_FILEHANDLE_NOT_ALLOWED_ERR;
}
@ -703,11 +703,11 @@ LockedFile::Truncate(uint64_t aSize,
uint64_t location;
if (aOptionalArgCount) {
// Just in case someone calls us from C++
NS_ASSERTION(aSize != LL_MAXUINT, "Passed wrong size!");
NS_ASSERTION(aSize != UINT64_MAX, "Passed wrong size!");
location = aSize;
}
else {
if (mLocation == LL_MAXUINT) {
if (mLocation == UINT64_MAX) {
return NS_ERROR_DOM_FILEHANDLE_NOT_ALLOWED_ERR;
}
location = mLocation;
@ -855,7 +855,7 @@ LockedFile::WriteOrAppend(const jsval& aValue,
return NS_ERROR_DOM_FILEHANDLE_READ_ONLY_ERR;
}
if (!aAppend && mLocation == LL_MAXUINT) {
if (!aAppend && mLocation == UINT64_MAX) {
return NS_ERROR_DOM_FILEHANDLE_NOT_ALLOWED_ERR;
}
@ -878,7 +878,7 @@ LockedFile::WriteOrAppend(const jsval& aValue,
nsRefPtr<FileRequest> fileRequest = GenerateFileRequest();
NS_ENSURE_TRUE(fileRequest, NS_ERROR_DOM_FILEHANDLE_UNKNOWN_ERR);
uint64_t location = aAppend ? LL_MAXUINT : mLocation;
uint64_t location = aAppend ? UINT64_MAX : mLocation;
nsRefPtr<WriteHelper> helper =
new WriteHelper(this, fileRequest, location, inputStream, inputLength);
@ -887,7 +887,7 @@ LockedFile::WriteOrAppend(const jsval& aValue,
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_FILEHANDLE_UNKNOWN_ERR);
if (aAppend) {
mLocation = LL_MAXUINT;
mLocation = UINT64_MAX;
}
else {
mLocation += inputLength;

View File

@ -69,7 +69,7 @@ ObjectStoreInfo::ObjectStoreInfo(ObjectStoreInfo& aOther)
#ifdef NS_BUILD_REFCNT_LOGGING
IndexInfo::IndexInfo()
: id(LL_MININT),
: id(INT64_MIN),
keyPath(0),
unique(false),
multiEntry(false)

View File

@ -92,7 +92,7 @@ struct IndexInfo
~IndexInfo();
#else
IndexInfo()
: id(LL_MININT), keyPath(0), unique(false), multiEntry(false) { }
: id(INT64_MIN), keyPath(0), unique(false), multiEntry(false) { }
#endif
bool operator==(const IndexInfo& aOther) const

View File

@ -54,7 +54,7 @@ namespace {
struct ObjectStoreInfoMap
{
ObjectStoreInfoMap()
: id(LL_MININT), info(nullptr) { }
: id(INT64_MIN), info(nullptr) { }
int64_t id;
ObjectStoreInfo* info;

View File

@ -397,7 +397,7 @@ IDBIndex::Create(IDBObjectStore* aObjectStore,
}
IDBIndex::IDBIndex()
: mId(LL_MININT),
: mId(INT64_MIN),
mKeyPath(0),
mCachedKeyPath(JSVAL_VOID),
mActorChild(nullptr),

View File

@ -777,7 +777,7 @@ IDBObjectStore::UpdateIndexes(IDBTransaction* aTransaction,
nsCOMPtr<mozIStorageStatement> stmt;
nsresult rv;
NS_ASSERTION(aObjectDataId != LL_MININT, "Bad objectData id!");
NS_ASSERTION(aObjectDataId != INT64_MIN, "Bad objectData id!");
NS_NAMED_LITERAL_CSTRING(objectDataId, "object_data_id");
@ -1455,7 +1455,7 @@ IDBObjectStore::ConvertBlobsToActors(
}
IDBObjectStore::IDBObjectStore()
: mId(LL_MININT),
: mId(INT64_MIN),
mKeyPath(0),
mCachedKeyPath(JSVAL_VOID),
mRooted(false),

View File

@ -140,7 +140,7 @@ public:
int64_t Id() const
{
NS_ASSERTION(mId != LL_MININT, "Don't ask for this yet!");
NS_ASSERTION(mId != INT64_MIN, "Don't ask for this yet!");
return mId;
}

View File

@ -1530,9 +1530,9 @@ inline void
IncrementUsage(uint64_t* aUsage, uint64_t aDelta)
{
// Watch for overflow!
if ((LL_MAXINT - *aUsage) <= aDelta) {
if ((INT64_MAX - *aUsage) <= aDelta) {
NS_WARNING("Database sizes exceed max we can report!");
*aUsage = LL_MAXINT;
*aUsage = INT64_MAX;
}
else {
*aUsage += aDelta;

View File

@ -24,7 +24,7 @@ public:
NS_DECL_NSIOBSERVER
nsCookiePermission()
: mCookiesLifetimeSec(LL_MAXINT)
: mCookiesLifetimeSec(INT64_MAX)
, mCookiesLifetimePolicy(0) // ACCEPT_NORMALLY
, mCookiesAlwaysAcceptSession(false)
{}

View File

@ -292,7 +292,7 @@ nsInputStreamPump::AsyncRead(nsIStreamListener *listener, nsISupports *ctxt)
// stream case, the stream transport service will take care of seeking
// for us.
//
if (mAsyncStream && (mStreamOffset != LL_MAXUINT)) {
if (mAsyncStream && (mStreamOffset != UINT64_MAX)) {
nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mStream);
if (seekable)
seekable->Seek(nsISeekableStream::NS_SEEK_SET, mStreamOffset);

View File

@ -882,7 +882,7 @@ nsSocketTransport::SendStatus(nsresult status)
}
}
if (sink)
sink->OnTransportStatus(this, status, progress, LL_MAXUINT);
sink->OnTransportStatus(this, status, progress, UINT64_MAX);
}
nsresult

View File

@ -175,7 +175,7 @@ nsInputStreamTransport::Read(char *buf, uint32_t count, uint32_t *result)
mFirstTime = false;
if (mOffset != 0) {
// read from current position if offset equal to max
if (mOffset != LL_MAXUINT) {
if (mOffset != UINT64_MAX) {
nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mSource);
if (seekable)
seekable->Seek(nsISeekableStream::NS_SEEK_SET, mOffset);
@ -375,7 +375,7 @@ nsOutputStreamTransport::Write(const char *buf, uint32_t count, uint32_t *result
mFirstTime = false;
if (mOffset != 0) {
// write to current position if offset equal to max
if (mOffset != LL_MAXUINT) {
if (mOffset != UINT64_MAX) {
nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mSink);
if (seekable)
seekable->Seek(nsISeekableStream::NS_SEEK_SET, mOffset);

View File

@ -924,10 +924,10 @@ nsCacheProfilePrefObserver::MemoryCacheCapacity()
bytes = 32 * 1024 * 1024;
// Conversion from unsigned int64 to double doesn't work on all platforms.
// We need to truncate the value at LL_MAXINT to make sure we don't
// We need to truncate the value at INT64_MAX to make sure we don't
// overflow.
if (LL_CMP(bytes, >, LL_MAXINT))
bytes = LL_MAXINT;
if (LL_CMP(bytes, >, INT64_MAX))
bytes = INT64_MAX;
uint64_t kbytes;
LL_SHR(kbytes, bytes, 10);

View File

@ -126,7 +126,7 @@ class EvictionObserver
nsRefPtr<nsOfflineCacheEvictionFunction> mEvictionFunction;
};
#define DCACHE_HASH_MAX LL_MAXINT
#define DCACHE_HASH_MAX INT64_MAX
#define DCACHE_HASH_BITS 64
/**

View File

@ -2660,7 +2660,7 @@ nsCookieService::SetCookieInternal(nsIURI *aHostURI,
nsCookieAttributes cookieAttributes;
// init expiryTime such that session cookies won't prematurely expire
cookieAttributes.expiryTime = LL_MAXINT;
cookieAttributes.expiryTime = INT64_MAX;
// aCookieHeader is an in/out param to point to the next cookie, if
// there is one. Save the present value for logging purposes
@ -3437,7 +3437,7 @@ nsCookieService::RemoveAllFromMemory()
// which releases all their respective children.
mDBState->hostTable.Clear();
mDBState->cookieCount = 0;
mDBState->cookieOldestTime = LL_MAXINT;
mDBState->cookieOldestTime = INT64_MAX;
}
// stores temporary data for enumerating over the hash entries,
@ -3453,7 +3453,7 @@ struct nsPurgeData
mozIStorageBindingParamsArray *aParamsArray)
: currentTime(aCurrentTime)
, purgeTime(aPurgeTime)
, oldestTime(LL_MAXINT)
, oldestTime(INT64_MAX)
, purgeList(aPurgeList)
, removedList(aRemovedList)
, paramsArray(aParamsArray)

View File

@ -148,7 +148,7 @@ struct CookieDomainTuple
// conveniently switch state when entering or exiting private browsing.
struct DBState
{
DBState() : cookieCount(0), cookieOldestTime(LL_MAXINT), corruptFlag(OK)
DBState() : cookieCount(0), cookieOldestTime(INT64_MAX), corruptFlag(OK)
{
hostTable.Init();
}

View File

@ -68,7 +68,7 @@ nsFtpState::nsFtpState()
, mReceivedControlData(false)
, mTryingCachedControl(false)
, mRETRFailed(false)
, mFileSize(LL_MAXUINT)
, mFileSize(UINT64_MAX)
, mServerType(FTP_GENERIC_TYPE)
, mAction(GET)
, mAnonymous(true)

View File

@ -27,7 +27,7 @@ namespace mozilla {
namespace net {
HttpBaseChannel::HttpBaseChannel()
: mStartPos(LL_MAXUINT)
: mStartPos(UINT64_MAX)
, mStatus(NS_OK)
, mLoadFlags(LOAD_NORMAL)
, mPriority(PRIORITY_NORMAL)
@ -1361,7 +1361,7 @@ HttpBaseChannel::GetEntityID(nsACString& aEntityID)
return NS_ERROR_NOT_RESUMABLE;
}
uint64_t size = LL_MAXUINT;
uint64_t size = UINT64_MAX;
nsAutoCString etag, lastmod;
if (mResponseHead) {
// Don't return an entity if the server sent the following header:

View File

@ -163,7 +163,7 @@ struct nsHttp
const char *separators);
// This function parses a string containing a decimal-valued, non-negative
// 64-bit integer. If the value would exceed LL_MAXINT, then false is
// 64-bit integer. If the value would exceed INT64_MAX, then false is
// returned. Otherwise, this function returns true and stores the
// parsed value in |result|. The next unparsed character in |input| is
// optionally returned via |next| if |next| is non-null.

View File

@ -61,7 +61,7 @@ nsHttpConnectionMgr::nsHttpConnectionMgr()
, mIsShuttingDown(false)
, mNumActiveConns(0)
, mNumIdleConns(0)
, mTimeOfNextWakeUp(LL_MAXUINT)
, mTimeOfNextWakeUp(UINT64_MAX)
, mTimeoutTickArmed(false)
{
LOG(("Creating nsHttpConnectionMgr @%x\n", this));
@ -200,7 +200,7 @@ nsHttpConnectionMgr::ConditionallyStopPruneDeadConnectionsTimer()
LOG(("nsHttpConnectionMgr::StopPruneDeadConnectionsTimer\n"));
// Reset mTimeOfNextWakeUp so that we can find a new shortest value.
mTimeOfNextWakeUp = LL_MAXUINT;
mTimeOfNextWakeUp = UINT64_MAX;
if (mTimer) {
mTimer->Cancel();
mTimer = NULL;
@ -1986,7 +1986,7 @@ nsHttpConnectionMgr::OnMsgPruneDeadConnections(int32_t, void *)
LOG(("nsHttpConnectionMgr::OnMsgPruneDeadConnections\n"));
// Reset mTimeOfNextWakeUp so that we can find a new shortest value.
mTimeOfNextWakeUp = LL_MAXUINT;
mTimeOfNextWakeUp = UINT64_MAX;
// check canreuse() for all idle connections plus any active connections on
// connection entries that are using spdy.

View File

@ -463,7 +463,7 @@ nsHttpResponseHead::Reset()
mVersion = NS_HTTP_VERSION_1_1;
mStatus = 200;
mContentLength = LL_MAXUINT;
mContentLength = UINT64_MAX;
mCacheControlNoStore = false;
mCacheControlNoCache = false;
mPragmaNoCache = false;
@ -560,7 +560,7 @@ nsHttpResponseHead::TotalEntitySize() const
int64_t size;
if (!nsHttp::ParseInt64(slash, &size))
size = LL_MAXUINT;
size = UINT64_MAX;
return size;
}

View File

@ -20,7 +20,7 @@ class nsHttpResponseHead
public:
nsHttpResponseHead() : mVersion(NS_HTTP_VERSION_1_1)
, mStatus(200)
, mContentLength(LL_MAXUINT)
, mContentLength(UINT64_MAX)
, mCacheControlNoStore(false)
, mCacheControlNoCache(false)
, mPragmaNoCache(false) {}

View File

@ -12,7 +12,7 @@ NS_IMPL_ISUPPORTS1(nsDirIndex,
nsIDirIndex)
nsDirIndex::nsDirIndex() : mType(TYPE_UNKNOWN),
mSize(LL_MAXUINT),
mSize(UINT64_MAX),
mLastModified(-1) {
}

View File

@ -305,7 +305,7 @@ nsDirIndexParser::ParseData(nsIDirIndex *aIdx, char* aDataStr) {
if (status == 1)
aIdx->SetSize(len);
else
aIdx->SetSize(LL_MAXUINT); // LL_MAXUINT means unknown
aIdx->SetSize(UINT64_MAX); // UINT64_MAX means unknown
}
break;
case FIELD_LASTMODIFIED:

View File

@ -931,7 +931,7 @@ nsIndexedToHTML::OnIndexAvailable(nsIRequest *aRequest,
int64_t size;
aIndex->GetSize(&size);
if (uint64_t(size) != LL_MAXUINT) {
if (uint64_t(size) != UINT64_MAX) {
pushBuffer.AppendLiteral(" sortable-data=\"");
pushBuffer.AppendInt(size);
pushBuffer.AppendLiteral("\">");

View File

@ -40,7 +40,7 @@ nsPartChannel::nsPartChannel(nsIChannel *aMultipartChannel, uint32_t aPartID,
mMultipartChannel(aMultipartChannel),
mListener(aListener),
mStatus(NS_OK),
mContentLength(LL_MAXUINT),
mContentLength(UINT64_MAX),
mIsByteRangeRequest(false),
mByteRangeStart(0),
mByteRangeEnd(0),
@ -592,7 +592,7 @@ nsMultiMixedConv::OnDataAvailable(nsIRequest *request, nsISupports *context,
mNewPart = true;
// Reset state so we don't carry it over from part to part
mContentType.Truncate();
mContentLength = LL_MAXUINT;
mContentLength = UINT64_MAX;
mContentDisposition.Truncate();
mIsByteRangeRequest = false;
mByteRangeStart = 0;
@ -738,7 +738,7 @@ nsMultiMixedConv::nsMultiMixedConv() :
{
mTokenLen = 0;
mNewPart = true;
mContentLength = LL_MAXUINT;
mContentLength = UINT64_MAX;
mBuffer = nullptr;
mBufLen = 0;
mProcessingHeaders = false;
@ -865,7 +865,7 @@ nsMultiMixedConv::SendData(char *aBuffer, uint32_t aLen) {
if (!mPartChannel) return NS_ERROR_FAILURE; // something went wrong w/ processing
if (mContentLength != LL_MAXUINT) {
if (mContentLength != UINT64_MAX) {
// make sure that we don't send more than the mContentLength
// XXX why? perhaps the Content-Length header was actually wrong!!
if ((uint64_t(aLen) + mTotalSent) > mContentLength)
@ -917,7 +917,7 @@ nsMultiMixedConv::ParseHeaders(nsIChannel *aChannel, char *&aPtr,
bool done = false;
uint32_t lineFeedIncrement = 1;
mContentLength = LL_MAXUINT; // XXX what if we were already called?
mContentLength = UINT64_MAX; // XXX what if we were already called?
while (cursorLen && (newLine = (char *) memchr(cursor, nsCRT::LF, cursorLen))) {
// adjust for linefeeds
if ((newLine > cursor) && (newLine[-1] == nsCRT::CR) ) { // CRLF
@ -994,7 +994,7 @@ nsMultiMixedConv::ParseHeaders(nsIChannel *aChannel, char *&aPtr,
}
mIsByteRangeRequest = true;
if (mContentLength == LL_MAXUINT)
if (mContentLength == UINT64_MAX)
mContentLength = uint64_t(mByteRangeEnd - mByteRangeStart + 1);
}
}

View File

@ -621,7 +621,7 @@ main(int32_t argc, char *argv[])
false, // is secure
false, // is httponly
true, // is session
LL_MAXINT)); // expiry time
INT64_MAX)); // expiry time
rv[2] = NS_SUCCEEDED(cookieMgr2->Add(NS_LITERAL_CSTRING("cookiemgr.test"), // domain
NS_LITERAL_CSTRING("/foo"), // path
NS_LITERAL_CSTRING("test2"), // name
@ -637,7 +637,7 @@ main(int32_t argc, char *argv[])
false, // is secure
false, // is httponly
true, // is session
LL_MAXINT)); // expiry time
INT64_MAX)); // expiry time
// confirm using enumerator
nsCOMPtr<nsISimpleEnumerator> enumerator;
rv[4] = NS_SUCCEEDED(cookieMgr->GetEnumerator(getter_AddRefs(enumerator)));
@ -685,7 +685,7 @@ main(int32_t argc, char *argv[])
false, // is secure
false, // is httponly
true, // is session
LL_MININT)); // expiry time
INT64_MIN)); // expiry time
rv[13] = NS_SUCCEEDED(cookieMgr2->CookieExists(newDomainCookie, &found)) && !found;
// sleep four seconds, to make sure the second cookie has expired
PR_Sleep(4 * PR_TicksPerSecond());

View File

@ -1074,7 +1074,7 @@ NS_IMETHODIMP nsDocLoader::OnProgress(nsIRequest *aRequest, nsISupports* ctxt,
// so update mMaxSelfProgress... Otherwise, set it to -1 to indicate
// that the content-length is no longer known.
//
if (uint64_t(aProgressMax) != LL_MAXUINT) {
if (uint64_t(aProgressMax) != UINT64_MAX) {
mMaxSelfProgress += int64_t(aProgressMax);
info->mMaxProgress = int64_t(aProgressMax);
} else {

View File

@ -128,7 +128,7 @@ private:
static TimeDuration FromTicks(double aTicks) {
// NOTE: this MUST be a >= test, because int64_t(double(INT64_MAX))
// overflows and gives LL_MININT.
// overflows and gives INT64_MIN.
if (aTicks >= double(INT64_MAX))
return TimeDuration::FromTicks(INT64_MAX);
@ -198,16 +198,16 @@ public:
TimeDuration operator-(const TimeStamp& aOther) const {
MOZ_ASSERT(!IsNull(), "Cannot compute with a null value");
MOZ_ASSERT(!aOther.IsNull(), "Cannot compute with aOther null value");
PR_STATIC_ASSERT(-LL_MAXINT > LL_MININT);
PR_STATIC_ASSERT(-INT64_MAX > INT64_MIN);
int64_t ticks = int64_t(mValue - aOther.mValue);
// Check for overflow.
if (mValue > aOther.mValue) {
if (ticks < 0) {
ticks = LL_MAXINT;
ticks = INT64_MAX;
}
} else {
if (ticks > 0) {
ticks = LL_MININT;
ticks = INT64_MIN;
}
}
return TimeDuration::FromTicks(ticks);

View File

@ -434,7 +434,7 @@ nsHTTPIndex::OnIndexAvailable(nsIRequest* aRequest, nsISupports *aContext,
int64_t size;
rv = aIndex->GetSize(&size);
if (NS_FAILED(rv)) return rv;
int64_t minus1 = LL_MAXUINT;
int64_t minus1 = UINT64_MAX;
if (LL_NE(size, minus1)) {
int32_t intSize;
LL_L2I(intSize, size);