aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/backends')
-rw-r--r--Alc/backends/alsa.cpp16
-rw-r--r--Alc/backends/portaudio.cpp2
-rw-r--r--Alc/backends/pulseaudio.cpp6
3 files changed, 12 insertions, 12 deletions
diff --git a/Alc/backends/alsa.cpp b/Alc/backends/alsa.cpp
index 33b3ae49..5fe8ef96 100644
--- a/Alc/backends/alsa.cpp
+++ b/Alc/backends/alsa.cpp
@@ -480,7 +480,7 @@ int AlsaPlayback::mixerProc()
continue;
}
- if((snd_pcm_uframes_t)avail > update_size*(num_updates+1))
+ if(static_cast<snd_pcm_uframes_t>(avail) > update_size*(num_updates+1))
{
WARN("available samples exceeds the buffer size\n");
snd_pcm_reset(mPcmHandle);
@@ -488,7 +488,7 @@ int AlsaPlayback::mixerProc()
}
// make sure there's frames to process
- if((snd_pcm_uframes_t)avail < update_size)
+ if(static_cast<snd_pcm_uframes_t>(avail) < update_size)
{
if(state != SND_PCM_STATE_RUNNING)
{
@@ -520,7 +520,7 @@ int AlsaPlayback::mixerProc()
break;
}
- char *WritePtr{(char*)areas->addr + (offset * areas->step / 8)};
+ char *WritePtr{static_cast<char*>(areas->addr) + (offset * areas->step / 8)};
aluMixData(mDevice, WritePtr, frames);
snd_pcm_sframes_t commitres{snd_pcm_mmap_commit(mPcmHandle, offset, frames)};
@@ -563,14 +563,14 @@ int AlsaPlayback::mixerNoMMapProc()
continue;
}
- if((snd_pcm_uframes_t)avail > update_size*num_updates)
+ if(static_cast<snd_pcm_uframes_t>(avail) > update_size*num_updates)
{
WARN("available samples exceeds the buffer size\n");
snd_pcm_reset(mPcmHandle);
continue;
}
- if((snd_pcm_uframes_t)avail < update_size)
+ if(static_cast<snd_pcm_uframes_t>(avail) < update_size)
{
if(state != SND_PCM_STATE_RUNNING)
{
@@ -1112,7 +1112,7 @@ ALCenum AlsaCapture::captureSamples(ALCvoid *buffer, ALCuint samples)
{
/* First get any data stored from the last stop */
amt = snd_pcm_bytes_to_frames(mPcmHandle, mBuffer.size());
- if((snd_pcm_uframes_t)amt > samples) amt = samples;
+ if(static_cast<snd_pcm_uframes_t>(amt) > samples) amt = samples;
amt = snd_pcm_frames_to_bytes(mPcmHandle, amt);
memcpy(buffer, mBuffer.data(), amt);
@@ -1142,12 +1142,12 @@ ALCenum AlsaCapture::captureSamples(ALCvoid *buffer, ALCuint samples)
}
/* If the amount available is less than what's asked, we lost it
* during recovery. So just give silence instead. */
- if((snd_pcm_uframes_t)amt < samples)
+ if(static_cast<snd_pcm_uframes_t>(amt) < samples)
break;
continue;
}
- buffer = (ALbyte*)buffer + amt;
+ buffer = static_cast<ALbyte*>(buffer) + amt;
samples -= amt;
}
if(samples > 0)
diff --git a/Alc/backends/portaudio.cpp b/Alc/backends/portaudio.cpp
index 258f981e..074508b2 100644
--- a/Alc/backends/portaudio.cpp
+++ b/Alc/backends/portaudio.cpp
@@ -194,7 +194,7 @@ ALCenum PortPlayback::open(const ALCchar *name)
if(!ConfigValueInt(nullptr, "port", "device", &mParams.device) || mParams.device < 0)
mParams.device = Pa_GetDefaultOutputDevice();
mParams.suggestedLatency = (mDevice->UpdateSize*mDevice->NumUpdates) /
- (float)mDevice->Frequency;
+ static_cast<float>(mDevice->Frequency);
mParams.hostApiSpecificStreamInfo = nullptr;
mParams.channelCount = ((mDevice->FmtChans == DevFmtMono) ? 1 : 2);
diff --git a/Alc/backends/pulseaudio.cpp b/Alc/backends/pulseaudio.cpp
index 34c5fbfe..b717d67a 100644
--- a/Alc/backends/pulseaudio.cpp
+++ b/Alc/backends/pulseaudio.cpp
@@ -1131,7 +1131,7 @@ ALCboolean PulsePlayback::reset()
/* Server updated our playback rate, so modify the buffer attribs
* accordingly. */
mDevice->NumUpdates = static_cast<ALuint>(clampd(
- (ALdouble)mSpec.rate/mDevice->Frequency*mDevice->NumUpdates + 0.5, 2.0, 16.0));
+ static_cast<ALdouble>(mSpec.rate)/mDevice->Frequency*mDevice->NumUpdates + 0.5, 2.0, 16.0));
period_size = mDevice->UpdateSize * mFrameSize;
mAttr.maxlength = -1;
@@ -1511,10 +1511,10 @@ ALCenum PulseCapture::captureSamples(ALCvoid *buffer, ALCuint samples)
memcpy(buffer, mCapStore, rem);
- buffer = (ALbyte*)buffer + rem;
+ buffer = static_cast<ALbyte*>(buffer) + rem;
todo -= rem;
- mCapStore = (ALbyte*)mCapStore + rem;
+ mCapStore = reinterpret_cast<const ALbyte*>(mCapStore) + rem;
mCapRemain -= rem;
if(mCapRemain == 0)
{