aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c8
-rw-r--r--Alc/ALu.c2
-rw-r--r--Alc/backends/solaris.c6
-rw-r--r--Alc/mixer.c66
-rw-r--r--Alc/panning.c28
5 files changed, 55 insertions, 55 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 0b558ff7..80378d91 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1310,8 +1310,8 @@ const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans)
return "(unknown channels)";
}
-extern inline ALuint FrameSizeFromDevFmt(enum DevFmtChannels chans, enum DevFmtType type);
-ALuint BytesFromDevFmt(enum DevFmtType type)
+extern inline ALsizei FrameSizeFromDevFmt(enum DevFmtChannels chans, enum DevFmtType type);
+ALsizei BytesFromDevFmt(enum DevFmtType type)
{
switch(type)
{
@@ -1325,7 +1325,7 @@ ALuint BytesFromDevFmt(enum DevFmtType type)
}
return 0;
}
-ALuint ChannelsFromDevFmt(enum DevFmtChannels chans)
+ALsizei ChannelsFromDevFmt(enum DevFmtChannels chans)
{
switch(chans)
{
@@ -2093,7 +2093,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
device->FOAOut.Buffer = device->Dry.Buffer;
device->FOAOut.NumChannels = device->Dry.NumChannels;
}
- TRACE("Channel config, Dry: %u, FOA: %u, Real: %u\n", device->Dry.NumChannels,
+ TRACE("Channel config, Dry: %d, FOA: %d, Real: %d\n", device->Dry.NumChannels,
device->FOAOut.NumChannels, device->RealOut.NumChannels);
SetMixerFPUMode(&oldMode);
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 02b4ffe8..9b03b85a 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1400,7 +1400,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
ALsource *source;
ALCcontext *ctx;
FPUCtl oldMode;
- ALuint i, c;
+ ALsizei i, c;
SetMixerFPUMode(&oldMode);
diff --git a/Alc/backends/solaris.c b/Alc/backends/solaris.c
index 01472e6a..792f717a 100644
--- a/Alc/backends/solaris.c
+++ b/Alc/backends/solaris.c
@@ -177,8 +177,8 @@ static ALCboolean ALCsolarisBackend_reset(ALCsolarisBackend *self)
{
ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice;
audio_info_t info;
- ALuint frameSize;
- int numChannels;
+ ALsizei frameSize;
+ ALsizei numChannels;
AUDIO_INITINFO(&info);
@@ -220,7 +220,7 @@ static ALCboolean ALCsolarisBackend_reset(ALCsolarisBackend *self)
return ALC_FALSE;
}
- if(ChannelsFromDevFmt(device->FmtChans) != info.play.channels)
+ if(ChannelsFromDevFmt(device->FmtChans) != (ALsizei)info.play.channels)
{
ERR("Could not set %d channels, got %d instead\n", ChannelsFromDevFmt(device->FmtChans), info.play.channels);
return ALC_FALSE;
diff --git a/Alc/mixer.c b/Alc/mixer.c
index 2d804b1f..58192055 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -307,9 +307,9 @@ static inline ALfloat Sample_ALfloat(ALfloat val)
{ return val; }
#define DECL_TEMPLATE(T) \
-static inline void Load_##T(ALfloat *dst, const T *src, ALuint srcstep, ALuint samples)\
+static inline void Load_##T(ALfloat *dst, const T *src, ALint srcstep, ALsizei samples)\
{ \
- ALuint i; \
+ ALsizei i; \
for(i = 0;i < samples;i++) \
dst[i] = Sample_##T(src[i*srcstep]); \
}
@@ -320,7 +320,7 @@ DECL_TEMPLATE(ALfloat)
#undef DECL_TEMPLATE
-static void LoadSamples(ALfloat *dst, const ALvoid *src, ALuint srcstep, enum FmtType srctype, ALuint samples)
+static void LoadSamples(ALfloat *dst, const ALvoid *src, ALint srcstep, enum FmtType srctype, ALsizei samples)
{
switch(srctype)
{
@@ -336,9 +336,9 @@ static void LoadSamples(ALfloat *dst, const ALvoid *src, ALuint srcstep, enum Fm
}
}
-static inline void SilenceSamples(ALfloat *dst, ALuint samples)
+static inline void SilenceSamples(ALfloat *dst, ALsizei samples)
{
- ALuint i;
+ ALsizei i;
for(i = 0;i < samples;i++)
dst[i] = 0.0f;
}
@@ -346,9 +346,9 @@ static inline void SilenceSamples(ALfloat *dst, ALuint samples)
static const ALfloat *DoFilters(ALfilterState *lpfilter, ALfilterState *hpfilter,
ALfloat *restrict dst, const ALfloat *restrict src,
- ALuint numsamples, enum ActiveFilters type)
+ ALsizei numsamples, enum ActiveFilters type)
{
- ALuint i;
+ ALsizei i;
switch(type)
{
case AF_None:
@@ -369,7 +369,7 @@ static const ALfloat *DoFilters(ALfilterState *lpfilter, ALfilterState *hpfilter
for(i = 0;i < numsamples;)
{
ALfloat temp[256];
- ALuint todo = minu(256, numsamples-i);
+ ALsizei todo = mini(256, numsamples-i);
ALfilterState_process(lpfilter, temp, src+i, todo);
ALfilterState_process(hpfilter, dst+i, temp, todo);
@@ -381,21 +381,22 @@ static const ALfloat *DoFilters(ALfilterState *lpfilter, ALfilterState *hpfilter
}
-ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
+ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei SamplesToDo)
{
ResamplerFunc Resample;
ALbufferlistitem *BufferListItem;
ALuint DataPosInt, DataPosFrac;
ALboolean Looping;
- ALuint increment;
+ ALint increment;
ALenum State;
- ALuint OutPos;
- ALuint NumChannels;
- ALuint SampleSize;
+ ALsizei OutPos;
+ ALsizei NumChannels;
+ ALsizei SampleSize;
ALint64 DataSize64;
- ALuint Counter;
- ALuint IrSize;
- ALuint chan, send, j;
+ ALsizei Counter;
+ ALsizei IrSize;
+ ALsizei chan, j;
+ ALuint send;
/* Get source info */
State = AL_PLAYING; /* Only called while playing. */
@@ -415,7 +416,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
Counter = voice->Moving ? SamplesToDo : 0;
OutPos = 0;
do {
- ALuint SrcBufferSize, DstBufferSize;
+ ALsizei SrcBufferSize, DstBufferSize;
/* Figure out how many buffer samples will be needed */
DataSize64 = SamplesToDo-OutPos;
@@ -424,7 +425,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
DataSize64 >>= FRACTIONBITS;
DataSize64 += MAX_POST_SAMPLES+MAX_PRE_SAMPLES;
- SrcBufferSize = (ALuint)mini64(DataSize64, BUFFERSIZE);
+ SrcBufferSize = (ALsizei)mini64(DataSize64, BUFFERSIZE);
/* Figure out how many samples we can actually mix from this. */
DataSize64 = SrcBufferSize;
@@ -432,8 +433,8 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
DataSize64 <<= FRACTIONBITS;
DataSize64 -= DataPosFrac;
- DstBufferSize = (ALuint)((DataSize64+(increment-1)) / increment);
- DstBufferSize = minu(DstBufferSize, (SamplesToDo-OutPos));
+ DstBufferSize = (ALsizei)((DataSize64+(increment-1)) / increment);
+ DstBufferSize = mini(DstBufferSize, (SamplesToDo-OutPos));
/* Some mixers like having a multiple of 4, so try to give that unless
* this is the last update. */
@@ -444,7 +445,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
{
const ALfloat *ResampledData;
ALfloat *SrcData = Device->SourceData;
- ALuint SrcDataSize;
+ ALsizei SrcDataSize;
/* Load the previous samples into the source data first. */
memcpy(SrcData, voice->PrevSamples[chan], MAX_PRE_SAMPLES*sizeof(ALfloat));
@@ -454,7 +455,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
{
const ALbuffer *ALBuffer = BufferListItem->buffer;
const ALubyte *Data = ALBuffer->data;
- ALuint DataSize;
+ ALsizei DataSize;
/* Offset buffer data to current channel */
Data += chan*SampleSize;
@@ -478,13 +479,12 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
}
else
{
- ALuint LoopStart = ALBuffer->LoopStart;
- ALuint LoopEnd = ALBuffer->LoopEnd;
+ ALsizei LoopStart = ALBuffer->LoopStart;
+ ALsizei LoopEnd = ALBuffer->LoopEnd;
/* Load what's left of this loop iteration, then load
* repeats of the loop section */
- DataSize = LoopEnd - DataPosInt;
- DataSize = minu(SrcBufferSize - SrcDataSize, DataSize);
+ DataSize = minu(SrcBufferSize - SrcDataSize, LoopEnd - DataPosInt);
LoadSamples(&SrcData[SrcDataSize], &Data[DataPosInt * NumChannels*SampleSize],
NumChannels, ALBuffer->FmtType, DataSize);
@@ -493,7 +493,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
DataSize = LoopEnd-LoopStart;
while(SrcBufferSize > SrcDataSize)
{
- DataSize = minu(SrcBufferSize - SrcDataSize, DataSize);
+ DataSize = mini(SrcBufferSize - SrcDataSize, DataSize);
LoadSamples(&SrcData[SrcDataSize], &Data[LoopStart * NumChannels*SampleSize],
NumChannels, ALBuffer->FmtType, DataSize);
@@ -645,22 +645,22 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
OutPos += DstBufferSize;
voice->Offset += DstBufferSize;
- Counter = maxu(DstBufferSize, Counter) - DstBufferSize;
+ Counter = maxi(DstBufferSize, Counter) - DstBufferSize;
/* Handle looping sources */
while(1)
{
const ALbuffer *ALBuffer;
- ALuint DataSize = 0;
- ALuint LoopStart = 0;
- ALuint LoopEnd = 0;
+ ALsizei DataSize = 0;
+ ALsizei LoopStart = 0;
+ ALsizei LoopEnd = 0;
if((ALBuffer=BufferListItem->buffer) != NULL)
{
DataSize = ALBuffer->SampleLen;
LoopStart = ALBuffer->LoopStart;
LoopEnd = ALBuffer->LoopEnd;
- if(LoopEnd > DataPosInt)
+ if((ALuint)LoopEnd > DataPosInt)
break;
}
@@ -671,7 +671,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
break;
}
- if(DataSize > DataPosInt)
+ if((ALuint)DataSize > DataPosInt)
break;
if(!(BufferListItem=BufferListItem->next))
diff --git a/Alc/panning.c b/Alc/panning.c
index e1ad6d0b..a0576e0d 100644
--- a/Alc/panning.c
+++ b/Alc/panning.c
@@ -209,9 +209,9 @@ void CalcAngleCoeffs(ALfloat azimuth, ALfloat elevation, ALfloat spread, ALfloat
}
-void ComputeAmbientGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
+void ComputeAmbientGainsMC(const ChannelConfig *chancoeffs, ALsizei numchans, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
{
- ALuint i;
+ ALsizei i;
for(i = 0;i < numchans;i++)
{
@@ -224,10 +224,10 @@ void ComputeAmbientGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, ALf
gains[i] = 0.0f;
}
-void ComputeAmbientGainsBF(const BFChannelConfig *chanmap, ALuint numchans, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
+void ComputeAmbientGainsBF(const BFChannelConfig *chanmap, ALsizei numchans, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
{
ALfloat gain = 0.0f;
- ALuint i;
+ ALsizei i;
for(i = 0;i < numchans;i++)
{
@@ -239,9 +239,9 @@ void ComputeAmbientGainsBF(const BFChannelConfig *chanmap, ALuint numchans, ALfl
gains[i] = 0.0f;
}
-void ComputePanningGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, ALuint numcoeffs, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
+void ComputePanningGainsMC(const ChannelConfig *chancoeffs, ALsizei numchans, ALsizei numcoeffs, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
{
- ALuint i, j;
+ ALsizei i, j;
for(i = 0;i < numchans;i++)
{
@@ -254,9 +254,9 @@ void ComputePanningGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, ALu
gains[i] = 0.0f;
}
-void ComputePanningGainsBF(const BFChannelConfig *chanmap, ALuint numchans, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
+void ComputePanningGainsBF(const BFChannelConfig *chanmap, ALsizei numchans, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
{
- ALuint i;
+ ALsizei i;
for(i = 0;i < numchans;i++)
gains[i] = chanmap[i].Scale * coeffs[chanmap[i].Index] * ingain;
@@ -264,9 +264,9 @@ void ComputePanningGainsBF(const BFChannelConfig *chanmap, ALuint numchans, cons
gains[i] = 0.0f;
}
-void ComputeFirstOrderGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
+void ComputeFirstOrderGainsMC(const ChannelConfig *chancoeffs, ALsizei numchans, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
{
- ALuint i, j;
+ ALsizei i, j;
for(i = 0;i < numchans;i++)
{
@@ -279,9 +279,9 @@ void ComputeFirstOrderGainsMC(const ChannelConfig *chancoeffs, ALuint numchans,
gains[i] = 0.0f;
}
-void ComputeFirstOrderGainsBF(const BFChannelConfig *chanmap, ALuint numchans, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
+void ComputeFirstOrderGainsBF(const BFChannelConfig *chanmap, ALsizei numchans, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
{
- ALuint i;
+ ALsizei i;
for(i = 0;i < numchans;i++)
gains[i] = chanmap[i].Scale * mtx[chanmap[i].Index] * ingain;
@@ -342,13 +342,13 @@ typedef struct ChannelMap {
} ChannelMap;
static void SetChannelMap(const enum Channel *devchans, ChannelConfig *ambicoeffs,
- const ChannelMap *chanmap, size_t count, ALuint *outcount,
+ const ChannelMap *chanmap, size_t count, ALsizei *outcount,
ALboolean isfuma)
{
const ALsizei *acnmap = isfuma ? FuMa2ACN : ACN2ACN;
const ALfloat *n3dscale = isfuma ? FuMa2N3DScale : UnitScale;
size_t j, k;
- ALuint i;
+ ALsizei i;
for(i = 0;i < MAX_OUTPUT_CHANNELS && devchans[i] != InvalidChannel;i++)
{