Bug 792581 - part 22: Replace LL_ZERO and LL_Zero() macros with 0. r=ehsan
authorAndrew Quartey <andrew.quartey@gmail.com>
Thu, 25 Oct 2012 19:25:59 -0400
changeset 111465 b3a9ae0f6abfb48bbcbc7a51fb34c08dbd65df24
parent 111464 9aa2637e2b6b1a86f08fb14b99eb05aadb3d42c5
child 111466 f5e702c39521bb6fb440664593d7dbcbd5bf3da8
push id23748
push userryanvm@gmail.com
push dateFri, 26 Oct 2012 11:29:12 +0000
treeherdermozilla-central@8586bd350875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs792581
milestone19.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 792581 - part 22: Replace LL_ZERO and LL_Zero() macros with 0. r=ehsan
content/base/src/nsDocument.cpp
dom/plugins/base/nsPluginHost.cpp
embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
layout/generic/nsBlockFrame.cpp
netwerk/base/src/nsMIMEInputStream.cpp
netwerk/protocol/http/SpdyStream2.cpp
netwerk/protocol/http/SpdyStream3.cpp
netwerk/protocol/http/nsHttpConnection.cpp
netwerk/protocol/http/nsHttpResponseHead.cpp
netwerk/protocol/http/nsHttpTransaction.cpp
uriloader/base/nsDocLoader.cpp
widget/windows/WinUtils.cpp
xpcom/ds/nsCRT.cpp
xpcom/ds/nsSupportsPrimitives.cpp
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -6383,17 +6383,17 @@ nsDocument::SetValueMissingState(const n
   nsRadioGroupStruct* radioGroup = GetOrCreateRadioGroup(aName);
   radioGroup->mGroupSuffersFromValueMissing = aValue;
 }
 
 void
 nsDocument::RetrieveRelevantHeaders(nsIChannel *aChannel)
 {
   nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
-  PRTime modDate = LL_ZERO;
+  PRTime modDate = 0;
   nsresult rv;
 
   if (httpChannel) {
     nsAutoCString tmp;
     rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("last-modified"),
                                         tmp);
 
     if (NS_SUCCEEDED(rv)) {
@@ -6462,17 +6462,17 @@ nsDocument::RetrieveRelevantHeaders(nsIC
   if (modDate == 0) {
     // We got nothing from our attempt to ask nsIFileChannel and
     // nsIHttpChannel for the last modified time. Return the current
     // time.
     modDate = PR_Now();
   }
 
   mLastModified.Truncate();
-  if (modDate != LL_ZERO) {
+  if (modDate != 0) {
     PRExplodedTime prtime;
     PR_ExplodeTime(modDate, PR_LocalTimeParameters, &prtime);
     // "MM/DD/YYYY hh:mm:ss"
     char formatedTime[24];
     if (PR_snprintf(formatedTime, sizeof(formatedTime),
                     "%02ld/%02ld/%04hd %02ld:%02ld:%02ld",
                     prtime.tm_month + 1, prtime.tm_mday, prtime.tm_year,
                     prtime.tm_hour     ,  prtime.tm_min,  prtime.tm_sec)) {
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -1949,17 +1949,17 @@ nsPluginHost::FirstPluginWithPath(const 
   }
   return nullptr;
 }
 
 namespace {
 
 int64_t GetPluginLastModifiedTime(const nsCOMPtr<nsIFile>& localfile)
 {
-  PRTime fileModTime = LL_ZERO;
+  PRTime fileModTime = 0;
 
 #if defined(XP_MACOSX)
   // On OS X the date of a bundle's "contents" (i.e. of its Info.plist file)
   // is a much better guide to when it was last modified than the date of
   // its package directory.  See bug 313700.
   nsCOMPtr<nsILocalFileMac> localFileMac = do_QueryInterface(localfile);
   if (localFileMac) {
     localFileMac->GetBundleContentsLastModifiedTime(&fileModTime);
--- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
+++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
@@ -2451,17 +2451,17 @@ nsWebBrowserPersist::CalcTotalProgress()
 
     if (mUploadList.Count() > 0)
     {
         // Total up the progress of each upload
         mUploadList.Enumerate(EnumCalcUploadProgress, this);
     }
 
     // XXX this code seems pretty bogus and pointless
-    if (mTotalCurrentProgress == LL_ZERO && mTotalMaxProgress == LL_ZERO)
+    if (mTotalCurrentProgress == 0 && mTotalMaxProgress == 0)
     {
         // No output streams so we must be complete
         mTotalCurrentProgress = 10000;
         mTotalMaxProgress = 10000;
     }
 }
 
 bool
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -927,17 +927,17 @@ nsBlockFrame::Reflow(nsPresContext*     
   if (gNoisyReflow) {
     IndentBy(stdout, gNoiseIndent);
     ListTag(stdout);
     printf(": begin reflow availSize=%d,%d computedSize=%d,%d\n",
            aReflowState.availableWidth, aReflowState.availableHeight,
            aReflowState.ComputedWidth(), aReflowState.ComputedHeight());
   }
   AutoNoisyIndenter indent(gNoisy);
-  PRTime start = LL_ZERO; // Initialize these variablies to silence the compiler.
+  PRTime start = 0; // Initialize these variablies to silence the compiler.
   int32_t ctc = 0;        // We only use these if they are set (gLameReflowMetrics).
   if (gLameReflowMetrics) {
     start = PR_Now();
     ctc = nsLineBox::GetCtorCount();
   }
 #endif
 
   const nsHTMLReflowState *reflowState = &aReflowState;
@@ -6093,17 +6093,17 @@ nsBlockFrame::BuildDisplayList(nsDisplay
       ::ComputeVisualOverflowArea(mLines, mRect.width, mRect.height, ca);
       nsFrame::IndentBy(stdout, depth);
       ListTag(stdout);
       printf(": bounds=%d,%d,%d,%d dirty(absolute)=%d,%d,%d,%d ca=%d,%d,%d,%d\n",
              mRect.x, mRect.y, mRect.width, mRect.height,
              aDirtyRect.x, aDirtyRect.y, aDirtyRect.width, aDirtyRect.height,
              ca.x, ca.y, ca.width, ca.height);
   }
-  PRTime start = LL_ZERO; // Initialize these variables to silence the compiler.
+  PRTime start = 0; // Initialize these variables to silence the compiler.
   if (gLamePaintMetrics) {
     start = PR_Now();
     drawnLines = 0;
   }
 #endif
 
   DisplayBorderBackgroundOutline(aBuilder, aLists);
 
--- a/netwerk/base/src/nsMIMEInputStream.cpp
+++ b/netwerk/base/src/nsMIMEInputStream.cpp
@@ -194,17 +194,17 @@ if (!mStartedReading) {     \
 }
 
 // Reset mStartedReading when Seek-ing to start
 NS_IMETHODIMP
 nsMIMEInputStream::Seek(int32_t whence, int64_t offset)
 {
     nsresult rv;
     nsCOMPtr<nsISeekableStream> stream = do_QueryInterface(mStream);
-    if (whence == NS_SEEK_SET && offset == LL_Zero()) {
+    if (whence == NS_SEEK_SET && offset == 0) {
         rv = stream->Seek(whence, offset);
         if (NS_SUCCEEDED(rv))
             mStartedReading = false;
     }
     else {
         INITSTREAMS;
         rv = stream->Seek(whence, offset);
     }
--- a/netwerk/protocol/http/SpdyStream2.cpp
+++ b/netwerk/protocol/http/SpdyStream2.cpp
@@ -492,17 +492,17 @@ SpdyStream2::UpdateTransportSendEvents(u
     mTransaction->OnTransportStatus(mSocketTransport,
                                     NS_NET_STATUS_SENDING_TO,
                                     mTotalSent);
 
   if (!mSentWaitingFor && !mRequestBodyLenRemaining) {
     mSentWaitingFor = 1;
     mTransaction->OnTransportStatus(mSocketTransport,
                                     NS_NET_STATUS_WAITING_FOR,
-                                    LL_ZERO);
+                                    0);
   }
 }
 
 nsresult
 SpdyStream2::TransmitFrame(const char *buf,
                           uint32_t *countUsed)
 {
   // If TransmitFrame returns SUCCESS than all the data is sent (or at least
--- a/netwerk/protocol/http/SpdyStream3.cpp
+++ b/netwerk/protocol/http/SpdyStream3.cpp
@@ -512,17 +512,17 @@ SpdyStream3::UpdateTransportSendEvents(u
     mTransaction->OnTransportStatus(mSocketTransport,
                                     NS_NET_STATUS_SENDING_TO,
                                     mTotalSent);
 
   if (!mSentWaitingFor && !mRequestBodyLenRemaining) {
     mSentWaitingFor = 1;
     mTransaction->OnTransportStatus(mSocketTransport,
                                     NS_NET_STATUS_WAITING_FOR,
-                                    LL_ZERO);
+                                    0);
   }
 }
 
 nsresult
 SpdyStream3::TransmitFrame(const char *buf,
                           uint32_t *countUsed)
 {
   // If TransmitFrame returns SUCCESS than all the data is sent (or at least
--- a/netwerk/protocol/http/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/nsHttpConnection.cpp
@@ -1266,17 +1266,17 @@ nsHttpConnection::OnSocketWritable()
             // 
             // at this point we've written out the entire transaction, and now we
             // must wait for the server's response.  we manufacture a status message
             // here to reflect the fact that we are waiting.  this message will be
             // trumped (overwritten) if the server responds quickly.
             //
             mTransaction->OnTransportStatus(mSocketTransport,
                                             NS_NET_STATUS_WAITING_FOR,
-                                            LL_ZERO);
+                                            0);
 
             rv = ResumeRecv(); // start reading
             again = false;
         }
         // write more to the socket until error or end-of-request...
     } while (again);
 
     return rv;
--- a/netwerk/protocol/http/nsHttpResponseHead.cpp
+++ b/netwerk/protocol/http/nsHttpResponseHead.cpp
@@ -530,17 +530,17 @@ nsHttpResponseHead::GetExpiresValue(uint
     PRStatus st = PR_ParseTimeString(val, true, &time);
     if (st != PR_SUCCESS) {
         // parsing failed... RFC 2616 section 14.21 says we should treat this
         // as an expiration time in the past.
         *result = 0;
         return NS_OK;
     }
 
-    if (time < LL_Zero())
+    if (time < 0)
         *result = 0;
     else
         *result = PRTimeToSeconds(time); 
     return NS_OK;
 }
 
 int64_t
 nsHttpResponseHead::TotalEntitySize() const
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -256,17 +256,17 @@ nsHttpTransaction::Init(uint8_t caps,
         mReqHeaderBuf.AppendLiteral("\r\n");
 
     // report the request header
     if (mActivityDistributor)
         mActivityDistributor->ObserveActivity(
             mChannel,
             NS_HTTP_ACTIVITY_TYPE_HTTP_TRANSACTION,
             NS_HTTP_ACTIVITY_SUBTYPE_REQUEST_HEADER,
-            PR_Now(), LL_ZERO,
+            PR_Now(), 0,
             mReqHeaderBuf);
 
     // Create a string stream for the request header buf (the stream holds
     // a non-owning reference to the request header data, so we MUST keep
     // mReqHeaderBuf around).
     nsCOMPtr<nsIInputStream> headers;
     rv = NS_NewByteInputStream(getter_AddRefs(headers),
                                mReqHeaderBuf.get(),
@@ -425,17 +425,17 @@ nsHttpTransaction::OnTransportStatus(nsI
     if (mActivityDistributor) {
         // upon STATUS_WAITING_FOR; report request body sent
         if ((mHasRequestBody) &&
             (status == NS_NET_STATUS_WAITING_FOR))
             mActivityDistributor->ObserveActivity(
                 mChannel,
                 NS_HTTP_ACTIVITY_TYPE_HTTP_TRANSACTION,
                 NS_HTTP_ACTIVITY_SUBTYPE_REQUEST_BODY_SENT,
-                PR_Now(), LL_ZERO, EmptyCString());
+                PR_Now(), 0, EmptyCString());
 
         // report the status and progress
         if (!mRestartInProgressVerifier.IsDiscardingContent())
             mActivityDistributor->ObserveActivity(
                 mChannel,
                 NS_HTTP_ACTIVITY_TYPE_SOCKET_TRANSPORT,
                 static_cast<uint32_t>(status),
                 PR_Now(),
@@ -461,17 +461,17 @@ nsHttpTransaction::OnTransportStatus(nsI
         seekable->Tell(&prog);
         progress = prog;
 
         // when uploading, we include the request headers in the progress
         // notifications.
         progressMax = mRequestSize; // XXX mRequestSize is 32-bit!
     }
     else {
-        progress = LL_ZERO;
+        progress = 0;
         progressMax = 0;
     }
 
     mTransportSink->OnTransportStatus(transport, status, progress, progressMax);
 }
 
 bool
 nsHttpTransaction::IsDone()
@@ -656,17 +656,17 @@ nsHttpTransaction::Close(nsresult reason
                 static_cast<uint64_t>(mContentRead),
                 EmptyCString());
 
         // report that this transaction is closing
         mActivityDistributor->ObserveActivity(
             mChannel,
             NS_HTTP_ACTIVITY_TYPE_HTTP_TRANSACTION,
             NS_HTTP_ACTIVITY_SUBTYPE_TRANSACTION_CLOSE,
-            PR_Now(), LL_ZERO, EmptyCString());
+            PR_Now(), 0, EmptyCString());
     }
 
     // we must no longer reference the connection!  find out if the 
     // connection was being reused before letting it go.
     bool connReused = false;
     if (mConnection)
         connReused = mConnection->IsReused();
     mConnected = false;
@@ -1060,17 +1060,17 @@ nsHttpTransaction::ParseHead(char *buf,
 
         // report that we have a least some of the response
         if (mActivityDistributor && !mReportedStart) {
             mReportedStart = true;
             mActivityDistributor->ObserveActivity(
                 mChannel,
                 NS_HTTP_ACTIVITY_TYPE_HTTP_TRANSACTION,
                 NS_HTTP_ACTIVITY_SUBTYPE_RESPONSE_START,
-                PR_Now(), LL_ZERO, EmptyCString());
+                PR_Now(), 0, EmptyCString());
         }
     }
 
     if (!mHttpResponseMatched) {
         // Normally we insist on seeing HTTP/1.x in the first few bytes,
         // but if we are on a persistent connection and the previous transaction
         // was not supposed to have any content then we need to be prepared
         // to skip over a response body that the server may have sent even
@@ -1423,17 +1423,17 @@ nsHttpTransaction::ProcessData(char *buf
             mReportedResponseHeader = true;
             nsAutoCString completeResponseHeaders;
             mResponseHead->Flatten(completeResponseHeaders, false);
             completeResponseHeaders.AppendLiteral("\r\n");
             mActivityDistributor->ObserveActivity(
                 mChannel,
                 NS_HTTP_ACTIVITY_TYPE_HTTP_TRANSACTION,
                 NS_HTTP_ACTIVITY_SUBTYPE_RESPONSE_HEADER,
-                PR_Now(), LL_ZERO,
+                PR_Now(), 0,
                 completeResponseHeaders);
         }
     }
 
     // even though count may be 0, we still want to call HandleContent
     // so it can complete the transaction if this is a "no-content" response.
     if (mHaveAllHeaders) {
         uint32_t countRemaining = 0;
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -621,17 +621,17 @@ nsDocLoader::OnStopRequest(nsIRequest *a
     //
     // Determine whether a STATE_TRANSFERRING notification should be
     // 'synthesized'.
     //
     // If nsRequestInfo::mMaxProgress (as stored in oldMax) and
     // nsRequestInfo::mCurrentProgress are both 0, then the
     // STATE_TRANSFERRING notification has not been fired yet...
     //
-    if ((oldMax == LL_ZERO) && (info->mCurrentProgress == LL_ZERO)) {
+    if ((oldMax == 0) && (info->mCurrentProgress == 0)) {
       nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
 
       // Only fire a TRANSFERRING notification if the request is also a
       // channel -- data transfer requires a nsIChannel!
       //
       if (channel) {
         if (NS_SUCCEEDED(aStatus)) {
           bFireTransferring = true;
@@ -1145,22 +1145,22 @@ NS_IMETHODIMP nsDocLoader::OnStatus(nsIR
     if (info) {
       bool uploading = (aStatus == NS_NET_STATUS_WRITING ||
                         aStatus == NS_NET_STATUS_SENDING_TO);
       // If switching from uploading to downloading (or vice versa), then we
       // need to reset our progress counts.  This is designed with HTTP form
       // submission in mind, where an upload is performed followed by download
       // of possibly several documents.
       if (info->mUploading != uploading) {
-        mCurrentSelfProgress  = mMaxSelfProgress  = LL_ZERO;
-        mCurrentTotalProgress = mMaxTotalProgress = LL_ZERO;
-        mCompletedTotalProgress = LL_ZERO;
+        mCurrentSelfProgress  = mMaxSelfProgress  = 0;
+        mCurrentTotalProgress = mMaxTotalProgress = 0;
+        mCompletedTotalProgress = 0;
         info->mUploading = uploading;
-        info->mCurrentProgress = LL_ZERO;
-        info->mMaxProgress = LL_ZERO;
+        info->mCurrentProgress = 0;
+        info->mMaxProgress = 0;
       }
     }
 
     nsCOMPtr<nsIStringBundleService> sbs =
       mozilla::services::GetStringBundleService();
     if (!sbs)
       return NS_ERROR_FAILURE;
     nsXPIDLString msg;
@@ -1190,19 +1190,19 @@ NS_IMETHODIMP nsDocLoader::OnStatus(nsIR
   }
   return NS_OK;
 }
 
 void nsDocLoader::ClearInternalProgress()
 {
   ClearRequestInfoHash();
 
-  mCurrentSelfProgress  = mMaxSelfProgress  = LL_ZERO;
-  mCurrentTotalProgress = mMaxTotalProgress = LL_ZERO;
-  mCompletedTotalProgress = LL_ZERO;
+  mCurrentSelfProgress  = mMaxSelfProgress  = 0;
+  mCurrentTotalProgress = mMaxTotalProgress = 0;
+  mCompletedTotalProgress = 0;
 
   mProgressStateFlags = nsIWebProgressListener::STATE_STOP;
 }
 
 
 void nsDocLoader::FireOnProgressChange(nsDocLoader *aLoadInitiator,
                                        nsIRequest *request,
                                        int64_t aProgress,
--- a/widget/windows/WinUtils.cpp
+++ b/widget/windows/WinUtils.cpp
@@ -734,17 +734,17 @@ nsresult FaviconHelper::ObtainCachedIcon
   // Check if the cached ICO file already exists
   bool exists;
   rv = icoFile->Exists(&exists);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (exists) {
 
     // Obtain the file's last modification date in seconds
-    int64_t fileModTime = LL_ZERO;
+    int64_t fileModTime = 0;
     rv = icoFile->GetLastModifiedTime(&fileModTime);
     fileModTime /= PR_MSEC_PER_SEC;
     int32_t icoReCacheSecondsTimeout = GetICOCacheSecondsTimeout();
     int64_t nowTime = PR_Now() / int64_t(PR_USEC_PER_SEC);
 
     // If the last mod call failed or the icon is old then re-cache it
     // This check is in case the favicon of a page changes
     // the next time we try to build the jump list, the data will be available.
--- a/xpcom/ds/nsCRT.cpp
+++ b/xpcom/ds/nsCRT.cpp
@@ -167,19 +167,19 @@ PRUnichar* nsCRT::strndup(const PRUnicha
   return rslt;
 }
 
 // This should use NSPR but NSPR isn't exporting its PR_strtoll function
 // Until then...
 int64_t nsCRT::atoll(const char *str)
 {
     if (!str)
-        return LL_Zero();
+        return 0;
 
-    int64_t ll = LL_Zero();
+    int64_t ll = 0;
 
     while (*str && *str >= '0' && *str <= '9') {
         ll *= 10;
         ll += *str - '0';
         str++;
     }
 
     return ll;
--- a/xpcom/ds/nsSupportsPrimitives.cpp
+++ b/xpcom/ds/nsSupportsPrimitives.cpp
@@ -321,17 +321,17 @@ NS_IMETHODIMP nsSupportsPRUint32Impl::To
 }  
 
 /***************************************************************************/
 
 NS_IMPL_ISUPPORTS2(nsSupportsPRUint64Impl, nsISupportsPRUint64,
                    nsISupportsPrimitive)
 
 nsSupportsPRUint64Impl::nsSupportsPRUint64Impl()
-    : mData(LL_ZERO)
+    : mData(0)
 {
 }
 
 NS_IMETHODIMP nsSupportsPRUint64Impl::GetType(uint16_t *aType)
 {
     NS_ASSERTION(aType, "Bad pointer");
     *aType = TYPE_PRUINT64;
 
@@ -366,17 +366,17 @@ NS_IMETHODIMP nsSupportsPRUint64Impl::To
 }  
 
 /***************************************************************************/
 
 NS_IMPL_ISUPPORTS2(nsSupportsPRTimeImpl, nsISupportsPRTime,
                    nsISupportsPrimitive)
 
 nsSupportsPRTimeImpl::nsSupportsPRTimeImpl()
-    : mData(LL_ZERO)
+    : mData(0)
 {
 }
 
 NS_IMETHODIMP nsSupportsPRTimeImpl::GetType(uint16_t *aType)
 {
     NS_ASSERTION(aType, "Bad pointer");
     *aType = TYPE_PRTIME;
 
@@ -546,17 +546,17 @@ NS_IMETHODIMP nsSupportsPRInt32Impl::ToS
 }  
 
 /***************************************************************************/
 
 NS_IMPL_ISUPPORTS2(nsSupportsPRInt64Impl, nsISupportsPRInt64,
                    nsISupportsPrimitive)
 
 nsSupportsPRInt64Impl::nsSupportsPRInt64Impl()
-    : mData(LL_ZERO)
+    : mData(0)
 {
 }
 
 NS_IMETHODIMP nsSupportsPRInt64Impl::GetType(uint16_t *aType)
 {
     NS_ASSERTION(aType, "Bad pointer");
     *aType = TYPE_PRINT64;