Bug 1204195 - Fix two warnings in dom/media/webaudio/blink/. r=rillian.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 14 Sep 2015 18:09:14 -0700
changeset 296813 a748cf7b0c31adc60074e85d3fbb92f1d2fdff89
parent 296812 8dbe5f85a00892167aac0e68dc58354b0f3e9ca9
child 296814 f4c221a95b3649fd6746015f1f76228ad4413d95
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs1204195
milestone43.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 1204195 - Fix two warnings in dom/media/webaudio/blink/. r=rillian. They were both "truncation from 'double' to 'float'" warnings. This also allows the COMPILER_ALLOW_WARNINGS=True flag to be removed.
dom/media/webaudio/blink/DynamicsCompressorKernel.cpp
dom/media/webaudio/blink/PeriodicWave.cpp
dom/media/webaudio/blink/moz.build
--- a/dom/media/webaudio/blink/DynamicsCompressorKernel.cpp
+++ b/dom/media/webaudio/blink/DynamicsCompressorKernel.cpp
@@ -162,17 +162,17 @@ float DynamicsCompressorKernel::slopeAt(
 }
 
 float DynamicsCompressorKernel::kAtSlope(float desiredSlope)
 {
     float xDb = m_dbThreshold + m_dbKnee;
     float x = WebAudioUtils::ConvertDecibelsToLinear(xDb);
 
     // Approximate k given initial values.
-    float minK = 0.1;
+    float minK = 0.1f;
     float maxK = 10000;
     float k = 5;
 
     for (int i = 0; i < 15; ++i) {
         // A high value for k will more quickly asymptotically approach a slope of 0.
         float slope = slopeAt(x, k);
 
         if (slope < desiredSlope) {
--- a/dom/media/webaudio/blink/PeriodicWave.cpp
+++ b/dom/media/webaudio/blink/PeriodicWave.cpp
@@ -232,17 +232,17 @@ void PeriodicWave::createBandLimitedTabl
 
         // Apply normalization scale.
         AudioBufferInPlaceScale(data, normalizationScale, m_periodicWaveSize);
     }
 }
 
 void PeriodicWave::generateBasicWaveform(OscillatorType shape)
 {
-    const float piFloat = M_PI;
+    const float piFloat = float(M_PI);
     unsigned fftSize = periodicWaveSize();
     unsigned halfSize = fftSize / 2;
 
     AudioFloatArray real(halfSize);
     AudioFloatArray imag(halfSize);
     float* realP = real.Elements();
     float* imagP = imag.Elements();
 
--- a/dom/media/webaudio/blink/moz.build
+++ b/dom/media/webaudio/blink/moz.build
@@ -25,11 +25,8 @@ UNIFIED_SOURCES += [
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/dom/media/webaudio',
 ]
-
-if not CONFIG['GNU_CXX']:
-    ALLOW_COMPILER_WARNINGS = True