aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/backends/coreaudio.cpp6
-rw-r--r--Alc/backends/null.cpp4
-rw-r--r--Alc/backends/wasapi.cpp2
-rw-r--r--Alc/backends/wave.cpp4
-rw-r--r--Alc/backends/winmm.cpp4
-rw-r--r--Alc/converter.cpp4
-rw-r--r--Alc/effects/pshifter.cpp14
-rw-r--r--Alc/mixvoice.cpp2
8 files changed, 20 insertions, 20 deletions
diff --git a/Alc/backends/coreaudio.cpp b/Alc/backends/coreaudio.cpp
index c5da9f24..432733f4 100644
--- a/Alc/backends/coreaudio.cpp
+++ b/Alc/backends/coreaudio.cpp
@@ -177,8 +177,8 @@ ALCboolean CoreAudioPlayback::reset()
if(mDevice->Frequency != streamFormat.mSampleRate)
{
- mDevice->NumUpdates = static_cast<ALuint>(
- (ALuint64)mDevice->NumUpdates*streamFormat.mSampleRate/mDevice->Frequency);
+ mDevice->NumUpdates = static_cast<ALuint>(uint64_t{mDevice->NumUpdates} *
+ streamFormat.mSampleRate / mDevice->Frequency);
mDevice->Frequency = streamFormat.mSampleRate;
}
@@ -594,7 +594,7 @@ ALCenum CoreAudioCapture::open(const ALCchar *name)
}
// Set the AudioUnit output format frame count
- ALuint64 FrameCount64{mDevice->UpdateSize};
+ uint64_t FrameCount64{mDevice->UpdateSize};
FrameCount64 = (FrameCount64*outputFormat.mSampleRate + mDevice->Frequency-1) /
mDevice->Frequency;
FrameCount64 += MAX_RESAMPLE_PADDING*2;
diff --git a/Alc/backends/null.cpp b/Alc/backends/null.cpp
index 38ac0154..8bd84656 100644
--- a/Alc/backends/null.cpp
+++ b/Alc/backends/null.cpp
@@ -69,7 +69,7 @@ int NullBackend::mixerProc()
SetRTPriority();
althrd_setname(MIXER_THREAD_NAME);
- ALint64 done{0};
+ int64_t done{0};
auto start = std::chrono::steady_clock::now();
while(!mKillNow.load(std::memory_order_acquire) &&
mDevice->Connected.load(std::memory_order_acquire))
@@ -77,7 +77,7 @@ int NullBackend::mixerProc()
auto now = std::chrono::steady_clock::now();
/* This converts from nanoseconds to nanosamples, then to samples. */
- ALint64 avail{std::chrono::duration_cast<seconds>((now-start) * mDevice->Frequency).count()};
+ int64_t avail{std::chrono::duration_cast<seconds>((now-start) * mDevice->Frequency).count()};
if(avail-done < mDevice->UpdateSize)
{
std::this_thread::sleep_for(restTime);
diff --git a/Alc/backends/wasapi.cpp b/Alc/backends/wasapi.cpp
index 8904ca3a..ba26b70c 100644
--- a/Alc/backends/wasapi.cpp
+++ b/Alc/backends/wasapi.cpp
@@ -87,7 +87,7 @@ namespace {
/* Scales the given value using 64-bit integer math, ceiling the result. */
-inline ALint64 ScaleCeil(ALint64 val, ALint64 new_scale, ALint64 old_scale)
+inline int64_t ScaleCeil(int64_t val, int64_t new_scale, int64_t old_scale)
{
return (val*new_scale + old_scale-1) / old_scale;
}
diff --git a/Alc/backends/wave.cpp b/Alc/backends/wave.cpp
index aa1aab1f..cd6c6d5c 100644
--- a/Alc/backends/wave.cpp
+++ b/Alc/backends/wave.cpp
@@ -117,7 +117,7 @@ int WaveBackend::mixerProc()
const ALsizei frameSize{mDevice->frameSizeFromFmt()};
- ALint64 done{0};
+ int64_t done{0};
auto start = std::chrono::steady_clock::now();
while(!mKillNow.load(std::memory_order_acquire) &&
mDevice->Connected.load(std::memory_order_acquire))
@@ -125,7 +125,7 @@ int WaveBackend::mixerProc()
auto now = std::chrono::steady_clock::now();
/* This converts from nanoseconds to nanosamples, then to samples. */
- ALint64 avail{std::chrono::duration_cast<seconds>((now-start) *
+ int64_t avail{std::chrono::duration_cast<seconds>((now-start) *
mDevice->Frequency).count()};
if(avail-done < mDevice->UpdateSize)
{
diff --git a/Alc/backends/winmm.cpp b/Alc/backends/winmm.cpp
index 34eade29..89f0e866 100644
--- a/Alc/backends/winmm.cpp
+++ b/Alc/backends/winmm.cpp
@@ -265,8 +265,8 @@ retry_open:
ALCboolean WinMMPlayback::reset()
{
- mDevice->UpdateSize = static_cast<ALuint>(
- (ALuint64)mDevice->UpdateSize * mFormat.nSamplesPerSec / mDevice->Frequency);
+ mDevice->UpdateSize = static_cast<ALuint>(uint64_t{mDevice->UpdateSize} *
+ mFormat.nSamplesPerSec / mDevice->Frequency);
mDevice->UpdateSize = (mDevice->UpdateSize*mDevice->NumUpdates + 3) / 4;
mDevice->NumUpdates = 4;
mDevice->Frequency = mFormat.nSamplesPerSec;
diff --git a/Alc/converter.cpp b/Alc/converter.cpp
index 9ec97e23..884a98da 100644
--- a/Alc/converter.cpp
+++ b/Alc/converter.cpp
@@ -195,7 +195,7 @@ ALsizei SampleConverter::availableOut(ALsizei srcframes) const
return 0;
}
- auto DataSize64 = static_cast<ALuint64>(prepcount);
+ auto DataSize64 = static_cast<uint64_t>(prepcount);
DataSize64 += srcframes;
DataSize64 -= MAX_RESAMPLE_PADDING*2;
DataSize64 <<= FRACTIONBITS;
@@ -252,7 +252,7 @@ ALsizei SampleConverter::convert(const ALvoid **src, ALsizei *srcframes, ALvoid
ALfloat *RESTRICT SrcData{mSrcSamples};
ALfloat *RESTRICT DstData{mDstSamples};
ALsizei DataPosFrac{mFracOffset};
- auto DataSize64 = static_cast<ALuint64>(prepcount);
+ auto DataSize64 = static_cast<uint64_t>(prepcount);
DataSize64 += toread;
DataSize64 -= MAX_RESAMPLE_PADDING*2;
DataSize64 <<= FRACTIONBITS;
diff --git a/Alc/effects/pshifter.cpp b/Alc/effects/pshifter.cpp
index 7bd7ada0..9fe5f867 100644
--- a/Alc/effects/pshifter.cpp
+++ b/Alc/effects/pshifter.cpp
@@ -50,11 +50,11 @@ inline int double2int(double d)
{
#if ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) && \
!defined(__SSE2_MATH__)) || (defined(_MSC_VER) && defined(_M_IX86_FP) && _M_IX86_FP < 2)
- ALint sign, shift;
- ALint64 mant;
+ int sign, shift;
+ int64_t mant;
union {
- ALdouble d;
- ALint64 i64;
+ double d;
+ int64_t i64;
} conv;
conv.d = d;
@@ -67,12 +67,12 @@ inline int double2int(double d)
mant = (conv.i64&0xfffffffffffff_i64) | 0x10000000000000_i64;
if(LIKELY(shift < 0))
- return (ALint)(mant >> -shift) * sign;
- return (ALint)(mant << shift) * sign;
+ return (int)(mant >> -shift) * sign;
+ return (int)(mant << shift) * sign;
#else
- return static_cast<ALint>(d);
+ return static_cast<int>(d);
#endif
}
diff --git a/Alc/mixvoice.cpp b/Alc/mixvoice.cpp
index 6fecb830..a0518ed5 100644
--- a/Alc/mixvoice.cpp
+++ b/Alc/mixvoice.cpp
@@ -367,7 +367,7 @@ ALboolean MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context,
ALsizei DstBufferSize{SamplesToDo - OutPos};
/* Calculate the last written dst sample pos. */
- ALint64 DataSize64{DstBufferSize - 1};
+ int64_t DataSize64{DstBufferSize - 1};
/* Calculate the last read src sample pos. */
DataSize64 = (DataSize64*increment + DataPosFrac) >> FRACTIONBITS;
/* +1 to get the src sample count, include padding. */