aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/backends/dsound.c2
-rw-r--r--Alc/backends/winmm.c2
-rw-r--r--Alc/bformatdec.c8
-rw-r--r--Alc/effects/chorus.c3
-rw-r--r--Alc/hrtf.c3
-rw-r--r--Alc/panning.c2
-rw-r--r--common/atomic.h3
7 files changed, 13 insertions, 10 deletions
diff --git a/Alc/backends/dsound.c b/Alc/backends/dsound.c
index f88a50c1..8a0a30cb 100644
--- a/Alc/backends/dsound.c
+++ b/Alc/backends/dsound.c
@@ -948,7 +948,7 @@ static ALCuint ALCdsoundCapture_availableSamples(ALCdsoundCapture *self)
}
done:
- return ll_ringbuffer_read_space(self->Ring);
+ return (ALCuint)ll_ringbuffer_read_space(self->Ring);
}
diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c
index 4e4d0c06..0fcab458 100644
--- a/Alc/backends/winmm.c
+++ b/Alc/backends/winmm.c
@@ -708,7 +708,7 @@ static ALCenum ALCwinmmCapture_captureSamples(ALCwinmmCapture *self, ALCvoid *bu
static ALCuint ALCwinmmCapture_availableSamples(ALCwinmmCapture *self)
{
- return ll_ringbuffer_read_space(self->Ring);
+ return (ALCuint)ll_ringbuffer_read_space(self->Ring);
}
diff --git a/Alc/bformatdec.c b/Alc/bformatdec.c
index 3efdfba9..6503ac65 100644
--- a/Alc/bformatdec.c
+++ b/Alc/bformatdec.c
@@ -532,7 +532,7 @@ void ambiup_free(struct AmbiUpsampler *ambiup)
void ambiup_reset(struct AmbiUpsampler *ambiup, const ALCdevice *device)
{
ALfloat ratio;
- size_t i;
+ ALsizei i;
ratio = 400.0f / (ALfloat)device->Frequency;
for(i = 0;i < 4;i++)
@@ -545,11 +545,11 @@ void ambiup_reset(struct AmbiUpsampler *ambiup, const ALCdevice *device)
ALsizei j;
size_t k;
- for(i = 0;i < COUNTOF(Ambi3DPoints);i++)
+ for(k = 0;k < COUNTOF(Ambi3DPoints);k++)
{
ALfloat coeffs[MAX_AMBI_COEFFS] = { 0.0f };
- CalcDirectionCoeffs(Ambi3DPoints[i], 0.0f, coeffs);
- ComputeDryPanGains(&device->Dry, coeffs, 1.0f, encgains[i]);
+ CalcDirectionCoeffs(Ambi3DPoints[k], 0.0f, coeffs);
+ ComputeDryPanGains(&device->Dry, coeffs, 1.0f, encgains[k]);
}
/* Combine the matrices that do the in->virt and virt->out conversions
diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c
index 901c1157..2592c673 100644
--- a/Alc/effects/chorus.c
+++ b/Alc/effects/chorus.c
@@ -142,7 +142,8 @@ static ALvoid ALchorusState_update(ALchorusState *state, const ALCcontext *Conte
*/
state->delay = maxi(fastf2i(props->Chorus.Delay*frequency*FRACTIONONE + 0.5f),
mindelay);
- state->depth = minf(props->Chorus.Depth * state->delay, state->delay - mindelay);
+ state->depth = minf(props->Chorus.Depth * state->delay,
+ (ALfloat)(state->delay - mindelay));
state->feedback = props->Chorus.Feedback;
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index 9d5e2ca9..310dc68c 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -298,7 +298,8 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei N
}
}
/* Round up to the next IR size multiple. */
- max_length = RoundUp(max_length, MOD_IR_SIZE);
+ max_length += MOD_IR_SIZE-1;
+ max_length -= max_length%MOD_IR_SIZE;
TRACE("Skipped min delay: %d, new combined length: %d\n", min_delay, max_length);
state->IrSize = max_length;
diff --git a/Alc/panning.c b/Alc/panning.c
index dfb71918..1691aacd 100644
--- a/Alc/panning.c
+++ b/Alc/panning.c
@@ -512,7 +512,7 @@ static void InitDistanceComp(ALCdevice *device, const AmbDecConf *conf, const AL
{
const char *devname = alstr_get_cstr(device->DeviceName);
ALfloat maxdist = 0.0f;
- ALsizei total = 0;
+ size_t total = 0;
ALsizei i;
for(i = 0;i < conf->NumSpeakers;i++)
diff --git a/common/atomic.h b/common/atomic.h
index 2033476b..64b06cce 100644
--- a/common/atomic.h
+++ b/common/atomic.h
@@ -306,6 +306,7 @@ enum almemory_order {
} while(0)
int _al_invalid_atomic_size(); /* not defined */
+void *_al_invalid_atomic_ptr_size(); /* not defined */
#define ATOMIC_ADD(_val, _incr, _MO) \
((sizeof((_val)->value)==4) ? WRAP_ADDSUB(LONG, AtomicAdd32, &(_val)->value, (_incr)) : \
@@ -327,7 +328,7 @@ int _al_invalid_atomic_size(); /* not defined */
#define ATOMIC_EXCHANGE_PTR(_val, _newval, _MO) \
((sizeof((_val)->value)==sizeof(void*)) ? AtomicSwapPtr((void*volatile*)&(_val)->value, (_newval)) : \
- (void*)_al_invalid_atomic_size())
+ _al_invalid_atomic_ptr_size())
#define ATOMIC_COMPARE_EXCHANGE_PTR_STRONG(_val, _oldval, _newval, _MO1, _MO2)\
((sizeof((_val)->value)==sizeof(void*)) ? CompareAndSwapPtr((void*volatile*)&(_val)->value, (_newval), (void**)(_oldval)) : \
(bool)_al_invalid_atomic_size())