Bug 1577236 - clang-10: Fix -Wimplicit-int-float-conversion warnings in dom/vr/ r=kip
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 30 Aug 2019 21:55:18 +0000
changeset 554796 da9a6db4b59b15ff3805a97f1a530551acb6b27a
parent 554795 fe25291a6919fda43493b21746564283ad1fa775
child 554797 3a41fd305c3ce85b9f534f15cd90dfd4ae82c0d1
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskip
bugs1577236
milestone70.0a1
first release with
nightly linux32
da9a6db4b59b / 70.0a1 / 20190831221004 / files
nightly linux64
da9a6db4b59b / 70.0a1 / 20190831221004 / files
nightly mac
da9a6db4b59b / 70.0a1 / 20190831221004 / files
nightly win32
da9a6db4b59b / 70.0a1 / 20190831221004 / files
nightly win64
da9a6db4b59b / 70.0a1 / 20190831221004 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1577236 - clang-10: Fix -Wimplicit-int-float-conversion warnings in dom/vr/ r=kip Depends on D43781 Differential Revision: https://phabricator.services.mozilla.com/D43782
dom/vr/VRDisplay.cpp
--- a/dom/vr/VRDisplay.cpp
+++ b/dom/vr/VRDisplay.cpp
@@ -738,17 +738,17 @@ void VRFrameInfo::Update(const gfx::VRDi
      * be a negative number and will start at a pseudo-random offset
      * between 1000.0f and 11000.0f seconds.
      *
      * We use a pseudo random offset rather than 0.0f just to discourage users
      * from making the assumption that the timestamp returned in the WebVR API
      * has a base of 0, which is not necessarily true in all UA's.
      */
     mTimeStampOffset =
-        float(rand()) / RAND_MAX * 10000.0f + 1000.0f - aState.timestamp;
+        float(rand()) / float(RAND_MAX) * 10000.0f + 1000.0f - aState.timestamp;
   }
   mVRState.timestamp = aState.timestamp + mTimeStampOffset;
 
   // Avoid division by zero within ConstructProjectionMatrix
   const float kEpsilon = 0.00001f;
   if (fabs(aDepthFar - aDepthNear) < kEpsilon) {
     aDepthFar = aDepthNear + kEpsilon;
   }