Fix up some types for MSVC

This commit is contained in:
Chris Robinson
2018-01-11 10:55:35 -08:00
parent e89c183231
commit 2873abcbc0
7 changed files with 13 additions and 10 deletions
+1 -1
View File
@@ -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);
}
+1 -1
View File
@@ -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);
}
+4 -4
View File
@@ -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
+2 -1
View File
@@ -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;
+2 -1
View File
@@ -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;
+1 -1
View File
@@ -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++)
+2 -1
View File
@@ -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())