Bug 792581 - part 21: Replace LL_F2L and LL_D2L macros. r=ehsan
authorAndrew Quartey <andrew.quartey@gmail.com>
Thu, 25 Oct 2012 19:25:58 -0400
changeset 111596 9aa2637e2b6b1a86f08fb14b99eb05aadb3d42c5
parent 111595 5fb440887096d1c497b2a15adeebe2a20a15f229
child 111597 b3a9ae0f6abfb48bbcbc7a51fb34c08dbd65df24
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersehsan
bugs792581
milestone19.0a1
Bug 792581 - part 21: Replace LL_F2L and LL_D2L macros. r=ehsan
security/manager/ssl/src/nsCRLManager.cpp
storage/src/mozStoragePrivateHelpers.cpp
xpcom/ds/nsVariant.cpp
--- a/security/manager/ssl/src/nsCRLManager.cpp
+++ b/security/manager/ssl/src/nsCRLManager.cpp
@@ -385,25 +385,23 @@ 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 = double(secsInDay);
   tmpData *= dayCnt;
-  LL_F2L(secsInDayCnt,tmpData);
-  microsecInDayCnt = secsInDayCnt * PR_USEC_PER_SEC;
-    
+  microsecInDayCnt = int64_t(tmpData) * PR_USEC_PER_SEC;
+
   PRTime lastUpdate;
   PRTime nextUpdate;
-  
+
   nsresult rv;
 
   rv = info->GetLastUpdate(&lastUpdate);
   if (NS_FAILED(rv))
     return rv;
 
   rv = info->GetNextUpdate(&nextUpdate);
   if (NS_FAILED(rv))
--- a/storage/src/mozStoragePrivateHelpers.cpp
+++ b/storage/src/mozStoragePrivateHelpers.cpp
@@ -137,18 +137,17 @@ convertJSValToVariant(
   if (aValue.isObject()) {
     JSObject* obj = &aValue.toObject();
     // We only support Date instances, all others fail.
     if (!::js_DateIsValid(obj))
       return nullptr;
 
     double msecd = ::js_DateGetMsecSinceEpoch(obj);
     msecd *= 1000.0;
-    int64_t msec;
-    LL_D2L(msec, msecd);
+    int64_t msec = msecd;
 
     return new IntegerVariant(msec);
   }
 
   return nullptr;
 }
 
 namespace {
--- a/xpcom/ds/nsVariant.cpp
+++ b/xpcom/ds/nsVariant.cpp
@@ -649,17 +649,17 @@ nsVariant::ConvertToInt64(const nsDiscri
     case nsIDataType::VTYPE_INT32:
         *_retval = tempData.u.mInt32Value;
         return rv;
     case nsIDataType::VTYPE_UINT32:
         *_retval = tempData.u.mUint32Value;
         return rv;
     case nsIDataType::VTYPE_DOUBLE:
         // XXX should check for data loss here!
-        LL_D2L(*_retval, tempData.u.mDoubleValue);
+        *_retval = tempData.u.mDoubleValue;
         return rv;
     default:
         NS_ERROR("bad type returned from ToManageableNumber");
         return NS_ERROR_CANNOT_CONVERT_DATA;
     }
 }
 
 /* static */ nsresult