summaryrefslogtreecommitdiffstats
path: root/media/libeffects/testlibs/AudioCoefInterpolator.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2011-12-15 09:51:17 -0800
committerGlenn Kasten <gkasten@google.com>2012-01-05 07:33:45 -0800
commitf6b1678f8f508b447155a81b44e214475ab634a8 (patch)
treedabe2858dfed9133c6a270cd6b86877a9d3588b1 /media/libeffects/testlibs/AudioCoefInterpolator.cpp
parent94023fa6744e24f26f0aba1699ec278649bd66df (diff)
downloadframeworks_av-f6b1678f8f508b447155a81b44e214475ab634a8.zip
frameworks_av-f6b1678f8f508b447155a81b44e214475ab634a8.tar.gz
frameworks_av-f6b1678f8f508b447155a81b44e214475ab634a8.tar.bz2
Use the standard CC_LIKELY and CC_UNLIKELY macros
Several source files privately defined macros LIKELY and UNLIKELY in terms of __builtin_expect. But <cutils/compiler.h> already has CC_LIKELY and CC_UNLIKELY which are intended for this purpose. So rename the private uses to use the standard names. In addition, AudioFlinger was relying on the macro expanding to extra ( ). Change-Id: I2494e087a0c0cac0ac998335f5e9c8ad02955873
Diffstat (limited to 'media/libeffects/testlibs/AudioCoefInterpolator.cpp')
-rw-r--r--media/libeffects/testlibs/AudioCoefInterpolator.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/media/libeffects/testlibs/AudioCoefInterpolator.cpp b/media/libeffects/testlibs/AudioCoefInterpolator.cpp
index 039ab9f..6b56922 100644
--- a/media/libeffects/testlibs/AudioCoefInterpolator.cpp
+++ b/media/libeffects/testlibs/AudioCoefInterpolator.cpp
@@ -16,10 +16,10 @@
*/
#include <string.h>
-#include "AudioCoefInterpolator.h"
-#define LIKELY( exp ) (__builtin_expect( (exp) != 0, true ))
-#define UNLIKELY( exp ) (__builtin_expect( (exp) != 0, false ))
+#include <cutils/compiler.h>
+
+#include "AudioCoefInterpolator.h"
namespace android {
@@ -44,9 +44,9 @@ void AudioCoefInterpolator::getCoef(const int intCoord[], uint32_t fracCoord[],
size_t index = 0;
size_t dim = mNumInDims;
while (dim-- > 0) {
- if (UNLIKELY(intCoord[dim] < 0)) {
+ if (CC_UNLIKELY(intCoord[dim] < 0)) {
fracCoord[dim] = 0;
- } else if (UNLIKELY(intCoord[dim] >= (int)mInDims[dim] - 1)) {
+ } else if (CC_UNLIKELY(intCoord[dim] >= (int)mInDims[dim] - 1)) {
fracCoord[dim] = 0;
index += mInDimOffsets[dim] * (mInDims[dim] - 1);
} else {
@@ -63,7 +63,7 @@ void AudioCoefInterpolator::getCoefRecurse(size_t index,
memcpy(out, mTable + index, mNumOutDims * sizeof(audio_coef_t));
} else {
getCoefRecurse(index, fracCoord, out, dim + 1);
- if (LIKELY(fracCoord != 0)) {
+ if (CC_LIKELY(fracCoord != 0)) {
audio_coef_t tempCoef[MAX_OUT_DIMS];
getCoefRecurse(index + mInDimOffsets[dim], fracCoord, tempCoef,
dim + 1);