Bug 792581 - part 17: Replace LL_L2F macro with a double cast. r=ehsan
authorAndrew Quartey <andrew.quartey@gmail.com>
Fri, 12 Oct 2012 13:29:11 -0400
changeset 110252 7ed2340f0df6ad4f1f53a453c15134d46b38e379
parent 110251 14cef04d0b3455b4337d286683f7ebe291de26d1
child 110253 2aef09336e782afc706117e4882a556724ee3ff7
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersehsan
bugs792581
milestone19.0a1
Bug 792581 - part 17: Replace LL_L2F macro with a double cast. r=ehsan
security/manager/ssl/src/nsCRLManager.cpp
tools/trace-malloc/tmstats.c
--- a/security/manager/ssl/src/nsCRLManager.cpp
+++ b/security/manager/ssl/src/nsCRLManager.cpp
@@ -388,20 +388,18 @@ nsCRLManager::ComputeNextAutoUpdateTime(
   PRTime microsecInDayCnt;
   PRTime now = PR_Now();
   PRTime tempTime;
   int64_t diff = 0;
   int64_t secsInDay = 86400UL;
   int64_t temp;
   int64_t cycleCnt = 0;
   int64_t secsInDayCnt;
-  double tmpData;
-  
-  LL_L2F(tmpData,secsInDay);
-  tmpData = dayCnt * tmpData;
+  double tmpData = double(secsInDay);
+  tmpData *= dayCnt;
   LL_F2L(secsInDayCnt,tmpData);
   microsecInDayCnt = secsInDayCnt * PR_USEC_PER_SEC;
     
   PRTime lastUpdate;
   PRTime nextUpdate;
   
   nsresult rv;
 
--- a/tools/trace-malloc/tmstats.c
+++ b/tools/trace-malloc/tmstats.c
@@ -432,61 +432,57 @@ double getAverage(VarianceState* inVaria
 **  Determine the mean/average based on the given state.
 */
 {
     double retval = 0.0;
 
     if(NULL != inVariance && 0 < inVariance->mCount)
     {
         double count;
-        double sum;
         int64_t isum;
 
         /*
         **  Avoids a compiler error (not impl) under MSVC.
         */
         isum = inVariance->mSum;
 
         count = (double)inVariance->mCount;
-        LL_L2F(sum, isum);
 
-        retval = sum / count;
+        retval = (double)isum / count;
     }
 
     return retval;
 }
 
 
 double getVariance(VarianceState* inVariance)
 /*
 **  Determine the variance based on the given state.
 */
 {
     double retval = 0.0;
 
     if(NULL != inVariance && 1 < inVariance->mCount)
     {
         double count;
-        double squaredSum;
         double avg;
         double squaredAvg;
         int64_t isquaredSum;
 
         /*
         **  Avoids a compiler error (not impl) under MSVC.
         */
         isquaredSum = inVariance->mSquaredSum;
 
         count = (double)inVariance->mCount;
-        LL_L2F(squaredSum, isquaredSum);
 
         avg = getAverage(inVariance);
         squaredAvg = avg * avg;
 
-        retval = (squaredSum - (count * squaredAvg)) / (count - 1.0);
+        retval = ((double)isquaredSum - (count * squaredAvg)) / (count - 1.0);
     }
 
     return retval;
 }
 
 
 double getStdDev(VarianceState* inVariance)
 /*