summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--services/audioflinger/AudioMixerOps.h2
-rw-r--r--services/audioflinger/AudioResamplerDyn.cpp8
-rw-r--r--services/audioflinger/AudioResamplerFirProcess.h2
-rw-r--r--services/audioflinger/tests/resampler_tests.cpp2
-rw-r--r--services/audioflinger/tests/test-mixer.cpp2
-rw-r--r--services/audioflinger/tests/test_utils.h14
6 files changed, 15 insertions, 15 deletions
diff --git a/services/audioflinger/AudioMixerOps.h b/services/audioflinger/AudioMixerOps.h
index 49131f6..f7376a8 100644
--- a/services/audioflinger/AudioMixerOps.h
+++ b/services/audioflinger/AudioMixerOps.h
@@ -184,7 +184,7 @@ inline int16_t MixMul<int16_t, float, float>(float value, float volume) {
template <typename TO, typename TI>
inline void MixAccum(TO *auxaccum, TI value) {
if (!is_same<TO, TI>::value) {
- LOG_ALWAYS_FATAL("MixAccum type not properly specialized: %d %d\n",
+ LOG_ALWAYS_FATAL("MixAccum type not properly specialized: %zu %zu\n",
sizeof(TO), sizeof(TI));
}
*auxaccum += value;
diff --git a/services/audioflinger/AudioResamplerDyn.cpp b/services/audioflinger/AudioResamplerDyn.cpp
index e201ff8..159ab70 100644
--- a/services/audioflinger/AudioResamplerDyn.cpp
+++ b/services/audioflinger/AudioResamplerDyn.cpp
@@ -82,17 +82,17 @@ template<typename TC, typename TI, typename TO>
void AudioResamplerDyn<TC, TI, TO>::InBuffer::resize(int CHANNELS, int halfNumCoefs)
{
// calculate desired state size
- int stateCount = halfNumCoefs * CHANNELS * 2 * kStateSizeMultipleOfFilterLength;
+ size_t stateCount = halfNumCoefs * CHANNELS * 2 * kStateSizeMultipleOfFilterLength;
// check if buffer needs resizing
if (mState
&& stateCount == mStateCount
- && mRingFull-mState == mStateCount-halfNumCoefs*CHANNELS) {
+ && mRingFull-mState == (ssize_t) (mStateCount-halfNumCoefs*CHANNELS)) {
return;
}
// create new buffer
- TI* state;
+ TI* state = NULL;
(void)posix_memalign(reinterpret_cast<void**>(&state), 32, stateCount*sizeof(*state));
memset(state, 0, stateCount*sizeof(*state));
@@ -213,7 +213,7 @@ template<typename TC, typename TI, typename TO>
void AudioResamplerDyn<TC, TI, TO>::createKaiserFir(Constants &c,
double stopBandAtten, int inSampleRate, int outSampleRate, double tbwCheat)
{
- TC* buf;
+ TC* buf = NULL;
static const double atten = 0.9998; // to avoid ripple overflow
double fcr;
double tbw = firKaiserTbw(c.mHalfNumCoefs, stopBandAtten);
diff --git a/services/audioflinger/AudioResamplerFirProcess.h b/services/audioflinger/AudioResamplerFirProcess.h
index d130013..efc8055 100644
--- a/services/audioflinger/AudioResamplerFirProcess.h
+++ b/services/audioflinger/AudioResamplerFirProcess.h
@@ -177,7 +177,7 @@ struct InterpNull {
template <int CHANNELS, int STRIDE, typename TFUNC, typename TC, typename TI, typename TO, typename TINTERP>
static inline
void ProcessBase(TO* const out,
- int count,
+ size_t count,
const TC* coefsP,
const TC* coefsN,
const TI* sP,
diff --git a/services/audioflinger/tests/resampler_tests.cpp b/services/audioflinger/tests/resampler_tests.cpp
index 169ce02..d6217ba 100644
--- a/services/audioflinger/tests/resampler_tests.cpp
+++ b/services/audioflinger/tests/resampler_tests.cpp
@@ -60,7 +60,7 @@ void buffercmp(const void *reference, const void *test,
int check = memcmp((const char*)reference + i * outputFrameSize,
(const char*)test + i * outputFrameSize, outputFrameSize);
if (check) {
- ALOGE("Failure at frame %d", i);
+ ALOGE("Failure at frame %zu", i);
ASSERT_EQ(check, 0); /* fails */
}
}
diff --git a/services/audioflinger/tests/test-mixer.cpp b/services/audioflinger/tests/test-mixer.cpp
index 5a00f40..9a4fad6 100644
--- a/services/audioflinger/tests/test-mixer.cpp
+++ b/services/audioflinger/tests/test-mixer.cpp
@@ -62,7 +62,7 @@ static int writeFile(const char *filename, const void *buffer,
info.samplerate = sampleRate;
info.channels = channels;
info.format = SF_FORMAT_WAV | (isBufferFloat ? SF_FORMAT_FLOAT : SF_FORMAT_PCM_16);
- printf("saving file:%s channels:%d samplerate:%d frames:%d\n",
+ printf("saving file:%s channels:%u samplerate:%u frames:%zu\n",
filename, info.channels, info.samplerate, frames);
SNDFILE *sf = sf_open(filename, SFM_WRITE, &info);
if (sf == NULL) {
diff --git a/services/audioflinger/tests/test_utils.h b/services/audioflinger/tests/test_utils.h
index e446216..3d51cdc 100644
--- a/services/audioflinger/tests/test_utils.h
+++ b/services/audioflinger/tests/test_utils.h
@@ -120,7 +120,7 @@ public:
}
if (!mInputIncr.empty()) {
size_t provided = mInputIncr[mNextIdx++];
- ALOGV("getNextBuffer() mValue[%d]=%u not %u",
+ ALOGV("getNextBuffer() mValue[%zu]=%zu not %zu",
mNextIdx-1, provided, buffer->frameCount);
if (provided < buffer->frameCount) {
buffer->frameCount = provided;
@@ -129,8 +129,8 @@ public:
mNextIdx = 0;
}
}
- ALOGV("getNextBuffer() requested %u frames out of %u frames available"
- " and returned %u frames\n",
+ ALOGV("getNextBuffer() requested %zu frames out of %zu frames available"
+ " and returned %zu frames",
requestedFrames, mNumFrames - mNextFrame, buffer->frameCount);
mUnrel = buffer->frameCount;
if (buffer->frameCount > 0) {
@@ -145,14 +145,14 @@ public:
virtual void releaseBuffer(Buffer* buffer)
{
if (buffer->frameCount > mUnrel) {
- ALOGE("releaseBuffer() released %u frames but only %u available "
- "to release\n", buffer->frameCount, mUnrel);
+ ALOGE("releaseBuffer() released %zu frames but only %zu available "
+ "to release", buffer->frameCount, mUnrel);
mNextFrame += mUnrel;
mUnrel = 0;
} else {
- ALOGV("releaseBuffer() released %u frames out of %u frames available "
- "to release\n", buffer->frameCount, mUnrel);
+ ALOGV("releaseBuffer() released %zu frames out of %zu frames available "
+ "to release", buffer->frameCount, mUnrel);
mNextFrame += buffer->frameCount;
mUnrel -= buffer->frameCount;
}