Bug 792581 - part 1: Replace LL_IS_ZERO macro with standard relation. r=ehsan
authorAndrew Quartey <andrew.quartey@gmail.com>
Wed, 03 Oct 2012 10:13:18 -0400
changeset 109066 f729670158d6c760b9f75eeff2d96523bb6f4c39
parent 109065 c63d0cd4603d6455f282a2578d72a8749f737710
child 109067 7aa4ea0c1d304fefdc6f0c68420ed77d11b66aa6
push id23609
push userryanvm@gmail.com
push dateThu, 04 Oct 2012 01:43:15 +0000
treeherdermozilla-central@ae646840907e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs792581
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 792581 - part 1: Replace LL_IS_ZERO macro with standard relation. r=ehsan
content/base/src/nsDocument.cpp
content/xul/templates/src/nsXULTemplateQueryProcessorRDF.cpp
docshell/shistory/src/nsSHistory.cpp
dom/plugins/base/nsPluginHost.cpp
gfx/thebes/gfxUserFontSet.cpp
security/manager/ssl/src/nsCRLManager.cpp
xpcom/glue/nsTextFormatter.cpp
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -6876,17 +6876,17 @@ nsDocument::RetrieveRelevantHeaders(nsIC
       rv = aChannel->GetContentDispositionHeader(contentDisp);
       if (NS_SUCCEEDED(rv)) {
         SetHeaderData(nsGkAtoms::headerContentDisposition,
                       NS_ConvertASCIItoUTF16(contentDisp));
       }
     }
   }
 
-  if (LL_IS_ZERO(modDate)) {
+  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 (LL_NE(modDate, LL_ZERO)) {
--- a/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.cpp
+++ b/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.cpp
@@ -689,17 +689,17 @@ nsXULTemplateQueryProcessorRDF::CompareR
             if (r) {
                 PRTime ldate, rdate;
                 l->GetValue(&ldate);
                 r->GetValue(&rdate);
 
                 int64_t delta;
                 LL_SUB(delta, ldate, rdate);
 
-                if (LL_IS_ZERO(delta))
+                if (delta == 0)
                     *aResult = 0;
                 else if (LL_GE_ZERO(delta))
                     *aResult = 1;
                 else
                     *aResult = -1;
             }
 
             return NS_OK;
--- a/docshell/shistory/src/nsSHistory.cpp
+++ b/docshell/shistory/src/nsSHistory.cpp
@@ -279,17 +279,17 @@ nsSHistory::CalcMaxTotalViewers()
   // 128  Mb       2
   // 256  Mb       3
   // 512  Mb       5
   // 1024 Mb       8
   // 2048 Mb       8
   // 4096 Mb       8
   uint64_t bytes = PR_GetPhysicalMemorySize();
 
-  if (LL_IS_ZERO(bytes))
+  if (bytes == 0)
     return 0;
 
   // Conversion from unsigned int64 to double doesn't work on all platforms.
   // We need to truncate the value at INT64_MAX to make sure we don't
   // overflow.
   if (LL_CMP(bytes, >, INT64_MAX))
     bytes = INT64_MAX;
 
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -3687,17 +3687,17 @@ nsPluginHost::CreateTempFileToPost(const
     if (NS_FAILED(rv)) return rv;
     inFile = localFile;
   }
   rv = inFile->GetFileSize(&fileSize);
   if (NS_FAILED(rv)) return rv;
   rv = inFile->GetNativePath(filename);
   if (NS_FAILED(rv)) return rv;
 
-  if (!LL_IS_ZERO(fileSize)) {
+  if (fileSize != 0) {
     nsCOMPtr<nsIInputStream> inStream;
     rv = NS_NewLocalFileInputStream(getter_AddRefs(inStream), inFile);
     if (NS_FAILED(rv)) return rv;
 
     // Create a temporary file to write the http Content-length:
     // %ld\r\n\" header and "\r\n" == end of headers for post data to
 
     nsCOMPtr<nsIFile> tempFile;
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -618,17 +618,17 @@ gfxUserFontSet::LoadNext(gfxProxyFontEnt
     return STATUS_END_OF_LIST;
 }
 
 void
 gfxUserFontSet::IncrementGeneration()
 {
     // add one, increment again if zero
     LL_ADD(sFontSetGeneration, sFontSetGeneration, 1);
-    if (LL_IS_ZERO(sFontSetGeneration))
+    if (sFontSetGeneration == 0)
         LL_ADD(sFontSetGeneration, sFontSetGeneration, 1);
     mGeneration = sFontSetGeneration;
 }
 
 
 gfxFontEntry*
 gfxUserFontSet::LoadFont(gfxProxyFontEntry *aProxy,
                          const uint8_t *aFontData, uint32_t &aLength)
--- a/security/manager/ssl/src/nsCRLManager.cpp
+++ b/security/manager/ssl/src/nsCRLManager.cpp
@@ -413,17 +413,17 @@ nsCRLManager::ComputeNextAutoUpdateTime(
   if (NS_FAILED(rv))
     return rv;
 
   switch (autoUpdateType) {
   case TYPE_AUTOUPDATE_FREQ_BASED:
     LL_SUB(diff, now, lastUpdate);             //diff is the no of micro sec between now and last update
     LL_DIV(cycleCnt, diff, microsecInDayCnt);   //temp is the number of full cycles from lst update
     LL_MOD(temp, diff, microsecInDayCnt);
-    if(!(LL_IS_ZERO(temp))) {
+    if(temp != 0) {
       LL_ADD(cycleCnt,cycleCnt,1);            //no of complete cycles till next autoupdate instant
     }
     LL_MUL(temp,cycleCnt,microsecInDayCnt);    //micro secs from last update
     LL_ADD(tempTime, lastUpdate, temp);
     break;  
   case TYPE_AUTOUPDATE_TIME_BASED:
     LL_SUB(tempTime, nextUpdate, microsecInDayCnt);
     break;
--- a/xpcom/glue/nsTextFormatter.cpp
+++ b/xpcom/glue/nsTextFormatter.cpp
@@ -273,29 +273,29 @@ static int cvt_ll(SprintfState *ss, int6
                   int radix, int type, int flags, const PRUnichar *hexp)
 {
     PRUnichar cvtbuf[100];
     PRUnichar *cvt;
     int digits;
     int64_t rad;
 
     /* according to the man page this needs to happen */
-    if ((prec == 0) && (LL_IS_ZERO(num))) {
+    if (prec == 0 && num == 0) {
 	return 0;
     }
 
     /*
     ** Converting decimal is a little tricky. In the unsigned case we
     ** need to stop when we hit 10 digits. In the signed case, we can
     ** stop when the number is zero.
     */
     LL_I2L(rad, radix);
     cvt = &cvtbuf[0] + ELEMENTS_OF(cvtbuf);
     digits = 0;
-    while (!LL_IS_ZERO(num)) {
+    while (num != 0) {
 	int32_t digit;
 	int64_t quot, rem;
 	LL_UDIVMOD(&quot, &rem, num, rad);
 	LL_L2I(digit, rem);
 	*--cvt = hexp[digit & 0xf];
 	digits++;
 	num = quot;
     }