Bug 780387 - Part d: Stop using PRFloat64; r=bsmedberg
authorMs2ger <ms2ger@gmail.com>
Thu, 09 Aug 2012 09:09:42 +0200
changeset 101929 25378953c5843e7be9df9fb22e7dc6e9f90f87bd
parent 101928 4587cc2d01545d18cea6d650e725af5751f549ee
child 101930 44fe712a01c88f3be3bf1d3ee8b1c74ff4062496
push id13237
push useremorley@mozilla.com
push dateThu, 09 Aug 2012 11:51:38 +0000
treeherdermozilla-inbound@f799dd180292 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs780387
milestone17.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 780387 - Part d: Stop using PRFloat64; r=bsmedberg
content/events/src/nsDOMSimpleGestureEvent.cpp
content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp
dom/base/nsDOMWindowUtils.cpp
image/decoders/nsPNGDecoder.cpp
image/src/imgLoader.cpp
image/src/imgLoader.h
netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
netwerk/test/TestProtocols.cpp
security/manager/ssl/src/nsCRLManager.cpp
toolkit/components/downloads/nsDownloadManager.cpp
widget/nsGUIEvent.h
widget/qt/nsWindow.cpp
widget/xremoteclient/XRemoteClient.cpp
xpcom/io/nsLocalFileUnix.cpp
xpcom/tests/ShowAlignments.cpp
--- a/content/events/src/nsDOMSimpleGestureEvent.cpp
+++ b/content/events/src/nsDOMSimpleGestureEvent.cpp
@@ -45,17 +45,17 @@ nsDOMSimpleGestureEvent::GetDirection(PR
 {
   NS_ENSURE_ARG_POINTER(aDirection);
   *aDirection = static_cast<nsSimpleGestureEvent*>(mEvent)->direction;
   return NS_OK;
 }
 
 /* readonly attribute float delta; */
 NS_IMETHODIMP
-nsDOMSimpleGestureEvent::GetDelta(PRFloat64 *aDelta)
+nsDOMSimpleGestureEvent::GetDelta(double *aDelta)
 {
   NS_ENSURE_ARG_POINTER(aDelta);
   *aDelta = static_cast<nsSimpleGestureEvent*>(mEvent)->delta;
   return NS_OK;
 }
 
 /* readonly attribute unsigned long clickCount; */
 NS_IMETHODIMP
@@ -78,17 +78,17 @@ nsDOMSimpleGestureEvent::InitSimpleGestu
                                                 PRInt32 aClientY,
                                                 bool aCtrlKeyArg,
                                                 bool aAltKeyArg,
                                                 bool aShiftKeyArg,
                                                 bool aMetaKeyArg,
                                                 PRUint16 aButton,
                                                 nsIDOMEventTarget* aRelatedTarget,
                                                 PRUint32 aDirectionArg,
-                                                PRFloat64 aDeltaArg,
+                                                double aDeltaArg,
                                                 PRUint32 aClickCountArg)
 {
   nsresult rv = nsDOMMouseEvent::InitMouseEvent(aTypeArg,
                                                 aCanBubbleArg,
                                                 aCancelableArg,
                                                 aViewArg,
                                                 aDetailArg,
                                                 aScreenX, 
--- a/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp
+++ b/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp
@@ -330,17 +330,17 @@ nsXULTemplateQueryProcessorStorage::Comp
                   &nsGkAtoms::null, &nsGkAtoms::double_, &nsGkAtoms::string, nullptr };
 
             PRInt32 typeError = 1;
             PRInt32 typeValue = child->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
                                                        sTypeValues, eCaseMatters);
             rv = NS_ERROR_ILLEGAL_VALUE;
             PRInt32 valInt32 = 0;
             PRInt64 valInt64 = 0;
-            PRFloat64 valFloat = 0;
+            double valFloat = 0;
 
             switch (typeValue) {
               case 0:
               case 1:
                 typeError = PR_sscanf(NS_ConvertUTF16toUTF8(value).get(),"%d",&valInt32);
                 if (typeError > 0)
                     rv = statement->BindInt32ByIndex(index, valInt32);
                 break;
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -1001,17 +1001,17 @@ nsDOMWindowUtils::CycleCollect(nsICycleC
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::SendSimpleGestureEvent(const nsAString& aType,
                                          float aX,
                                          float aY,
                                          PRUint32 aDirection,
-                                         PRFloat64 aDelta,
+                                         double aDelta,
                                          PRInt32 aModifiers,
                                          PRUint32 aClickCount)
 {
   if (!IsUniversalXPConnectCapable()) {
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
   // get the widget to send the event to
--- a/image/decoders/nsPNGDecoder.cpp
+++ b/image/decoders/nsPNGDecoder.cpp
@@ -127,17 +127,17 @@ void nsPNGDecoder::SetAnimFrameInfo()
     timeout = 0; // SetFrameTimeout() will set to a minimum
   } else {
     if (delay_den == 0)
       delay_den = 100; // so says the APNG spec
 
     // Need to cast delay_num to float to have a proper division and
     // the result to int to avoid compiler warning
     timeout = static_cast<PRInt32>
-              (static_cast<PRFloat64>(delay_num) * 1000 / delay_den);
+              (static_cast<double>(delay_num) * 1000 / delay_den);
   }
 
   PRUint32 numFrames = mImage.GetNumFrames();
 
   mImage.SetFrameTimeout(numFrames - 1, timeout);
 
   if (dispose_op == PNG_DISPOSE_OP_PREVIOUS)
       mImage.SetFrameDisposalMethod(numFrames - 1,
--- a/image/src/imgLoader.cpp
+++ b/image/src/imgLoader.cpp
@@ -807,17 +807,17 @@ imgCacheObserver *gCacheObserver;
 imgCacheExpirationTracker *gCacheTracker;
 
 imgLoader::imgCacheTable imgLoader::sCache;
 imgCacheQueue imgLoader::sCacheQueue;
 
 imgLoader::imgCacheTable imgLoader::sChromeCache;
 imgCacheQueue imgLoader::sChromeCacheQueue;
 
-PRFloat64 imgLoader::sCacheTimeWeight;
+double imgLoader::sCacheTimeWeight;
 PRUint32 imgLoader::sCacheMaxSize;
 
 NS_IMPL_ISUPPORTS5(imgLoader, imgILoader, nsIContentSniffer, imgICache, nsISupportsWeakReference, nsIObserver)
 
 imgLoader::imgLoader()
 {
   /* member initializers and constructor code */
 }
--- a/image/src/imgLoader.h
+++ b/image/src/imgLoader.h
@@ -319,17 +319,17 @@ private: // data
   friend class imgCacheEntry;
   friend class imgMemoryReporter;
 
   static imgCacheTable sCache;
   static imgCacheQueue sCacheQueue;
 
   static imgCacheTable sChromeCache;
   static imgCacheQueue sChromeCacheQueue;
-  static PRFloat64 sCacheTimeWeight;
+  static double sCacheTimeWeight;
   static PRUint32 sCacheMaxSize;
 
   nsCString mAcceptHeader;
 };
 
 
 
 /**
--- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
+++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
@@ -14,17 +14,17 @@
 
 static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
 
 #ifdef DEBUG_BenB_Perf
 #include "prtime.h"
 #include "prinrval.h"
 #endif
 
-const PRFloat64 growthRate = 1.2;
+const double growthRate = 1.2;
 
 // Bug 183111, editor now replaces multiple spaces with leading
 // 0xA0's and a single ending space, so need to treat 0xA0's as spaces.
 // 0xA0 is the Latin1/Unicode character for "non-breaking space (nbsp)"
 // Also recognize the Japanese ideographic space 0x3000 as a space.
 static inline bool IsSpace(const PRUnichar aChar)
 {
   return (nsCRT::IsAsciiSpace(aChar) || aChar == 0xA0 || aChar == 0x3000);
--- a/netwerk/test/TestProtocols.cpp
+++ b/netwerk/test/TestProtocols.cpp
@@ -539,17 +539,17 @@ InputTestConsumer::OnStopRequest(nsIRequ
          NS_ERROR_UNKNOWN_PROXY_HOST == aStatus) {
          LOG(("\tDNS lookup failed.\n"));
      }
     LOG(("\tTime to connect: %.3f seconds\n", connectTime));
     LOG(("\tTime to read: %.3f seconds.\n", readTime));
     LOG(("\tRead: %lld bytes.\n", info->mBytesRead));
     if (info->mBytesRead == PRInt64(0)) {
     } else if (readTime > 0.0) {
-      LOG(("\tThroughput: %.0f bps.\n", (PRFloat64)(info->mBytesRead*PRInt64(8))/readTime));
+      LOG(("\tThroughput: %.0f bps.\n", (double)(info->mBytesRead*PRInt64(8))/readTime));
     } else {
       LOG(("\tThroughput: REAL FAST!!\n"));
     }
 
     nsCOMPtr<nsITimedChannel> timed(do_QueryInterface(request));
     if (timed)
         PrintTimingInformation(timed);
   } else {
--- a/security/manager/ssl/src/nsCRLManager.cpp
+++ b/security/manager/ssl/src/nsCRLManager.cpp
@@ -388,17 +388,17 @@ nsCRLManager::ComputeNextAutoUpdateTime(
   PRTime microsecInDayCnt;
   PRTime now = PR_Now();
   PRTime tempTime;
   PRInt64 diff = 0;
   PRInt64 secsInDay = 86400UL;
   PRInt64 temp;
   PRInt64 cycleCnt = 0;
   PRInt64 secsInDayCnt;
-  PRFloat64 tmpData;
+  double tmpData;
   
   LL_L2F(tmpData,secsInDay);
   LL_MUL(tmpData,dayCnt,tmpData);
   LL_F2L(secsInDayCnt,tmpData);
   LL_MUL(microsecInDayCnt, secsInDayCnt, PR_USEC_PER_SEC);
     
   PRTime lastUpdate;
   PRTime nextUpdate;
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -2909,17 +2909,17 @@ nsDownload::SetProgressBytes(PRInt64 aCu
   (void)GetAmountTransferred(&currBytes);
   (void)GetSize(&maxBytes);
 
   if (currBytes == maxBytes)
     mPercentComplete = 100;
   else if (maxBytes <= 0)
     mPercentComplete = -1;
   else
-    mPercentComplete = (PRInt32)((PRFloat64)currBytes / maxBytes * 100 + .5);
+    mPercentComplete = (PRInt32)((double)currBytes / maxBytes * 100 + .5);
 }
 
 nsresult
 nsDownload::Pause()
 {
   if (!IsResumable())
     return NS_ERROR_UNEXPECTED;
 
--- a/widget/nsGUIEvent.h
+++ b/widget/nsGUIEvent.h
@@ -1708,31 +1708,31 @@ public:
 
 /**
  * Simple gesture event
  */
 class nsSimpleGestureEvent : public nsMouseEvent_base
 {
 public:
   nsSimpleGestureEvent(bool isTrusted, PRUint32 msg, nsIWidget* w,
-                         PRUint32 directionArg, PRFloat64 deltaArg)
+                         PRUint32 directionArg, double deltaArg)
     : nsMouseEvent_base(isTrusted, msg, w, NS_SIMPLE_GESTURE_EVENT),
       direction(directionArg), delta(deltaArg), clickCount(0)
   {
   }
 
   nsSimpleGestureEvent(const nsSimpleGestureEvent& other)
     : nsMouseEvent_base((other.flags & NS_EVENT_FLAG_TRUSTED) != 0,
                         other.message, other.widget, NS_SIMPLE_GESTURE_EVENT),
       direction(other.direction), delta(other.delta), clickCount(0)
   {
   }
 
   PRUint32 direction;   // See nsIDOMSimpleGestureEvent for values
-  PRFloat64 delta;      // Delta for magnify and rotate events
+  double delta;         // Delta for magnify and rotate events
   PRUint32 clickCount;  // The number of taps for tap events
 };
 
 class nsTransitionEvent : public nsEvent
 {
 public:
   nsTransitionEvent(bool isTrusted, PRUint32 msg,
                     const nsString &propertyNameArg, float elapsedTimeArg)
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -2076,17 +2076,17 @@ nsWindow::OnGestureEvent(QGestureEvent* 
             hotspot.x = swipe->hotSpot().x();
             hotspot.y = swipe->hotSpot().y();
 
             // Cancel pinch gesture
             mGesturesCancelled = true;
             mPinchEvent.needDispatch = false;
 
             double distance = DistanceBetweenPoints(swipe->hotSpot(), mPinchEvent.touchPoint) * 2;
-            PRFloat64 delta = distance - mPinchEvent.startDistance;
+            double delta = distance - mPinchEvent.startDistance;
 
             DispatchGestureEvent(NS_SIMPLE_GESTURE_MAGNIFY, 0, delta / 2, hotspot);
 
             result = DispatchGestureEvent(NS_SIMPLE_GESTURE_SWIPE,
                                           swipe->Direction(), 0, hotspot);
         }
         mLastMultiTouchTime.start();
     }
--- a/widget/xremoteclient/XRemoteClient.cpp
+++ b/widget/xremoteclient/XRemoteClient.cpp
@@ -485,17 +485,17 @@ XRemoteClient::FindBestWindow(const char
                                     0, (65536 / sizeof (long)),
                                     False, XA_STRING,
                                     &type, &format, &nitems, &bytesafter,
                                     &data_return);
 
     if (!data_return)
       continue;
 
-    PRFloat64 version = PR_strtod((char*) data_return, nullptr);
+    double version = PR_strtod((char*) data_return, nullptr);
     XFree(data_return);
 
     if (aSupportsCommandLine && !(version >= 5.1 && version < 6))
       continue;
 
     data_return = 0;
 
     if (status != Success || type == None)
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -986,17 +986,17 @@ nsLocalFile::SetLastModifiedTime(PRInt64
 
     int result;
     if (aLastModTime != 0) {
         ENSURE_STAT_CACHE();
         struct utimbuf ut;
         ut.actime = mCachedStat.st_atime;
 
         // convert milliseconds to seconds since the unix epoch
-        ut.modtime = (time_t)(PRFloat64(aLastModTime) / PR_MSEC_PER_SEC);
+        ut.modtime = (time_t)(double(aLastModTime) / PR_MSEC_PER_SEC);
         result = utime(mPath.get(), &ut);
     } else {
         result = utime(mPath.get(), nullptr);
     }
     return NSRESULT_FOR_RETURN(result);
 }
 
 NS_IMETHODIMP
--- a/xpcom/tests/ShowAlignments.cpp
+++ b/xpcom/tests/ShowAlignments.cpp
@@ -23,17 +23,16 @@ int main()
 
   SHOW_TYPE(char);
   SHOW_TYPE(unsigned short);
   SHOW_TYPE(int);
   SHOW_TYPE(long);
   SHOW_TYPE(PRUint8);
   SHOW_TYPE(PRInt16);
   SHOW_TYPE(PRUint32);
-  SHOW_TYPE(PRFloat64);
   SHOW_TYPE(void*);
   SHOW_TYPE(double);
   SHOW_TYPE(short[7]);
   SHOW_TYPE(S);
   SHOW_TYPE(double S::*);
 
   return 0;
 }