Bug 1634098 - Fix a few clang-tidy warnings in AudioNodeEngine.cpp and vector sibling files. r=karlt
authorPaul Adenot <paul@paul.cx>
Wed, 29 Apr 2020 22:39:15 +0000
changeset 526945 7da0e8f48422e10c8c8428f0a725f75e2762539b
parent 526944 e6c0259e36889e3c12e4f76487ea9e2adb0e8f16
child 526946 39acb94eae20f36c4a88523e7d86893cbdb70c29
push id114584
push userpadenot@mozilla.com
push dateThu, 30 Apr 2020 10:42:01 +0000
treeherderautoland@7da0e8f48422 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1634098
milestone77.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 1634098 - Fix a few clang-tidy warnings in AudioNodeEngine.cpp and vector sibling files. r=karlt Differential Revision: https://phabricator.services.mozilla.com/D73087
dom/media/webaudio/AudioNodeEngine.cpp
dom/media/webaudio/AudioNodeEngine.h
dom/media/webaudio/AudioNodeEngineNEON.cpp
dom/media/webaudio/AudioNodeEngineNEON.h
--- a/dom/media/webaudio/AudioNodeEngine.cpp
+++ b/dom/media/webaudio/AudioNodeEngine.cpp
@@ -37,17 +37,19 @@ ThreadSharedFloatArrayBufferList::Create
 
   return buffer.forget();
 }
 
 void WriteZeroesToAudioBlock(AudioBlock* aChunk, uint32_t aStart,
                              uint32_t aLength) {
   MOZ_ASSERT(aStart + aLength <= WEBAUDIO_BLOCK_SIZE);
   MOZ_ASSERT(!aChunk->IsNull(), "You should pass a non-null chunk");
-  if (aLength == 0) return;
+  if (aLength == 0) {
+    return;
+  }
 
   for (uint32_t i = 0; i < aChunk->ChannelCount(); ++i) {
     PodZero(aChunk->ChannelFloatsForWrite(i) + aStart, aLength);
   }
 }
 
 void AudioBufferCopyWithScale(const float* aInput, float aScale, float* aOutput,
                               uint32_t aSize) {
@@ -298,19 +300,19 @@ void AudioBlockPanStereoToStereo(const f
       aOutputL[i] = aInputL[i] * aGainL;
       aOutputR[i] = aInputR[i] + aInputL[i] * aGainR;
     }
   }
 }
 
 void AudioBlockPanStereoToStereo(const float aInputL[WEBAUDIO_BLOCK_SIZE],
                                  const float aInputR[WEBAUDIO_BLOCK_SIZE],
-                                 float aGainL[WEBAUDIO_BLOCK_SIZE],
-                                 float aGainR[WEBAUDIO_BLOCK_SIZE],
-                                 bool aIsOnTheLeft[WEBAUDIO_BLOCK_SIZE],
+                                 const float aGainL[WEBAUDIO_BLOCK_SIZE],
+                                 const float aGainR[WEBAUDIO_BLOCK_SIZE],
+                                 const bool aIsOnTheLeft[WEBAUDIO_BLOCK_SIZE],
                                  float aOutputL[WEBAUDIO_BLOCK_SIZE],
                                  float aOutputR[WEBAUDIO_BLOCK_SIZE]) {
 #ifdef USE_NEON
   if (mozilla::supports_neon()) {
     AudioBlockPanStereoToStereo_NEON(aInputL, aInputR, aGainL, aGainR,
                                      aIsOnTheLeft, aOutputL, aOutputR);
     return;
   }
--- a/dom/media/webaudio/AudioNodeEngine.h
+++ b/dom/media/webaudio/AudioNodeEngine.h
@@ -228,19 +228,19 @@ void AudioBlockPanMonoToStereo(const flo
  */
 void AudioBlockPanStereoToStereo(const float aInputL[WEBAUDIO_BLOCK_SIZE],
                                  const float aInputR[WEBAUDIO_BLOCK_SIZE],
                                  float aGainL, float aGainR, bool aIsOnTheLeft,
                                  float aOutputL[WEBAUDIO_BLOCK_SIZE],
                                  float aOutputR[WEBAUDIO_BLOCK_SIZE]);
 void AudioBlockPanStereoToStereo(const float aInputL[WEBAUDIO_BLOCK_SIZE],
                                  const float aInputR[WEBAUDIO_BLOCK_SIZE],
-                                 float aGainL[WEBAUDIO_BLOCK_SIZE],
-                                 float aGainR[WEBAUDIO_BLOCK_SIZE],
-                                 bool aIsOnTheLeft[WEBAUDIO_BLOCK_SIZE],
+                                 const float aGainL[WEBAUDIO_BLOCK_SIZE],
+                                 const float aGainR[WEBAUDIO_BLOCK_SIZE],
+                                 const bool aIsOnTheLeft[WEBAUDIO_BLOCK_SIZE],
                                  float aOutputL[WEBAUDIO_BLOCK_SIZE],
                                  float aOutputR[WEBAUDIO_BLOCK_SIZE]);
 
 /**
  * Return the sum of squares of all of the samples in the input.
  */
 float AudioBufferSumOfSquares(const float* aInput, uint32_t aLength);
 
--- a/dom/media/webaudio/AudioNodeEngineNEON.cpp
+++ b/dom/media/webaudio/AudioNodeEngineNEON.cpp
@@ -250,18 +250,19 @@ void AudioBlockPanStereoToStereo_NEON(co
       vst1q_f32(ADDRESS_OF(aOutputR, i), voutR0);
       vst1q_f32(ADDRESS_OF(aOutputR, i + 4), voutR1);
     }
   }
 }
 
 void AudioBlockPanStereoToStereo_NEON(
     const float aInputL[WEBAUDIO_BLOCK_SIZE],
-    const float aInputR[WEBAUDIO_BLOCK_SIZE], float aGainL[WEBAUDIO_BLOCK_SIZE],
-    float aGainR[WEBAUDIO_BLOCK_SIZE],
+    const float aInputR[WEBAUDIO_BLOCK_SIZE],
+    const float aGainL[WEBAUDIO_BLOCK_SIZE],
+    const float aGainR[WEBAUDIO_BLOCK_SIZE],
     const bool aIsOnTheLeft[WEBAUDIO_BLOCK_SIZE],
     float aOutputL[WEBAUDIO_BLOCK_SIZE], float aOutputR[WEBAUDIO_BLOCK_SIZE]) {
   ASSERT_ALIGNED(aInputL);
   ASSERT_ALIGNED(aInputR);
   ASSERT_ALIGNED(aGainL);
   ASSERT_ALIGNED(aGainR);
   ASSERT_ALIGNED(aIsOnTheLeft);
   ASSERT_ALIGNED(aOutputL);
--- a/dom/media/webaudio/AudioNodeEngineNEON.h
+++ b/dom/media/webaudio/AudioNodeEngineNEON.h
@@ -27,15 +27,16 @@ void AudioBlockPanStereoToStereo_NEON(co
                                       const float aInputR[WEBAUDIO_BLOCK_SIZE],
                                       float aGainL, float aGainR,
                                       bool aIsOnTheLeft,
                                       float aOutputL[WEBAUDIO_BLOCK_SIZE],
                                       float aOutputR[WEBAUDIO_BLOCK_SIZE]);
 
 void AudioBlockPanStereoToStereo_NEON(
     const float aInputL[WEBAUDIO_BLOCK_SIZE],
-    const float aInputR[WEBAUDIO_BLOCK_SIZE], float aGainL[WEBAUDIO_BLOCK_SIZE],
-    float aGainR[WEBAUDIO_BLOCK_SIZE],
+    const float aInputR[WEBAUDIO_BLOCK_SIZE],
+    const float aGainL[WEBAUDIO_BLOCK_SIZE],
+    const float aGainR[WEBAUDIO_BLOCK_SIZE],
     const bool aIsOnTheLeft[WEBAUDIO_BLOCK_SIZE],
     float aOutputL[WEBAUDIO_BLOCK_SIZE], float aOutputR[WEBAUDIO_BLOCK_SIZE]);
 }  // namespace mozilla
 
 #endif /* MOZILLA_AUDIONODEENGINENEON_H_ */