Fix sign compare issues

presentation
Ulrich Huber 7 years ago
parent 288a1faf1e
commit 13928ae7d4
  1. 2
      src/util/audio/AudioQueue.h
  2. 4
      src/util/audio/PortAudioConsumer.cpp
  3. 2
      src/util/audio/VorbisConsumer.cpp

@ -62,7 +62,7 @@ public:
{
XOJ_CHECK_TYPE(AudioQueue);
for (long i = 0; i < nSamples; i++)
for (unsigned long i = 0; i < nSamples; i++)
{
this->push_front(samples[i]);
}

@ -78,7 +78,7 @@ void PortAudioConsumer::startPlaying(double sampleRate, unsigned int channels)
return;
}
if (device->maxOutputChannels() < channels)
if ((unsigned int) device->maxOutputChannels() < channels)
{
this->audioQueue->signalEndOfStream();
g_warning("Output device has not enough channels to play audio file. (Requires at least 2 channels)");
@ -129,7 +129,7 @@ int PortAudioConsumer::playCallback(const void* inputBuffer, void* outputBuffer,
// Fill buffer to requested length if necessary
if (outputBufferLength < framesPerBuffer * this->outputChannels)
if ((unsigned int) outputBufferLength < framesPerBuffer * this->outputChannels)
{
g_warning("PortAudioConsumer: Frame underflow");

@ -51,7 +51,7 @@ bool VorbisConsumer::start(string filename, unsigned int inputChannels)
// apply gain
if (audioGain != 1.0)
{
for (int i = 0; i < 64 * inputChannels; ++i)
for (unsigned int i = 0; i < 64 * inputChannels; ++i)
{
// check for overflow
if (std::abs(buffer[i]) < std::floor(INT_MAX / audioGain))

Loading…
Cancel
Save