Bug 960097 - Port MailNews Bug 773782 (Stop using LL_* macros) r=Neil SEA_2_26_1_RELBRANCH
authorPhilip Chee <philip.chee@gmail.com>
Thu, 20 Feb 2014 01:43:55 +0800
branchSEA_2_26_1_RELBRANCH
changeset 31063 1be8b2fb73506a852d49ca7b0c1455c20841c4d0
parent 31062 ff1ec742d4c028d4687c83253ce0a4a940aee98c
child 31064 64aa494ec68c5f7e9b2f02e653171afcc240d72a
push id1
push userclokep@gmail.com
push dateMon, 07 May 2018 22:45:56 +0000
treeherdercomm-esr60@57eacde5ef40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil
bugs960097, 773782
Bug 960097 - Port MailNews Bug 773782 (Stop using LL_* macros) r=Neil
suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
--- a/suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
+++ b/suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
@@ -939,45 +939,39 @@ nsNetscapeProfileMigratorBase::CopyMailF
   uint32_t count = mFileCopyTransactions.Length();
   mMaxProgress = 0;
   mCurrentProgress = 0;
 
   for (uint32_t i = 0; i < count; ++i) {
     fileTransactionEntry fileTransaction = mFileCopyTransactions[i];
     int64_t fileSize;
     fileTransaction.srcFile->GetFileSize(&fileSize);
-    LL_ADD(mMaxProgress, mMaxProgress, fileSize);
+    mMaxProgress += fileSize;
   }
 
   CopyNextFolder();
 }
 
 void
 nsNetscapeProfileMigratorBase::CopyNextFolder()
 {
   if (mFileCopyTransactionIndex < mFileCopyTransactions.Length()) {
-    uint32_t percentage = 0;
     fileTransactionEntry fileTransaction =
       mFileCopyTransactions.ElementAt(mFileCopyTransactionIndex++);
 
     // copy the file
     fileTransaction.srcFile->CopyTo(fileTransaction.destFile,
                                     EmptyString());
 
     // add to our current progress
     int64_t fileSize;
     fileTransaction.srcFile->GetFileSize(&fileSize);
-    LL_ADD(mCurrentProgress, mCurrentProgress, fileSize);
+    mCurrentProgress += fileSize;
 
-    int64_t percentDone;
-    LL_MUL(percentDone, mCurrentProgress, 100);
-
-    LL_DIV(percentDone, percentDone, mMaxProgress);
-
-    LL_L2UI(percentage, percentDone);
+    uint32_t percentage = (uint32_t)(mCurrentProgress * 100 / mMaxProgress);
 
     nsAutoString index;
     index.AppendInt(percentage);
 
     NOTIFY_OBSERVERS(MIGRATION_PROGRESS, index.get());
 
     if (mFileCopyTransactionIndex == mFileCopyTransactions.Length())
     {