From e0ab0ad85d5e8a6a83584c8d24762c5508294448 Mon Sep 17 00:00:00 2001 From: kjellander Date: Mon, 10 Apr 2017 23:21:43 -0700 Subject: [PATCH] Rename COMPILE_ASSERT macro to RTC_COMPILE_ASSERT This is needed to avoid name collision with some downstream projects. BUG=b/37224347 TBR=henrika@webrtc.org NOTRY=True Review-Url: https://codereview.webrtc.org/2808343002 Cr-Commit-Position: refs/heads/master@{#17634} --- webrtc/common_audio/signal_processing/include/spl_inl.h | 4 ++-- .../audio_coding/codecs/isac/fix/source/pitch_estimator_c.c | 2 +- .../codecs/isac/fix/source/pitch_estimator_mips.c | 2 +- .../audio_coding/codecs/isac/fix/source/pitch_filter.c | 4 ++-- .../audio_coding/codecs/isac/main/source/pitch_filter.c | 2 +- webrtc/system_wrappers/include/compile_assert_c.h | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/webrtc/common_audio/signal_processing/include/spl_inl.h b/webrtc/common_audio/signal_processing/include/spl_inl.h index 370834e694..48dd18140a 100644 --- a/webrtc/common_audio/signal_processing/include/spl_inl.h +++ b/webrtc/common_audio/signal_processing/include/spl_inl.h @@ -46,7 +46,7 @@ static __inline int WebRtcSpl_CountLeadingZeros64_NotBuiltin(uint64_t n) { // Returns the number of leading zero bits in the argument. static __inline int WebRtcSpl_CountLeadingZeros32(uint32_t n) { #ifdef __GNUC__ - COMPILE_ASSERT(sizeof(unsigned int) == sizeof(uint32_t)); + RTC_COMPILE_ASSERT(sizeof(unsigned int) == sizeof(uint32_t)); return n == 0 ? 32 : __builtin_clz(n); #else return WebRtcSpl_CountLeadingZeros32_NotBuiltin(n); @@ -56,7 +56,7 @@ static __inline int WebRtcSpl_CountLeadingZeros32(uint32_t n) { // Returns the number of leading zero bits in the argument. static __inline int WebRtcSpl_CountLeadingZeros64(uint64_t n) { #ifdef __GNUC__ - COMPILE_ASSERT(sizeof(unsigned long long) == sizeof(uint64_t)); // NOLINT + RTC_COMPILE_ASSERT(sizeof(unsigned long long) == sizeof(uint64_t)); // NOLINT return n == 0 ? 64 : __builtin_clzll(n); #else return WebRtcSpl_CountLeadingZeros64_NotBuiltin(n); diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator_c.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator_c.c index 0d881e8044..8322e3c6fd 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator_c.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator_c.c @@ -64,7 +64,7 @@ void WebRtcIsacfix_PCorr2Q32(const int16_t* in, int32_t* logcorQ8) { // Can't shift a Neon register to right with a non-constant shift value. int32x4_t int_32x4_scale = vdupq_n_s32(-scaling); // Assert a codition used in loop unrolling at compile-time. - COMPILE_ASSERT(PITCH_CORR_LEN2 %4 == 0); + RTC_COMPILE_ASSERT(PITCH_CORR_LEN2 %4 == 0); for (n = 0; n < PITCH_CORR_LEN2; n += 4) { int16x4_t int_16x4_x = vld1_s16(&x[n]); diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator_mips.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator_mips.c index bd26700058..08cde976b5 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator_mips.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator_mips.c @@ -33,7 +33,7 @@ void WebRtcIsacfix_PCorr2Q32(const int16_t* in, int32_t* logcorQ8) { const int16_t* tmp_in = in; int32_t tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8; n = PITCH_CORR_LEN2; - COMPILE_ASSERT(PITCH_CORR_LEN2 % 4 == 0); + RTC_COMPILE_ASSERT(PITCH_CORR_LEN2 % 4 == 0); __asm __volatile ( ".set push \n\t" ".set noreorder \n\t" diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c index a8c491c671..ef3d4d77ad 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c @@ -59,8 +59,8 @@ void WebRtcIsacfix_PitchFilter(int16_t* indatQQ, // Q10 if type is 1 or 4, const int16_t* fracoeffQQ = NULL; // Assumptions in ARM assembly for WebRtcIsacfix_PitchFilterCoreARM(). - COMPILE_ASSERT(PITCH_FRACORDER == 9); - COMPILE_ASSERT(PITCH_DAMPORDER == 5); + RTC_COMPILE_ASSERT(PITCH_FRACORDER == 9); + RTC_COMPILE_ASSERT(PITCH_DAMPORDER == 5); // Set up buffer and states. memcpy(ubufQQ, pfp->ubufQQ, sizeof(pfp->ubufQQ)); diff --git a/webrtc/modules/audio_coding/codecs/isac/main/source/pitch_filter.c b/webrtc/modules/audio_coding/codecs/isac/main/source/pitch_filter.c index cdb30a74e7..4f7af998fa 100644 --- a/webrtc/modules/audio_coding/codecs/isac/main/source/pitch_filter.c +++ b/webrtc/modules/audio_coding/codecs/isac/main/source/pitch_filter.c @@ -277,7 +277,7 @@ static void FilterFrame(const double* in_data, PitchFiltstr* filter_state, /* Copy states to local variables. */ memcpy(filter_parameters.buffer, filter_state->ubuf, sizeof(filter_state->ubuf)); - COMPILE_ASSERT(sizeof(filter_parameters.buffer) >= + RTC_COMPILE_ASSERT(sizeof(filter_parameters.buffer) >= sizeof(filter_state->ubuf)); memset(filter_parameters.buffer + sizeof(filter_state->ubuf) / sizeof(filter_state->ubuf[0]), diff --git a/webrtc/system_wrappers/include/compile_assert_c.h b/webrtc/system_wrappers/include/compile_assert_c.h index 00f6306e9f..41c1ff7725 100644 --- a/webrtc/system_wrappers/include/compile_assert_c.h +++ b/webrtc/system_wrappers/include/compile_assert_c.h @@ -14,8 +14,8 @@ // Use this macro to verify at compile time that certain restrictions are met. // The argument is the boolean expression to evaluate. // Example: -// COMPILE_ASSERT(sizeof(foo) < 128); +// RTC_COMPILE_ASSERT(sizeof(foo) < 128); // Note: In C++, use static_assert instead! -#define COMPILE_ASSERT(expression) switch (0) {case 0: case expression:;} +#define RTC_COMPILE_ASSERT(expression) switch (0) {case 0: case expression:;} #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_COMPILE_ASSERT_H_