summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-01-09 11:59:17 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-01-09 11:59:17 -0800
commit4e7191448d5b1eae5181463b6a553fed9cbca3e5 (patch)
tree605bb61672435ce0d19efa3cdaf9065b4d027b5c /services
parent26f260a1676e22f7212ebfaadcdb46b50d0c6a66 (diff)
parent99c2fd36dc9935645441f0519111a23c59df36fa (diff)
downloadframeworks_base-4e7191448d5b1eae5181463b6a553fed9cbca3e5.zip
frameworks_base-4e7191448d5b1eae5181463b6a553fed9cbca3e5.tar.gz
frameworks_base-4e7191448d5b1eae5181463b6a553fed9cbca3e5.tar.bz2
Merge "By convention const goes before the type specifier"
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.h2
-rw-r--r--services/audioflinger/AudioMixer.cpp21
-rw-r--r--services/audioflinger/AudioMixer.h2
-rw-r--r--services/audioflinger/AudioResamplerSinc.cpp14
-rw-r--r--services/audioflinger/AudioResamplerSinc.h8
5 files changed, 24 insertions, 23 deletions
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index cf8d495..ff8dedb 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -63,7 +63,7 @@ class AudioFlinger :
{
friend class BinderService<AudioFlinger>;
public:
- static char const* getServiceName() { return "media.audio_flinger"; }
+ static const char* getServiceName() { return "media.audio_flinger"; }
virtual status_t dump(int fd, const Vector<String16>& args);
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index bc5cb9b..8df4605 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -601,7 +601,7 @@ void AudioMixer::volumeStereo(track_t* t, int32_t* out, size_t frameCount, int32
void AudioMixer::track__16BitsStereo(track_t* t, int32_t* out, size_t frameCount, int32_t* temp, int32_t* aux)
{
- int16_t const *in = static_cast<int16_t const *>(t->in);
+ const int16_t *in = static_cast<const int16_t *>(t->in);
if (CC_UNLIKELY(aux != NULL)) {
int32_t l;
@@ -640,7 +640,7 @@ void AudioMixer::track__16BitsStereo(track_t* t, int32_t* out, size_t frameCount
const uint32_t vrl = t->volumeRL;
const int16_t va = (int16_t)t->auxLevel;
do {
- uint32_t rl = *reinterpret_cast<uint32_t const *>(in);
+ uint32_t rl = *reinterpret_cast<const uint32_t *>(in);
int16_t a = (int16_t)(((int32_t)in[0] + in[1]) >> 1);
in += 2;
out[0] = mulAddRL(1, rl, vrl, out[0]);
@@ -678,7 +678,7 @@ void AudioMixer::track__16BitsStereo(track_t* t, int32_t* out, size_t frameCount
else {
const uint32_t vrl = t->volumeRL;
do {
- uint32_t rl = *reinterpret_cast<uint32_t const *>(in);
+ uint32_t rl = *reinterpret_cast<const uint32_t *>(in);
in += 2;
out[0] = mulAddRL(1, rl, vrl, out[0]);
out[1] = mulAddRL(0, rl, vrl, out[1]);
@@ -691,7 +691,7 @@ void AudioMixer::track__16BitsStereo(track_t* t, int32_t* out, size_t frameCount
void AudioMixer::track__16BitsMono(track_t* t, int32_t* out, size_t frameCount, int32_t* temp, int32_t* aux)
{
- int16_t const *in = static_cast<int16_t const *>(t->in);
+ const int16_t *in = static_cast<int16_t const *>(t->in);
if (CC_UNLIKELY(aux != NULL)) {
// ramp gain
@@ -913,6 +913,7 @@ void AudioMixer::process__genericNoResampling(state_t* state)
// generic code with resampling
void AudioMixer::process__genericResampling(state_t* state)
{
+ // this const just means that local variable outTemp doesn't change
int32_t* const outTemp = state->outputTemp;
const size_t size = sizeof(int32_t) * MAX_NUM_CHANNELS * state->frameCount;
@@ -993,7 +994,7 @@ void AudioMixer::process__OneTrack16BitsStereoNoResampling(state_t* state)
while (numFrames) {
b.frameCount = numFrames;
t.bufferProvider->getNextBuffer(&b);
- int16_t const *in = b.i16;
+ const int16_t *in = b.i16;
// in == NULL can happen if the track was flushed just after having
// been enabled for mixing.
@@ -1009,7 +1010,7 @@ void AudioMixer::process__OneTrack16BitsStereoNoResampling(state_t* state)
// volume is boosted, so we might need to clamp even though
// we process only one track.
do {
- uint32_t rl = *reinterpret_cast<uint32_t const *>(in);
+ uint32_t rl = *reinterpret_cast<const uint32_t *>(in);
in += 2;
int32_t l = mulRL(1, rl, vrl) >> 12;
int32_t r = mulRL(0, rl, vrl) >> 12;
@@ -1020,7 +1021,7 @@ void AudioMixer::process__OneTrack16BitsStereoNoResampling(state_t* state)
} while (--outFrames);
} else {
do {
- uint32_t rl = *reinterpret_cast<uint32_t const *>(in);
+ uint32_t rl = *reinterpret_cast<const uint32_t *>(in);
in += 2;
int32_t l = mulRL(1, rl, vrl) >> 12;
int32_t r = mulRL(0, rl, vrl) >> 12;
@@ -1050,12 +1051,12 @@ void AudioMixer::process__TwoTracks16BitsStereoNoResampling(state_t* state)
const track_t& t1 = state->tracks[i];
AudioBufferProvider::Buffer& b1(t1.buffer);
- int16_t const *in0;
+ const int16_t *in0;
const int16_t vl0 = t0.volume[0];
const int16_t vr0 = t0.volume[1];
size_t frameCount0 = 0;
- int16_t const *in1;
+ const int16_t *in1;
const int16_t vl1 = t1.volume[0];
const int16_t vr1 = t1.volume[1];
size_t frameCount1 = 0;
@@ -1063,7 +1064,7 @@ void AudioMixer::process__TwoTracks16BitsStereoNoResampling(state_t* state)
//FIXME: only works if two tracks use same buffer
int32_t* out = t0.mainBuffer;
size_t numFrames = state->frameCount;
- int16_t const *buff = NULL;
+ const int16_t *buff = NULL;
while (numFrames) {
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index 4ba6845..84f6330 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -145,7 +145,7 @@ private:
mutable AudioBufferProvider::Buffer buffer;
hook_t hook;
- void const* in; // current location in buffer
+ const void* in; // current location in buffer
AudioResampler* resampler;
uint32_t sampleRate;
diff --git a/services/audioflinger/AudioResamplerSinc.cpp b/services/audioflinger/AudioResamplerSinc.cpp
index 9e5e254..d012433 100644
--- a/services/audioflinger/AudioResamplerSinc.cpp
+++ b/services/audioflinger/AudioResamplerSinc.cpp
@@ -284,7 +284,7 @@ template<int CHANNELS>
**/
void AudioResamplerSinc::read(
int16_t*& impulse, uint32_t& phaseFraction,
- int16_t const* in, size_t inputIndex)
+ const int16_t* in, size_t inputIndex)
{
const uint32_t phaseIndex = phaseFraction >> kNumPhaseBits;
impulse += CHANNELS;
@@ -302,7 +302,7 @@ void AudioResamplerSinc::read(
template<int CHANNELS>
void AudioResamplerSinc::filterCoefficient(
- int32_t& l, int32_t& r, uint32_t phase, int16_t const *samples)
+ int32_t& l, int32_t& r, uint32_t phase, const int16_t *samples)
{
// compute the index of the coefficient on the positive side and
// negative side
@@ -317,9 +317,9 @@ void AudioResamplerSinc::filterCoefficient(
l = 0;
r = 0;
- int32_t const* coefs = mFirCoefs;
- int16_t const *sP = samples;
- int16_t const *sN = samples+CHANNELS;
+ const int32_t* coefs = mFirCoefs;
+ const int16_t *sP = samples;
+ const int16_t *sN = samples+CHANNELS;
for (unsigned int i=0 ; i<halfNumCoefs/4 ; i++) {
interpolate<CHANNELS>(l, r, coefs+indexP, lerpP, sP);
interpolate<CHANNELS>(l, r, coefs+indexN, lerpN, sN);
@@ -339,13 +339,13 @@ void AudioResamplerSinc::filterCoefficient(
template<int CHANNELS>
void AudioResamplerSinc::interpolate(
int32_t& l, int32_t& r,
- int32_t const* coefs, int16_t lerp, int16_t const* samples)
+ const int32_t* coefs, int16_t lerp, const int16_t* samples)
{
int32_t c0 = coefs[0];
int32_t c1 = coefs[1];
int32_t sinc = mulAdd(lerp, (c1-c0)<<1, c0);
if (CHANNELS == 2) {
- uint32_t rl = *reinterpret_cast<uint32_t const*>(samples);
+ uint32_t rl = *reinterpret_cast<const uint32_t*>(samples);
l = mulAddRL(1, rl, sinc, l);
r = mulAddRL(0, rl, sinc, r);
} else {
diff --git a/services/audioflinger/AudioResamplerSinc.h b/services/audioflinger/AudioResamplerSinc.h
index e6cb90b..0e1bc44 100644
--- a/services/audioflinger/AudioResamplerSinc.h
+++ b/services/audioflinger/AudioResamplerSinc.h
@@ -44,22 +44,22 @@ private:
template<int CHANNELS>
inline void filterCoefficient(
- int32_t& l, int32_t& r, uint32_t phase, int16_t const *samples);
+ int32_t& l, int32_t& r, uint32_t phase, const int16_t *samples);
template<int CHANNELS>
inline void interpolate(
int32_t& l, int32_t& r,
- int32_t const* coefs, int16_t lerp, int16_t const* samples);
+ const int32_t* coefs, int16_t lerp, const int16_t* samples);
template<int CHANNELS>
inline void read(int16_t*& impulse, uint32_t& phaseFraction,
- int16_t const* in, size_t inputIndex);
+ const int16_t* in, size_t inputIndex);
int16_t *mState;
int16_t *mImpulse;
int16_t *mRingFull;
- int32_t const * mFirCoefs;
+ const int32_t * mFirCoefs;
static const int32_t mFirCoefsDown[];
static const int32_t mFirCoefsUp[];