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;
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));
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);
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,
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 */
}
}
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) {
}
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;
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) {
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;
}