Chromium Code Reviews

Unified Diff: media/base/audio_bus.cc

Issue 826953002: replace COMPILE_ASSERT with static_assert in media/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « media/audio/cras/cras_input.cc ('k') | media/base/audio_splicer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_bus.cc
diff --git a/media/base/audio_bus.cc b/media/base/audio_bus.cc
index c6236b642b7eb6384f1edb56a57610467f9a1b20..719dbcd55714c941b5d61f2c13cb56f40269ce2b 100644
--- a/media/base/audio_bus.cc
+++ b/media/base/audio_bus.cc
@@ -42,8 +42,8 @@ template<class Format, class Fixed, Format Bias>
static void FromInterleavedInternal(const void* src, int start_frame,
int frames, AudioBus* dest,
float min, float max) {
- COMPILE_ASSERT((Bias == 0 && sizeof(Fixed) == sizeof(Format)) ||
- sizeof(Fixed) > sizeof(Format), invalid_deinterleave_types);
+ static_assert((Bias == 0 && sizeof(Fixed) == sizeof(Format)) ||
+ sizeof(Fixed) > sizeof(Format), "invalid deinterleave types");
const Format* source = static_cast<const Format*>(src);
const int channels = dest->channels();
for (int ch = 0; ch < channels; ++ch) {
@@ -62,8 +62,8 @@ static void FromInterleavedInternal(const void* src, int start_frame,
template<class Format, class Fixed, Format Bias>
static void ToInterleavedInternal(const AudioBus* source, int start_frame,
int frames, void* dst, Fixed min, Fixed max) {
- COMPILE_ASSERT((Bias == 0 && sizeof(Fixed) == sizeof(Format)) ||
- sizeof(Fixed) > sizeof(Format), invalid_interleave_types);
+ static_assert((Bias == 0 && sizeof(Fixed) == sizeof(Format)) ||
+ sizeof(Fixed) > sizeof(Format), "invalid interleave types");
Format* dest = static_cast<Format*>(dst);
const int channels = source->channels();
for (int ch = 0; ch < channels; ++ch) {
« no previous file with comments | « media/audio/cras/cras_input.cc ('k') | media/base/audio_splicer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine