Bug 795351: Replace LL_MAXINT, LL_MININT, LL_MAXUINT with stdint versions; r=ehsan
authorIsaac Aggrey <isaac.aggrey@gmail.com>
Fri, 28 Sep 2012 14:55:23 -0500
changeset 114851 bd990a83194e76ef61ee2a5bf53d9e3f8ee32dc2
parent 114850 de06aeb3c7f393dd03f920f7e38d6e16af1d0897
child 114852 70ab9f476d86a8966b2a35804278722a9023ea5e
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs795351
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 795351: Replace LL_MAXINT, LL_MININT, LL_MAXUINT with stdint versions; r=ehsan
content/base/src/nsXMLHttpRequest.cpp
content/base/src/nsXMLHttpRequest.h
content/smil/nsSMILAnimationController.cpp
content/smil/nsSMILAnimationFunction.cpp
content/smil/nsSMILTimeValue.cpp
content/smil/nsSMILTimedElement.cpp
docshell/shistory/src/nsSHistory.cpp
dom/file/FileStreamWrappers.cpp
dom/file/LockedFile.cpp
dom/indexedDB/DatabaseInfo.cpp
dom/indexedDB/DatabaseInfo.h
dom/indexedDB/IDBFactory.cpp
dom/indexedDB/IDBIndex.cpp
dom/indexedDB/IDBObjectStore.cpp
dom/indexedDB/IDBObjectStore.h
dom/indexedDB/IndexedDatabaseManager.cpp
extensions/cookie/nsCookiePermission.h
netwerk/base/src/nsInputStreamPump.cpp
netwerk/base/src/nsSocketTransport2.cpp
netwerk/base/src/nsStreamTransportService.cpp
netwerk/cache/nsCacheService.cpp
netwerk/cache/nsDiskCacheDeviceSQL.cpp
netwerk/cookie/nsCookieService.cpp
netwerk/cookie/nsCookieService.h
netwerk/protocol/ftp/nsFtpConnectionThread.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/nsHttp.h
netwerk/protocol/http/nsHttpConnectionMgr.cpp
netwerk/protocol/http/nsHttpResponseHead.cpp
netwerk/protocol/http/nsHttpResponseHead.h
netwerk/streamconv/converters/nsDirIndex.cpp
netwerk/streamconv/converters/nsDirIndexParser.cpp
netwerk/streamconv/converters/nsIndexedToHTML.cpp
netwerk/streamconv/converters/nsMultiMixedConv.cpp
netwerk/test/TestCookie.cpp
uriloader/base/nsDocLoader.cpp
xpcom/ds/TimeStamp.h
xpfe/components/directory/nsDirectoryViewer.cpp
--- a/content/base/src/nsXMLHttpRequest.cpp
+++ b/content/base/src/nsXMLHttpRequest.cpp
@@ -1549,17 +1549,17 @@ nsXMLHttpRequest::DispatchProgressEvent(
   event->SetTrusted(true);
 
   nsCOMPtr<nsIDOMProgressEvent> progress = do_QueryInterface(event);
   if (!progress) {
     return;
   }
 
   progress->InitProgressEvent(aType, false, false, aLengthComputable,
-                              aLoaded, (aTotal == LL_MAXUINT) ? 0 : aTotal);
+                              aLoaded, (aTotal == UINT64_MAX) ? 0 : aTotal);
 
   if (aUseLSEventWrapper) {
     nsCOMPtr<nsIDOMProgressEvent> xhrprogressEvent =
       new nsXMLHttpProgressEvent(progress, aPosition, aTotalSize, GetOwner());
     event = xhrprogressEvent;
   }
   aTarget->DispatchDOMEvent(nullptr, event, nullptr, nullptr);
   
@@ -3651,17 +3651,17 @@ nsXMLHttpRequest::OnProgress(nsIRequest 
     return NS_OK;
   }
 
   // We're uploading if our state is XML_HTTP_REQUEST_OPENED or
   // XML_HTTP_REQUEST_SENT
   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;
     if (lengthComputable) {
       uint64_t headerSize = aProgressMax - mUploadTotal;
       loaded -= headerSize;
       total -= headerSize;
     }
--- a/content/base/src/nsXMLHttpRequest.h
+++ b/content/base/src/nsXMLHttpRequest.h
@@ -452,17 +452,17 @@ public:
 
   // We need a GetInterface callable from JS for chrome JS
   JS::Value GetInterface(JSContext* aCx, nsIJSIID* aIID, ErrorResult& aRv);
 
   // This creates a trusted readystatechange event, which is not cancelable and
   // 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,
                              const nsAString& aType,
                              // Whether to use nsXMLHttpProgressEvent,
                              // which implements LS Progress Event.
                              bool aUseLSEventWrapper,
                              bool aLengthComputable,
@@ -472,17 +472,17 @@ public:
                              uint64_t aPosition, uint64_t aTotalSize);
   void DispatchProgressEvent(nsDOMEventTargetHelper* aTarget,
                              const nsAString& aType,
                              bool aLengthComputable,
                              uint64_t aLoaded, uint64_t aTotal)
   {
     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
   // received data since the last "progress" event. Also dispatches
   // "uploadprogress" as needed.
   void MaybeDispatchProgressEvents(bool aFinalProgress);
 
   // This is called by the factory constructor.
--- a/content/smil/nsSMILAnimationController.cpp
+++ b/content/smil/nsSMILAnimationController.cpp
@@ -520,17 +520,17 @@ nsSMILAnimationController::DoMilestoneSa
   // endpoint-exclusive timing model.
   //
   // So we have the animations (specifically the timed elements) register the
   // next significant moment (called a milestone) in their lifetime and then we
   // step through the model at each of these moments and sample those animations
   // 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
     // initialise the next milestone to the moment after (1ms after, to be
     // precise) the current sample time and see if there are any milestones
     // before that. Any other milestones will be dealt with in a subsequent
     // sample.
     nsSMILMilestone nextMilestone(GetCurrentTime() + 1, true);
--- a/content/smil/nsSMILAnimationFunction.cpp
+++ b/content/smil/nsSMILAnimationFunction.cpp
@@ -47,17 +47,17 @@ nsAttrValue::EnumTable nsSMILAnimationFu
 #define COMPUTE_DISTANCE_ERROR (-1)
 
 //----------------------------------------------------------------------
 // Constructors etc.
 
 nsSMILAnimationFunction::nsSMILAnimationFunction()
   : mSampleTime(-1),
     mRepeatIteration(0),
-    mBeginTime(LL_MININT),
+    mBeginTime(INT64_MIN),
     mAnimationElement(nullptr),
     mErrorFlags(0),
     mIsActive(false),
     mIsFrozen(false),
     mLastValue(false),
     mHasChanged(true),
     mValueNeedsReparsingEverySample(false),
     mPrevSampleWasSingleValueAnimation(false),
--- a/content/smil/nsSMILTimeValue.cpp
+++ b/content/smil/nsSMILTimeValue.cpp
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsSMILTimeValue.h"
 
-nsSMILTime nsSMILTimeValue::kUnresolvedMillis = LL_MAXINT;
+nsSMILTime nsSMILTimeValue::kUnresolvedMillis = INT64_MAX;
 
 //----------------------------------------------------------------------
 // nsSMILTimeValue methods:
 
 static inline int8_t
 Cmp(int64_t aA, int64_t aB)
 {
   return aA == aB ? 0 : (aA > aB ? 1 : -1);
--- a/content/smil/nsSMILTimedElement.cpp
+++ b/content/smil/nsSMILTimedElement.cpp
@@ -187,17 +187,17 @@ nsAttrValue::EnumTable nsSMILTimedElemen
 
 nsAttrValue::EnumTable nsSMILTimedElement::sRestartModeTable[] = {
       {"always", RESTART_ALWAYS},
       {"whenNotActive", RESTART_WHENNOTACTIVE},
       {"never", RESTART_NEVER},
       {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.
 // See FilterIntervals and FilterInstanceTimes.
 const uint8_t nsSMILTimedElement::sMaxNumIntervals = 20;
 const uint8_t nsSMILTimedElement::sMaxNumInstanceTimes = 100;
 
 // Detect if we arrive in some sort of undetected recursive syncbase dependency
@@ -1625,17 +1625,17 @@ nsSMILTimedElement::GetNextInterval(cons
   // Calc starting point
   nsSMILTimeValue beginAfter;
   bool prevIntervalWasZeroDur = false;
   if (aPrevInterval) {
     beginAfter = aPrevInterval->End()->Time();
     prevIntervalWasZeroDur
       = aPrevInterval->End()->Time() == aPrevInterval->Begin()->Time();
   } else {
-    beginAfter.SetMillis(LL_MININT);
+    beginAfter.SetMillis(INT64_MIN);
   }
 
   nsRefPtr<nsSMILInstanceTime> tempBegin;
   nsRefPtr<nsSMILInstanceTime> tempEnd;
 
   while (true) {
     // Calculate begin time
     if (aFixedBeginTime) {
@@ -2099,17 +2099,17 @@ nsSMILTimedElement::SampleFillValue()
 
 nsresult
 nsSMILTimedElement::AddInstanceTimeFromCurrentTime(nsSMILTime aCurrentTime,
     double aOffsetSeconds, bool aIsBegin)
 {
   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)));
 
   nsRefPtr<nsSMILInstanceTime> instanceTime =
     new nsSMILInstanceTime(timeVal, nsSMILInstanceTime::SOURCE_DOM);
 
   AddInstanceTime(instanceTime, aIsBegin);
--- a/docshell/shistory/src/nsSHistory.cpp
+++ b/docshell/shistory/src/nsSHistory.cpp
@@ -283,20 +283,20 @@ nsSHistory::CalcMaxTotalViewers()
   // 2048 Mb       8
   // 4096 Mb       8
   uint64_t bytes = PR_GetPhysicalMemorySize();
 
   if (LL_IS_ZERO(bytes))
     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);
 
   double kBytesD;
   LL_L2D(kBytesD, (int64_t) kbytes);
 
   // This is essentially the same calculation as for nsCacheService,
--- a/dom/file/FileStreamWrappers.cpp
+++ b/dom/file/FileStreamWrappers.cpp
@@ -162,17 +162,17 @@ FileInputStreamWrapper::Read(char* aBuf,
 {
   NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
 
   nsresult rv;
 
   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);
         NS_ENSURE_SUCCESS(rv, rv);
       }
     }
 
     mOffset = 0;
@@ -288,17 +288,17 @@ FileOutputStreamWrapper::Write(const cha
 
 #ifdef DEBUG
     mWriteThread = PR_GetCurrentThread();
 #endif
     mFileHelper->mFileStorage->SetThreadLocals();
 
     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 {
         rv = seekable->Seek(nsISeekableStream::NS_SEEK_SET, mOffset);
       }
       NS_ENSURE_SUCCESS(rv, rv);
     }
 
--- a/dom/file/LockedFile.cpp
+++ b/dom/file/LockedFile.cpp
@@ -502,34 +502,34 @@ LockedFile::GetActive(bool* aActive)
 }
 
 NS_IMETHODIMP
 LockedFile::GetLocation(JSContext* aCx,
                         jsval* aLocation)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
-  if (mLocation == LL_MAXUINT) {
+  if (mLocation == UINT64_MAX) {
     *aLocation = JSVAL_NULL;
   }
   else {
     *aLocation = JS_NumberValue(double(mLocation));
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 LockedFile::SetLocation(JSContext* aCx,
                         const jsval& aLocation)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
   // Null means the end-of-file.
   if (JSVAL_IS_NULL(aLocation)) {
-    mLocation = LL_MAXUINT;
+    mLocation = UINT64_MAX;
     return NS_OK;
   }
 
   uint64_t location;
   if (!JS::ToUint64(aCx, aLocation, &location)) {
     return NS_ERROR_TYPE_ERR;
   }
 
@@ -587,17 +587,17 @@ LockedFile::ReadAsArrayBuffer(uint64_t a
                               nsIDOMFileRequest** _retval)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
   if (!IsOpen()) {
     return NS_ERROR_DOM_FILEHANDLE_LOCKEDFILE_INACTIVE_ERR;
   }
 
-  if (mLocation == LL_MAXUINT) {
+  if (mLocation == UINT64_MAX) {
     return NS_ERROR_DOM_FILEHANDLE_NOT_ALLOWED_ERR;
   }
 
   if (!aSize) {
     return NS_ERROR_TYPE_ERR;
   }
 
   // Do nothing if the window is closed
@@ -629,17 +629,17 @@ LockedFile::ReadAsText(uint64_t aSize,
                        nsIDOMFileRequest** _retval)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
   if (!IsOpen()) {
     return NS_ERROR_DOM_FILEHANDLE_LOCKEDFILE_INACTIVE_ERR;
   }
 
-  if (mLocation == LL_MAXUINT) {
+  if (mLocation == UINT64_MAX) {
     return NS_ERROR_DOM_FILEHANDLE_NOT_ALLOWED_ERR;
   }
 
   if (!aSize) {
     return NS_ERROR_TYPE_ERR;
   }
 
   // Do nothing if the window is closed
@@ -698,21 +698,21 @@ LockedFile::Truncate(uint64_t aSize,
 
   if (mMode != READ_WRITE) {
     return NS_ERROR_DOM_FILEHANDLE_READ_ONLY_ERR;
   }
 
   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;
   }
 
   // Do nothing if the window is closed
   if (!GetOwner()) {
     return NS_OK;
@@ -850,17 +850,17 @@ LockedFile::WriteOrAppend(const jsval& a
   if (!IsOpen()) {
     return NS_ERROR_DOM_FILEHANDLE_LOCKEDFILE_INACTIVE_ERR;
   }
 
   if (mMode != READ_WRITE) {
     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;
   }
 
   // Do nothing if the window is closed
   if (!GetOwner()) {
     return NS_OK;
   }
 
@@ -873,26 +873,26 @@ LockedFile::WriteOrAppend(const jsval& a
 
   if (!inputLength) {
     return NS_OK;
   }
 
   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);
 
   rv = helper->Enqueue();
   NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_FILEHANDLE_UNKNOWN_ERR);
 
   if (aAppend) {
-    mLocation = LL_MAXUINT;
+    mLocation = UINT64_MAX;
   }
   else {
     mLocation += inputLength;
   }
 
   fileRequest.forget(_retval);
   return NS_OK;
 }
--- a/dom/indexedDB/DatabaseInfo.cpp
+++ b/dom/indexedDB/DatabaseInfo.cpp
@@ -64,17 +64,17 @@ ObjectStoreInfo::ObjectStoreInfo(ObjectS
 
   // Doesn't copy the refcount
   MOZ_COUNT_CTOR(ObjectStoreInfo);
 }
 
 #ifdef NS_BUILD_REFCNT_LOGGING
 
 IndexInfo::IndexInfo()
-: id(LL_MININT),
+: id(INT64_MIN),
   keyPath(0),
   unique(false),
   multiEntry(false)
 {
   MOZ_COUNT_CTOR(IndexInfo);
 }
 
 IndexInfo::IndexInfo(const IndexInfo& aOther)
--- a/dom/indexedDB/DatabaseInfo.h
+++ b/dom/indexedDB/DatabaseInfo.h
@@ -87,17 +87,17 @@ struct DatabaseInfo : public DatabaseInf
 struct IndexInfo
 {
 #ifdef NS_BUILD_REFCNT_LOGGING
   IndexInfo();
   IndexInfo(const IndexInfo& aOther);
   ~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
   {
     return this->name == aOther.name &&
            this->id == aOther.id &&
            this->keyPath == aOther.keyPath &&
            this->unique == aOther.unique &&
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -49,17 +49,17 @@ using mozilla::dom::ContentChild;
 using mozilla::dom::ContentParent;
 using mozilla::dom::TabChild;
 
 namespace {
 
 struct ObjectStoreInfoMap
 {
   ObjectStoreInfoMap()
-  : id(LL_MININT), info(nullptr) { }
+  : id(INT64_MIN), info(nullptr) { }
 
   int64_t id;
   ObjectStoreInfo* info;
 };
 
 } // anonymous namespace
 
 IDBFactory::IDBFactory()
--- a/dom/indexedDB/IDBIndex.cpp
+++ b/dom/indexedDB/IDBIndex.cpp
@@ -392,17 +392,17 @@ IDBIndex::Create(IDBObjectStore* aObject
 
     objectStoreActor->SendPIndexedDBIndexConstructor(actor.forget(), params);
   }
 
   return index.forget();
 }
 
 IDBIndex::IDBIndex()
-: mId(LL_MININT),
+: mId(INT64_MIN),
   mKeyPath(0),
   mCachedKeyPath(JSVAL_VOID),
   mActorChild(nullptr),
   mActorParent(nullptr),
   mUnique(false),
   mMultiEntry(false),
   mRooted(false)
 {
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -772,17 +772,17 @@ IDBObjectStore::UpdateIndexes(IDBTransac
                               const Key& aObjectStoreKey,
                               bool aOverwrite,
                               int64_t aObjectDataId,
                               const nsTArray<IndexUpdateInfo>& aUpdateInfoArray)
 {
   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");
 
   if (aOverwrite) {
     stmt = aTransaction->GetCachedStatement(
       "DELETE FROM unique_index_data "
       "WHERE object_data_id = :object_data_id; "
       "DELETE FROM index_data "
@@ -1450,17 +1450,17 @@ IDBObjectStore::ConvertBlobsToActors(
       aActors.AppendElement(actor);
     }
   }
 
   return NS_OK;
 }
 
 IDBObjectStore::IDBObjectStore()
-: mId(LL_MININT),
+: mId(INT64_MIN),
   mKeyPath(0),
   mCachedKeyPath(JSVAL_VOID),
   mRooted(false),
   mAutoIncrement(false),
   mActorChild(nullptr),
   mActorParent(nullptr)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
--- a/dom/indexedDB/IDBObjectStore.h
+++ b/dom/indexedDB/IDBObjectStore.h
@@ -135,17 +135,17 @@ public:
 
   bool IsWriteAllowed() const
   {
     return mTransaction->IsWriteAllowed();
   }
 
   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;
   }
 
   const KeyPath& GetKeyPath() const
   {
     return mKeyPath;
   }
 
--- a/dom/indexedDB/IndexedDatabaseManager.cpp
+++ b/dom/indexedDB/IndexedDatabaseManager.cpp
@@ -1525,19 +1525,19 @@ IndexedDatabaseManager::AsyncUsageRunnab
     NS_ERROR("Canceled more than once?!");
   }
 }
 
 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;
   }
 }
 
 nsresult
 IndexedDatabaseManager::AsyncUsageRunnable::TakeShortcut()
--- a/extensions/cookie/nsCookiePermission.h
+++ b/extensions/cookie/nsCookiePermission.h
@@ -19,17 +19,17 @@ class nsCookiePermission : public nsICoo
                          , public nsIObserver
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICOOKIEPERMISSION
   NS_DECL_NSIOBSERVER
 
   nsCookiePermission()
-    : mCookiesLifetimeSec(LL_MAXINT)
+    : mCookiesLifetimeSec(INT64_MAX)
     , mCookiesLifetimePolicy(0) // ACCEPT_NORMALLY
     , mCookiesAlwaysAcceptSession(false)
     {}
   virtual ~nsCookiePermission() {}
 
   bool Init();
   void PrefChanged(nsIPrefBranch *, const char *);
 
--- a/netwerk/base/src/nsInputStreamPump.cpp
+++ b/netwerk/base/src/nsInputStreamPump.cpp
@@ -287,17 +287,17 @@ nsInputStreamPump::AsyncRead(nsIStreamLi
     if (nonBlocking) {
         mAsyncStream = do_QueryInterface(mStream);
         //
         // if the stream supports nsIAsyncInputStream, and if we need to seek
         // to a starting offset, then we must do so here.  in the non-async
         // 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);
         }
     }
 
     if (!mAsyncStream) {
         // ok, let's use the stream transport service to read this stream.
--- a/netwerk/base/src/nsSocketTransport2.cpp
+++ b/netwerk/base/src/nsSocketTransport2.cpp
@@ -877,17 +877,17 @@ nsSocketTransport::SendStatus(nsresult s
             progress = mInput.ByteCount();
             break;
         default:
             progress = 0;
             break;
         }
     }
     if (sink)
-        sink->OnTransportStatus(this, status, progress, LL_MAXUINT);
+        sink->OnTransportStatus(this, status, progress, UINT64_MAX);
 }
 
 nsresult
 nsSocketTransport::ResolveHost()
 {
     SOCKET_LOG(("nsSocketTransport::ResolveHost [this=%x]\n", this));
 
     nsresult rv;
--- a/netwerk/base/src/nsStreamTransportService.cpp
+++ b/netwerk/base/src/nsStreamTransportService.cpp
@@ -170,17 +170,17 @@ nsInputStreamTransport::Available(uint64
 
 NS_IMETHODIMP
 nsInputStreamTransport::Read(char *buf, uint32_t count, uint32_t *result)
 {
     if (mFirstTime) {
         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);
             }
             // reset offset to zero so we can use it to enforce limit
             mOffset = 0;
         }
     }
@@ -370,17 +370,17 @@ nsOutputStreamTransport::Flush()
 
 NS_IMETHODIMP
 nsOutputStreamTransport::Write(const char *buf, uint32_t count, uint32_t *result)
 {
     if (mFirstTime) {
         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);
             }
             // reset offset to zero so we can use it to enforce limit
             mOffset = 0;
         }
     }
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -919,20 +919,20 @@ nsCacheProfilePrefObserver::MemoryCacheC
 
     // If getting the physical memory failed, arbitrarily assume
     // 32 MB of RAM. We use a low default to have a reasonable
     // size on all the devices we support.
     if (bytes == 0)
         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);
 
     double kBytesD;
     LL_L2D(kBytesD, (int64_t) kbytes);
 
     double x = log(kBytesD)/log(2.0) - 14;
--- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp
+++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp
@@ -121,17 +121,17 @@ class EvictionObserver
 
     void Apply() { return mEvictionFunction->Apply(); }
 
   private:
     mozIStorageConnection *mDB;
     nsRefPtr<nsOfflineCacheEvictionFunction> mEvictionFunction;
 };
 
-#define DCACHE_HASH_MAX  LL_MAXINT
+#define DCACHE_HASH_MAX  INT64_MAX
 #define DCACHE_HASH_BITS 64
 
 /**
  *  nsOfflineCache::Hash(const char * key)
  *
  *  This algorithm of this method implies nsOfflineCacheRecords will be stored
  *  in a certain order on disk.  If the algorithm changes, existing cache
  *  map files may become invalid, and therefore the kCurrentVersion needs
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -2655,17 +2655,17 @@ nsCookieService::SetCookieInternal(nsIUR
 {
   NS_ASSERTION(aHostURI, "null host!");
 
   // create a stack-based nsCookieAttributes, to store all the
   // attributes parsed from the cookie
   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
   nsDependentCString savedCookieHeader(aCookieHeader);
 
   // newCookie says whether there are multiple cookies in the header;
   // so we can handle them separately.
   bool newCookie = ParseAttributes(aCookieHeader, cookieAttributes);
@@ -3432,33 +3432,33 @@ nsCookieService::GetExpiry(nsCookieAttri
 
 void
 nsCookieService::RemoveAllFromMemory()
 {
   // clearing the hashtable will call each nsCookieEntry's dtor,
   // 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,
 // since enumeration is done using callback functions
 struct nsPurgeData
 {
   typedef nsTArray<nsListIter> ArrayType;
 
   nsPurgeData(int64_t aCurrentTime,
               int64_t aPurgeTime,
               ArrayType &aPurgeList,
               nsIMutableArray *aRemovedList,
               mozIStorageBindingParamsArray *aParamsArray)
    : currentTime(aCurrentTime)
    , purgeTime(aPurgeTime)
-   , oldestTime(LL_MAXINT)
+   , oldestTime(INT64_MAX)
    , purgeList(aPurgeList)
    , removedList(aRemovedList)
    , paramsArray(aParamsArray)
   {
   }
 
   // the current time, in seconds
   int64_t currentTime;
--- a/netwerk/cookie/nsCookieService.h
+++ b/netwerk/cookie/nsCookieService.h
@@ -143,17 +143,17 @@ struct CookieDomainTuple
   nsCookieKey key;
   nsRefPtr<nsCookie> cookie;
 };
 
 // encapsulates in-memory and on-disk DB states, so we can
 // 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();
   }
 
   NS_INLINE_DECL_REFCOUNTING(DBState)
 
   // State of the database connection.
   enum CorruptFlag {
--- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
+++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
@@ -63,17 +63,17 @@ NS_IMPL_ISUPPORTS_INHERITED5(nsFtpState,
 nsFtpState::nsFtpState()
     : nsBaseContentStream(true)
     , mState(FTP_INIT)
     , mNextState(FTP_S_USER)
     , mKeepRunning(true)
     , mReceivedControlData(false)
     , mTryingCachedControl(false)
     , mRETRFailed(false)
-    , mFileSize(LL_MAXUINT)
+    , mFileSize(UINT64_MAX)
     , mServerType(FTP_GENERIC_TYPE)
     , mAction(GET)
     , mAnonymous(true)
     , mRetryPass(false)
     , mStorReplyReceived(false)
     , mInternalError(NS_OK)
     , mReconnectAndLoginAgain(false)
     , mCacheConnection(true)
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -22,17 +22,17 @@
 #include "nsStreamListenerWrapper.h"
 
 #include "prnetdb.h"
 
 namespace mozilla {
 namespace net {
 
 HttpBaseChannel::HttpBaseChannel()
-  : mStartPos(LL_MAXUINT)
+  : mStartPos(UINT64_MAX)
   , mStatus(NS_OK)
   , mLoadFlags(LOAD_NORMAL)
   , mPriority(PRIORITY_NORMAL)
   , mCaps(0)
   , mRedirectionLimit(gHttpHandler->RedirectionLimit())
   , mApplyConversion(true)
   , mCanceled(false)
   , mIsPending(false)
@@ -1356,17 +1356,17 @@ NS_IMETHODIMP
 HttpBaseChannel::GetEntityID(nsACString& aEntityID)
 {
   // Don't return an entity ID for Non-GET requests which require
   // additional data
   if (mRequestHead.Method() != nsHttp::Get) {
     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:
     // Accept-Ranges: none
     // Not sending the Accept-Ranges header means we can still try
     // sending range requests.
     const char* acceptRanges =
         mResponseHead->PeekHeader(nsHttp::Accept_Ranges);
--- a/netwerk/protocol/http/nsHttp.h
+++ b/netwerk/protocol/http/nsHttp.h
@@ -158,17 +158,17 @@ struct nsHttp
     // |token| in the |input| string.  the |token| is bounded by elements of
     // |separators| and may appear at the beginning or end of the |input|
     // string.  null is returned if the |token| is not found.  |input| may be
     // null, in which case null is returned.
     static const char *FindToken(const char *input, const char *token,
                                  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.
     //
     // TODO(darin): Replace this with something generic.
     //
     static bool ParseInt64(const char *input, const char **next,
                              int64_t *result);
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -56,17 +56,17 @@ nsHttpConnectionMgr::nsHttpConnectionMgr
     : mRef(0)
     , mReentrantMonitor("nsHttpConnectionMgr.mReentrantMonitor")
     , mMaxConns(0)
     , mMaxPersistConnsPerHost(0)
     , mMaxPersistConnsPerProxy(0)
     , mIsShuttingDown(false)
     , mNumActiveConns(0)
     , mNumIdleConns(0)
-    , mTimeOfNextWakeUp(LL_MAXUINT)
+    , mTimeOfNextWakeUp(UINT64_MAX)
     , mTimeoutTickArmed(false)
 {
     LOG(("Creating nsHttpConnectionMgr @%x\n", this));
     mCT.Init();
     mAlternateProtocolHash.Init(16);
     mSpdyPreferredHash.Init();
 }
 
@@ -195,17 +195,17 @@ nsHttpConnectionMgr::ConditionallyStopPr
     // Leave the timer in place if there are connections that potentially
     // need management
     if (mNumIdleConns || (mNumActiveConns && gHttpHandler->IsSpdyEnabled()))
         return;
 
     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;
     }
 }
 
 void
 nsHttpConnectionMgr::ConditionallyStopTimeoutTick()
@@ -1981,17 +1981,17 @@ nsHttpConnectionMgr::OnMsgProcessPending
 
 void
 nsHttpConnectionMgr::OnMsgPruneDeadConnections(int32_t, void *)
 {
     NS_ABORT_IF_FALSE(PR_GetCurrentThread() == gSocketThread, "wrong thread");
     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.
     if (mNumIdleConns || (mNumActiveConns && gHttpHandler->IsSpdyEnabled()))
         mCT.Enumerate(PruneDeadConnectionsCB, this);
 }
 
 void
--- a/netwerk/protocol/http/nsHttpResponseHead.cpp
+++ b/netwerk/protocol/http/nsHttpResponseHead.cpp
@@ -458,17 +458,17 @@ void
 nsHttpResponseHead::Reset()
 {
     LOG(("nsHttpResponseHead::Reset\n"));
 
     ClearHeaders();
 
     mVersion = NS_HTTP_VERSION_1_1;
     mStatus = 200;
-    mContentLength = LL_MAXUINT;
+    mContentLength = UINT64_MAX;
     mCacheControlNoStore = false;
     mCacheControlNoCache = false;
     mPragmaNoCache = false;
     mStatusText.Truncate();
     mContentType.Truncate();
     mContentCharset.Truncate();
 }
 
@@ -555,17 +555,17 @@ nsHttpResponseHead::TotalEntitySize() co
         return -1; // No idea what the length is
 
     slash++;
     if (*slash == '*') // Server doesn't know the length
         return -1;
 
     int64_t size;
     if (!nsHttp::ParseInt64(slash, &size))
-        size = LL_MAXUINT;
+        size = UINT64_MAX;
     return size;
 }
 
 //-----------------------------------------------------------------------------
 // nsHttpResponseHead <private>
 //-----------------------------------------------------------------------------
 
 void
--- a/netwerk/protocol/http/nsHttpResponseHead.h
+++ b/netwerk/protocol/http/nsHttpResponseHead.h
@@ -15,17 +15,17 @@
 // response.
 //-----------------------------------------------------------------------------
 
 class nsHttpResponseHead
 {
 public:
     nsHttpResponseHead() : mVersion(NS_HTTP_VERSION_1_1)
                          , mStatus(200)
-                         , mContentLength(LL_MAXUINT)
+                         , mContentLength(UINT64_MAX)
                          , mCacheControlNoStore(false)
                          , mCacheControlNoCache(false)
                          , mPragmaNoCache(false) {}
     
     const nsHttpHeaderArray & Headers()   const { return mHeaders; }
     nsHttpHeaderArray    &Headers()             { return mHeaders; }
     nsHttpVersion         Version()       const { return mVersion; }
     uint16_t              Status()        const { return mStatus; }
--- a/netwerk/streamconv/converters/nsDirIndex.cpp
+++ b/netwerk/streamconv/converters/nsDirIndex.cpp
@@ -7,17 +7,17 @@
 #include "nsReadableUtils.h"
 #include "nsCRT.h"
 #include "nsISupportsObsolete.h"
 
 NS_IMPL_ISUPPORTS1(nsDirIndex,
                    nsIDirIndex)
 
 nsDirIndex::nsDirIndex() : mType(TYPE_UNKNOWN),
-                           mSize(LL_MAXUINT),
+                           mSize(UINT64_MAX),
                            mLastModified(-1) {
 }
 
 nsDirIndex::~nsDirIndex() {}
 
 NS_IMPL_GETSET(nsDirIndex, Type, uint32_t, mType)
 
 // GETSET macros for modern strings would be nice...
--- a/netwerk/streamconv/converters/nsDirIndexParser.cpp
+++ b/netwerk/streamconv/converters/nsDirIndexParser.cpp
@@ -300,17 +300,17 @@ nsDirIndexParser::ParseData(nsIDirIndex 
       break;
     case FIELD_CONTENTLENGTH:
       {
         int64_t len;
         int32_t status = PR_sscanf(value, "%lld", &len);
         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:
       {
         PRTime tm;
         nsUnescape(value);
         if (PR_ParseTimeString(value, false, &tm) == PR_SUCCESS) {
           aIdx->SetLastModified(tm);
--- a/netwerk/streamconv/converters/nsIndexedToHTML.cpp
+++ b/netwerk/streamconv/converters/nsIndexedToHTML.cpp
@@ -926,17 +926,17 @@ nsIndexedToHTML::OnIndexAvailable(nsIReq
     pushBuffer.AppendLiteral("</a></td>\n <td");
 
     if (type == nsIDirIndex::TYPE_DIRECTORY || type == nsIDirIndex::TYPE_SYMLINK) {
         pushBuffer.AppendLiteral(">");
     } else {
         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("\">");
             nsAutoString  sizeString;
             FormatSizeString(size, sizeString);
             pushBuffer.Append(sizeString);
         } else {
             pushBuffer.AppendLiteral(">");
--- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp
+++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp
@@ -35,17 +35,17 @@ LengthToToken(const char *cursor, const 
     return len;
 }
 
 nsPartChannel::nsPartChannel(nsIChannel *aMultipartChannel, uint32_t aPartID,
                              nsIStreamListener* aListener) :
   mMultipartChannel(aMultipartChannel),
   mListener(aListener),
   mStatus(NS_OK),
-  mContentLength(LL_MAXUINT),
+  mContentLength(UINT64_MAX),
   mIsByteRangeRequest(false),
   mByteRangeStart(0),
   mByteRangeEnd(0),
   mPartID(aPartID),
   mIsLastPart(false)
 {
     mMultipartChannel = aMultipartChannel;
 
@@ -587,17 +587,17 @@ nsMultiMixedConv::OnDataAvailable(nsIReq
                 mProcessingHeaders = true;
                 break;
             }
         }
         else {
             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;
             mByteRangeEnd = 0;
             
             rv = SendStop(NS_OK);
             if (NS_FAILED(rv)) return rv;
             // reset the token to front. this allows us to treat
@@ -733,17 +733,17 @@ nsMultiMixedConv::OnStopRequest(nsIReque
 
 
 // nsMultiMixedConv methods
 nsMultiMixedConv::nsMultiMixedConv() :
   mCurrentPartID(0)
 {
     mTokenLen           = 0;
     mNewPart            = true;
-    mContentLength      = LL_MAXUINT;
+    mContentLength      = UINT64_MAX;
     mBuffer             = nullptr;
     mBufLen             = 0;
     mProcessingHeaders  = false;
     mByteRangeStart     = 0;
     mByteRangeEnd       = 0;
     mTotalSent          = 0;
     mIsByteRangeRequest = false;
 }
@@ -860,17 +860,17 @@ nsMultiMixedConv::SendStop(nsresult aSta
 
 nsresult
 nsMultiMixedConv::SendData(char *aBuffer, uint32_t aLen) {
 
     nsresult rv = NS_OK;
     
     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)
             aLen = mContentLength - mTotalSent;
 
         if (aLen == 0)
             return NS_OK;
     }
@@ -912,17 +912,17 @@ nsMultiMixedConv::ParseHeaders(nsIChanne
     // NOTE: this data must be ascii.
     // NOTE: aPtr is NOT null terminated!
     nsresult rv = NS_OK;
     char *cursor = aPtr, *newLine = nullptr;
     uint32_t cursorLen = aLen;
     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
             lineFeedIncrement = 2;
             newLine--;
         }
         else
             lineFeedIncrement = 1; // reset
@@ -989,17 +989,17 @@ nsMultiMixedConv::ParseHeaders(nsIChanne
                     tmpPtr[0] = '\0';
                     
                     mByteRangeStart = nsCRT::atoll(range);
                     tmpPtr++;
                     mByteRangeEnd = nsCRT::atoll(tmpPtr);
                 }
 
                 mIsByteRangeRequest = true;
-                if (mContentLength == LL_MAXUINT)
+                if (mContentLength == UINT64_MAX)
                     mContentLength = uint64_t(mByteRangeEnd - mByteRangeStart + 1);
             }
         }
         *newLine = tmpChar;
         newLine += lineFeedIncrement;
         cursorLen -= (newLine - cursor);
         cursor = newLine;
     }
--- a/netwerk/test/TestCookie.cpp
+++ b/netwerk/test/TestCookie.cpp
@@ -616,33 +616,33 @@ main(int32_t argc, char *argv[])
       // add some cookies
       rv[1] = NS_SUCCEEDED(cookieMgr2->Add(NS_LITERAL_CSTRING("cookiemgr.test"), // domain
                                            NS_LITERAL_CSTRING("/foo"),           // path
                                            NS_LITERAL_CSTRING("test1"),          // name
                                            NS_LITERAL_CSTRING("yes"),            // value
                                            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
                                            NS_LITERAL_CSTRING("yes"),            // value
                                            false,                             // is secure
                                            true,                              // is httponly
                                            true,                              // is session
                                            PR_Now() / PR_USEC_PER_SEC + 2));     // expiry time
       rv[3] = NS_SUCCEEDED(cookieMgr2->Add(NS_LITERAL_CSTRING("new.domain"),     // domain
                                            NS_LITERAL_CSTRING("/rabbit"),        // path
                                            NS_LITERAL_CSTRING("test3"),          // name
                                            NS_LITERAL_CSTRING("yes"),            // value
                                            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)));
       int32_t i = 0;
       bool more;
       nsCOMPtr<nsICookie2> expiredCookie, newDomainCookie;
       while (NS_SUCCEEDED(enumerator->HasMoreElements(&more)) && more) {
         nsCOMPtr<nsISupports> cookie;
@@ -680,17 +680,17 @@ main(int32_t argc, char *argv[])
       rv[11] = NS_SUCCEEDED(cookieMgr2->CookieExists(newDomainCookie, &found)) && !found;
       rv[12] = NS_SUCCEEDED(cookieMgr2->Add(NS_LITERAL_CSTRING("new.domain"),     // domain
                                             NS_LITERAL_CSTRING("/rabbit"),        // path
                                             NS_LITERAL_CSTRING("test3"),          // name
                                             NS_LITERAL_CSTRING("yes"),            // value
                                             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());
       // check that both CountCookiesFromHost() and CookieExists() count the
       // expired cookie
       rv[14] = NS_SUCCEEDED(cookieMgr2->CountCookiesFromHost(NS_LITERAL_CSTRING("cookiemgr.test"), &hostCookies)) &&
               hostCookies == 2;
       rv[15] = NS_SUCCEEDED(cookieMgr2->CookieExists(expiredCookie, &found)) && found;
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -1069,17 +1069,17 @@ NS_IMETHODIMP nsDocLoader::OnProgress(ns
       }
 
       //
       // This is the first progress notification for the entry.  If
       // (aMaxProgress > 0) then the content-length of the data is known,
       // 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 {
         mMaxSelfProgress   =  int64_t(-1);
         info->mMaxProgress =  int64_t(-1);
       }
 
       // Send a STATE_TRANSFERRING notification for the request.
--- a/xpcom/ds/TimeStamp.h
+++ b/xpcom/ds/TimeStamp.h
@@ -123,17 +123,17 @@ private:
   static TimeDuration FromTicks(int64_t aTicks) {
     TimeDuration t;
     t.mValue = aTicks;
     return t;
   }
 
   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);
 
     // This MUST be a <= test.
     if (aTicks <= double(INT64_MIN))
       return TimeDuration::FromTicks(INT64_MIN);
 
     return TimeDuration::FromTicks(int64_t(aTicks));
@@ -193,26 +193,26 @@ public:
    */
   static TimeStamp Now();
   /**
    * Compute the difference between two timestamps. Both must be non-null.
    */
   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);
   }
 
   TimeStamp operator+(const TimeDuration& aOther) const {
     MOZ_ASSERT(!IsNull(), "Cannot compute with a null value");
     return TimeStamp(mValue + aOther.mValue);
--- a/xpfe/components/directory/nsDirectoryViewer.cpp
+++ b/xpfe/components/directory/nsDirectoryViewer.cpp
@@ -429,17 +429,17 @@ nsHTTPIndex::OnIndexAvailable(nsIRequest
       if (NS_FAILED(rv)) return rv;
       rv = Assert(entry, kNC_Description, lit, true);
       if (NS_FAILED(rv)) return rv;
       
       // contentlength
       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);
         // XXX RDF should support 64 bit integers (bug 240160)
         nsCOMPtr<nsIRDFInt> val;
         rv = mDirRDF->GetIntLiteral(intSize, getter_AddRefs(val));
         if (NS_FAILED(rv)) return rv;
         rv = Assert(entry, kNC_ContentLength, val, true);