Bug 792581 - part 9: Replace LL_ADD with mathematical plus operator. r=ehsan
authorAndrew Quartey <andrew.quartey@gmail.com>
Fri, 05 Oct 2012 01:05:27 -0400
changeset 109325 b7b805f35a69d4ec602a3cc577f656ff2769df0b
parent 109324 721cf3acc2694a7263a5fbf568de8597ab028771
child 109326 4c3f56cede8326179c22d22e7f4e5d11d3b80889
push id15971
push userandrew.quartey@gmail.com
push dateFri, 05 Oct 2012 05:05:49 +0000
treeherdermozilla-inbound@01ada5d631e7 [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 9: Replace LL_ADD with mathematical plus operator. r=ehsan
gfx/thebes/gfxUserFontSet.cpp
rdf/base/src/rdfutil.cpp
security/manager/ssl/src/nsCRLManager.cpp
tools/trace-malloc/spacetrace.c
tools/trace-malloc/tmstats.c
xpcom/ds/nsCRT.cpp
xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -617,19 +617,19 @@ gfxUserFontSet::LoadNext(gfxProxyFontEnt
 
     return STATUS_END_OF_LIST;
 }
 
 void
 gfxUserFontSet::IncrementGeneration()
 {
     // add one, increment again if zero
-    LL_ADD(sFontSetGeneration, sFontSetGeneration, 1);
+    ++sFontSetGeneration;
     if (sFontSetGeneration == 0)
-        LL_ADD(sFontSetGeneration, sFontSetGeneration, 1);
+       ++sFontSetGeneration;
     mGeneration = sFontSetGeneration;
 }
 
 
 gfxFontEntry*
 gfxUserFontSet::LoadFont(gfxProxyFontEntry *aProxy,
                          const uint8_t *aFontData, uint32_t &aLength)
 {
--- a/rdf/base/src/rdfutil.cpp
+++ b/rdf/base/src/rdfutil.cpp
@@ -102,13 +102,13 @@ rdf_ParseDate(const nsACString &aTime)
         // that looks close enough. Parse it, and add it to the time.
         while (++digit != end) {
             usec *= 10;
             usec += *digit - '0';
         }
 
         PRTime temp;
         LL_I2L(temp, usec);
-        LL_ADD(t, t, temp);
+        t += temp;
     }
 
     return t;
 }
--- a/security/manager/ssl/src/nsCRLManager.cpp
+++ b/security/manager/ssl/src/nsCRLManager.cpp
@@ -414,20 +414,20 @@ nsCRLManager::ComputeNextAutoUpdateTime(
     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(temp != 0) {
-      LL_ADD(cycleCnt,cycleCnt,1);            //no of complete cycles till next autoupdate instant
+      ++cycleCnt;            //no of complete cycles till next autoupdate instant
     }
     LL_MUL(temp,cycleCnt,microsecInDayCnt);    //micro secs from last update
-    LL_ADD(tempTime, lastUpdate, temp);
+    tempTime = lastUpdate + temp;
     break;  
   case TYPE_AUTOUPDATE_TIME_BASED:
     LL_SUB(tempTime, nextUpdate, microsecInDayCnt);
     break;
   default:
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
--- a/tools/trace-malloc/spacetrace.c
+++ b/tools/trace-malloc/spacetrace.c
@@ -670,20 +670,18 @@ recalculateAllocationCost(STOptions * in
         LL_MUL(weight64, timeval64, size64);
 
         /*
          ** First, update this run.
          */
         aRun->mStats[inContext->mIndex].mCompositeCount++;
         aRun->mStats[inContext->mIndex].mHeapRuntimeCost += heapCost;
         aRun->mStats[inContext->mIndex].mSize += size;
-        LL_ADD(aRun->mStats[inContext->mIndex].mTimeval64,
-               aRun->mStats[inContext->mIndex].mTimeval64, timeval64);
-        LL_ADD(aRun->mStats[inContext->mIndex].mWeight64,
-               aRun->mStats[inContext->mIndex].mWeight64, weight64);
+        aRun->mStats[inContext->mIndex].mTimeval64 += timeval64;
+        aRun->mStats[inContext->mIndex].mWeight64 += weight64;
 
         /*
          ** Use the first event of the allocation to update the parent
          **  callsites.
          ** This has positive effect of not updating realloc callsites
          **  with the same data over and over again.
          */
         if (updateParent && 0 < aAllocation->mEventCount) {
@@ -722,22 +720,20 @@ recalculateAllocationCost(STOptions * in
                      **  absolute need arise to count them individually,
                      **  but I fear it will take mucho memory and this
                      **  is perhaps good enough for now.
                      */
                     callsiteRun->mStats[inContext->mIndex].mCompositeCount++;
                     callsiteRun->mStats[inContext->mIndex].mHeapRuntimeCost +=
                         heapCost;
                     callsiteRun->mStats[inContext->mIndex].mSize += size;
-                    LL_ADD(callsiteRun->mStats[inContext->mIndex].mTimeval64,
-                           callsiteRun->mStats[inContext->mIndex].mTimeval64,
-                           timeval64);
-                    LL_ADD(callsiteRun->mStats[inContext->mIndex].mWeight64,
-                           callsiteRun->mStats[inContext->mIndex].mWeight64,
-                           weight64);
+                    callsiteRun->mStats[inContext->mIndex].mTimeval64 +=
+                        timeval64;
+                    callsiteRun->mStats[inContext->mIndex].mWeight64 +=
+                        weight64;
                 }
 
                 callsite = callsite->parent;
             }
         }
     }
 
     return 0;
@@ -4429,18 +4425,17 @@ graphWeight(STRequest * inRequest, STRun
                         LL_UI2L(size64,
                                 byteSize(&inRequest->mOptions,
                                          aRun->mAllocations[loop]));
                         LL_UI2L(lifespan64,
                                 (aRun->mAllocations[loop]->mMaxTimeval -
                                  aRun->mAllocations[loop]->mMinTimeval));
                         LL_MUL(weight64, size64, lifespan64);
 
-                        LL_ADD(YData64[traverse], YData64[traverse],
-                               weight64);
+                        YData64[traverse] += weight64;
                     }
                 }
             }
 
             /*
              ** Did we cache this?
              */
             if (YData64 == inRequest->mContext->mWeightYData64) {
--- a/tools/trace-malloc/tmstats.c
+++ b/tools/trace-malloc/tmstats.c
@@ -413,20 +413,20 @@ void addVariance(VarianceState* inVarian
 **  Add a value to a variance state.
 */
 {
     uint64_t squared;
     uint64_t bigValue;
     
     LL_UI2L(bigValue, inValue);
 
-    LL_ADD(inVariance->mSum, inVariance->mSum, bigValue);
+    inVariance->mSum += bigValue;
 
     LL_MUL(squared, bigValue, bigValue);
-    LL_ADD(inVariance->mSquaredSum, inVariance->mSquaredSum, squared);
+    inVariance->mSquaredSum, inVariance->mSquaredSum += squared;
 
     inVariance->mCount++;
 }
 
 
 double getAverage(VarianceState* inVariance)
 /*
 **  Determine the mean/average based on the given state.
--- a/xpcom/ds/nsCRT.cpp
+++ b/xpcom/ds/nsCRT.cpp
@@ -174,15 +174,15 @@ int64_t nsCRT::atoll(const char *str)
     if (!str)
         return LL_Zero();
 
     int64_t ll = LL_Zero(), digitll = LL_Zero();
 
     while (*str && *str >= '0' && *str <= '9') {
         LL_MUL(ll, ll, 10);
         LL_UI2L(digitll, (*str - '0'));
-        LL_ADD(ll, ll, digitll);
+        ll += digitll;
         str++;
     }
 
     return ll;
 }
 
--- a/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp
+++ b/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp
@@ -158,17 +158,17 @@ InvokeTestTarget::MultTwoInts(int32_t p1
 {
     *retval = p1 * p2;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 InvokeTestTarget::AddTwoLLs(int64_t p1, int64_t p2, int64_t* retval)
 {
-    LL_ADD(*retval, p1, p2);
+    *retval = p1 + p2;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 InvokeTestTarget::MultTwoLLs(int64_t p1, int64_t p2, int64_t* retval)
 {
     LL_MUL(*retval, p1, p2);
     return NS_OK;