Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Issue 2943833002: Use constexpr to avoid a static initializer (Closed)

Created:
3 years, 6 months ago by brucedawson
Modified:
3 years, 6 months ago
CC:
webrtc-reviews_webrtc.org, AleBzk, peah-webrtc, Andrew MacDonald, aleloi, tterriberry_mozilla.com, audio-team_agora.io, hlundin-webrtc, kwiberg-webrtc, minyue-webrtc, the sun, aluebs-webrtc, bjornv1
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Use constexpr to avoid a static initializer Floating-point calculations are not guaranteed to happen at compile time unless you force the issue with constexpr. This initializer was found by running tools\win\static_initializers on a canary build chrome_child.dll. constexpr was added to kSilenceRms for consistency. BUG=chromium:341941 Review-Url: https://codereview.webrtc.org/2943833002 Cr-Commit-Position: refs/heads/master@{#18684} Committed: https://chromium.googlesource.com/external/webrtc/+/fde21162889a2f053bed72a962cbefbff9bf7369

Patch Set 1 #

Patch Set 2 : Remove unneeded static #

Total comments: 3

Patch Set 3 : Restore static and more constexpr #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M webrtc/modules/audio_processing/vad/vad_audio_proc.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 18 (11 generated)
brucedawson
Minor tweak to improve VC++ code-gen. PTAL
3 years, 6 months ago (2017-06-17 22:07:46 UTC) #7
kwiberg-webrtc
https://codereview.webrtc.org/2943833002/diff/20001/webrtc/modules/audio_processing/vad/vad_audio_proc.cc File webrtc/modules/audio_processing/vad/vad_audio_proc.cc (right): https://codereview.webrtc.org/2943833002/diff/20001/webrtc/modules/audio_processing/vad/vad_audio_proc.cc#newcode36 webrtc/modules/audio_processing/vad/vad_audio_proc.cc:36: constexpr float kFrequencyResolution = That constexpr (and const) imply ...
3 years, 6 months ago (2017-06-17 22:54:30 UTC) #9
hlundin-webrtc
Thanks for you patch. Please, update along the lines that kwiberg points out. https://codereview.webrtc.org/2943833002/diff/20001/webrtc/modules/audio_processing/vad/vad_audio_proc.cc File ...
3 years, 6 months ago (2017-06-19 07:45:23 UTC) #10
brucedawson
https://codereview.webrtc.org/2943833002/diff/20001/webrtc/modules/audio_processing/vad/vad_audio_proc.cc File webrtc/modules/audio_processing/vad/vad_audio_proc.cc (right): https://codereview.webrtc.org/2943833002/diff/20001/webrtc/modules/audio_processing/vad/vad_audio_proc.cc#newcode36 webrtc/modules/audio_processing/vad/vad_audio_proc.cc:36: constexpr float kFrequencyResolution = I added constexpr to kSilenceRms, ...
3 years, 6 months ago (2017-06-19 18:45:56 UTC) #12
hlundin-webrtc
Thanks! LGTM
3 years, 6 months ago (2017-06-20 09:24:27 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2943833002/40001
3 years, 6 months ago (2017-06-20 17:27:19 UTC) #15
commit-bot: I haz the power
3 years, 6 months ago (2017-06-20 17:57:15 UTC) #18
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/external/webrtc/+/fde21162889a2f053bed72a96...

Powered by Google App Engine
This is Rietveld 408576698