aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alMain.h6
-rw-r--r--OpenAL32/Include/alMidi.h6
-rw-r--r--OpenAL32/alAuxEffectSlot.c4
-rw-r--r--OpenAL32/alBuffer.c6
-rw-r--r--OpenAL32/alFontsound.c12
-rw-r--r--OpenAL32/alPreset.c10
-rw-r--r--OpenAL32/alSoundfont.c14
-rw-r--r--OpenAL32/alSource.c6
8 files changed, 32 insertions, 32 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index a95abd44..2f1eb850 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -610,7 +610,7 @@ enum DeviceType {
struct ALCdevice_struct
{
- volatile RefCount ref;
+ RefCount ref;
ALCboolean Connected;
enum DeviceType Type;
@@ -689,7 +689,7 @@ struct ALCdevice_struct
* the end, so the bottom bit indicates if the device is currently mixing
* and the upper bits indicates how many mixes have been done.
*/
- volatile RefCount MixCount;
+ RefCount MixCount;
/* Default effect slot */
struct ALeffectslot *DefaultSlot;
@@ -744,7 +744,7 @@ DECL_VECTOR(ALeffectslotPtr)
struct ALCcontext_struct
{
- volatile RefCount ref;
+ RefCount ref;
struct ALlistener *Listener;
diff --git a/OpenAL32/Include/alMidi.h b/OpenAL32/Include/alMidi.h
index 24e6675f..d18c165e 100644
--- a/OpenAL32/Include/alMidi.h
+++ b/OpenAL32/Include/alMidi.h
@@ -32,7 +32,7 @@ typedef struct ALenvelope {
typedef struct ALfontsound {
- volatile RefCount ref;
+ RefCount ref;
ALint MinKey, MaxKey;
ALint MinVelocity, MaxVelocity;
@@ -110,7 +110,7 @@ void ReleaseALFontsounds(ALCdevice *device);
typedef struct ALsfpreset {
- volatile RefCount ref;
+ RefCount ref;
ALint Preset; /* a.k.a. MIDI program number */
ALint Bank; /* MIDI bank 0...127, or percussion (bank 128) */
@@ -133,7 +133,7 @@ void ReleaseALPresets(ALCdevice *device);
typedef struct ALsoundfont {
- volatile RefCount ref;
+ RefCount ref;
ALsfpreset **Presets;
ALsizei NumPresets;
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index d4dabe0e..9f554cb0 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -122,7 +122,7 @@ AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *
{
if((slot=LookupEffectSlot(context, effectslots[i])) == NULL)
SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
- if(slot->ref != 0)
+ if(ReadRef(&slot->ref) != 0)
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
}
@@ -533,7 +533,7 @@ ALenum InitEffectSlot(ALeffectslot *slot)
for(i = 0;i < BUFFERSIZE;i++)
slot->WetBuffer[c][i] = 0.0f;
}
- slot->ref = 0;
+ InitRef(&slot->ref, 0);
return AL_NO_ERROR;
}
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 2d368987..12d57d61 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -115,7 +115,7 @@ AL_API ALvoid AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers)
/* Check for valid Buffer ID */
if((ALBuf=LookupBuffer(device, buffers[i])) == NULL)
SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
- if(ALBuf->ref != 0)
+ if(ReadRef(&ALBuf->ref) != 0)
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
}
@@ -695,7 +695,7 @@ AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *val
{
case AL_LOOP_POINTS_SOFT:
WriteLock(&albuf->lock);
- if(albuf->ref != 0)
+ if(ReadRef(&albuf->ref) != 0)
{
WriteUnlock(&albuf->lock);
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
@@ -980,7 +980,7 @@ static ALenum LoadData(ALbuffer *ALBuf, ALuint freq, ALenum NewFormat, ALsizei f
return AL_OUT_OF_MEMORY;
WriteLock(&ALBuf->lock);
- if(ALBuf->ref != 0)
+ if(ReadRef(&ALBuf->ref) != 0)
{
WriteUnlock(&ALBuf->lock);
return AL_INVALID_OPERATION;
diff --git a/OpenAL32/alFontsound.c b/OpenAL32/alFontsound.c
index 94cf3064..c4d49e92 100644
--- a/OpenAL32/alFontsound.c
+++ b/OpenAL32/alFontsound.c
@@ -69,7 +69,7 @@ AL_API ALvoid AL_APIENTRY alDeleteFontsoundsSOFT(ALsizei n, const ALuint *ids)
/* Check for valid ID */
if((inst=LookupFontsound(device, ids[i])) == NULL)
SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
- if(inst->ref != 0)
+ if(ReadRef(&inst->ref) != 0)
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
}
@@ -115,7 +115,7 @@ AL_API void AL_APIENTRY alFontsoundiSOFT(ALuint id, ALenum param, ALint value)
device = context->Device;
if(!(sound=LookupFontsound(device, id)))
SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
- if(sound->ref != 0)
+ if(ReadRef(&sound->ref) != 0)
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
ALfontsound_setPropi(sound, context, param, value);
@@ -136,7 +136,7 @@ AL_API void AL_APIENTRY alFontsound2iSOFT(ALuint id, ALenum param, ALint value1,
device = context->Device;
if(!(sound=LookupFontsound(device, id)))
SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
- if(sound->ref != 0)
+ if(ReadRef(&sound->ref) != 0)
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
switch(param)
{
@@ -231,7 +231,7 @@ AL_API void AL_APIENTRY alFontsoundivSOFT(ALuint id, ALenum param, const ALint *
device = context->Device;
if(!(sound=LookupFontsound(device, id)))
SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
- if(sound->ref != 0)
+ if(ReadRef(&sound->ref) != 0)
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
switch(param)
{
@@ -508,7 +508,7 @@ ALfontsound *NewFontsound(ALCcontext *context)
static void ALfontsound_Construct(ALfontsound *self)
{
- self->ref = 0;
+ InitRef(&self->ref, 0);
self->MinKey = 0;
self->MaxKey = 127;
@@ -829,7 +829,7 @@ void ALfontsound_setModStagei(ALfontsound *self, ALCcontext *context, ALsizei st
{
ALint srcidx = 0;
- if(self->ref != 0)
+ if(ReadRef(&self->ref) != 0)
SET_ERROR_AND_RETURN(context, AL_INVALID_OPERATION);
switch(param)
{
diff --git a/OpenAL32/alPreset.c b/OpenAL32/alPreset.c
index d34772a4..c7167d6b 100644
--- a/OpenAL32/alPreset.c
+++ b/OpenAL32/alPreset.c
@@ -65,7 +65,7 @@ AL_API ALvoid AL_APIENTRY alDeletePresetsSOFT(ALsizei n, const ALuint *ids)
/* Check for valid ID */
if((preset=LookupPreset(device, ids[i])) == NULL)
SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
- if(preset->ref != 0)
+ if(ReadRef(&preset->ref) != 0)
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
}
@@ -107,7 +107,7 @@ AL_API void AL_APIENTRY alPresetiSOFT(ALuint id, ALenum param, ALint value)
device = context->Device;
if((preset=LookupPreset(device, id)) == NULL)
SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
- if(preset->ref != 0)
+ if(ReadRef(&preset->ref) != 0)
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
switch(param)
{
@@ -151,7 +151,7 @@ AL_API void AL_APIENTRY alPresetivSOFT(ALuint id, ALenum param, const ALint *val
device = context->Device;
if((preset=LookupPreset(device, id)) == NULL)
SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
- if(preset->ref != 0)
+ if(ReadRef(&preset->ref) != 0)
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
switch(param)
{
@@ -220,7 +220,7 @@ AL_API void AL_APIENTRY alPresetFontsoundsSOFT(ALuint id, ALsizei count, const A
if(count < 0)
SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
- if(preset->ref != 0)
+ if(ReadRef(&preset->ref) != 0)
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
if(count == 0)
@@ -294,7 +294,7 @@ void DeletePreset(ALsfpreset *preset, ALCdevice *device)
static void ALsfpreset_Construct(ALsfpreset *self)
{
- self->ref = 0;
+ InitRef(&self->ref, 0);
self->Preset = 0;
self->Bank = 0;
diff --git a/OpenAL32/alSoundfont.c b/OpenAL32/alSoundfont.c
index 0952c412..357e13e7 100644
--- a/OpenAL32/alSoundfont.c
+++ b/OpenAL32/alSoundfont.c
@@ -91,7 +91,7 @@ AL_API ALvoid AL_APIENTRY alDeleteSoundfontsSOFT(ALsizei n, const ALuint *ids)
}
else if((sfont=LookupSfont(device, ids[i])) == NULL)
SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
- if(sfont->Mapped != AL_FALSE || sfont->ref != 0)
+ if(sfont->Mapped != AL_FALSE || ReadRef(&sfont->ref) != 0)
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
}
@@ -157,7 +157,7 @@ AL_API ALvoid AL_APIENTRY alSoundfontSamplesSOFT(ALuint id, ALenum type, ALsizei
SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
WriteLock(&sfont->Lock);
- if(sfont->ref != 0)
+ if(ReadRef(&sfont->ref) != 0)
alSetError(context, AL_INVALID_OPERATION);
else if(sfont->Mapped)
alSetError(context, AL_INVALID_OPERATION);
@@ -232,7 +232,7 @@ AL_API ALvoid* AL_APIENTRY alSoundfontMapSamplesSOFT(ALuint id, ALsizei offset,
SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
ReadLock(&sfont->Lock);
- if(sfont->ref != 0)
+ if(ReadRef(&sfont->ref) != 0)
alSetError(context, AL_INVALID_OPERATION);
else if(ExchangeInt(&sfont->Mapped, AL_TRUE) == AL_TRUE)
alSetError(context, AL_INVALID_OPERATION);
@@ -329,7 +329,7 @@ AL_API void AL_APIENTRY alSoundfontPresetsSOFT(ALuint id, ALsizei count, const A
SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
WriteLock(&sfont->Lock);
- if(sfont->ref != 0)
+ if(ReadRef(&sfont->ref) != 0)
{
WriteUnlock(&sfont->Lock);
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
@@ -390,7 +390,7 @@ AL_API void AL_APIENTRY alLoadSoundfontSOFT(ALuint id, size_t(*cb)(ALvoid*,size_
SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
WriteLock(&sfont->Lock);
- if(sfont->ref != 0)
+ if(ReadRef(&sfont->ref) != 0)
{
WriteUnlock(&sfont->Lock);
SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
@@ -419,7 +419,7 @@ done:
void ALsoundfont_Construct(ALsoundfont *self)
{
- self->ref = 0;
+ InitRef(&self->ref, 0);
self->Presets = NULL;
self->NumPresets = 0;
@@ -520,7 +520,7 @@ void ALsoundfont_deleteSoundfont(ALsoundfont *self, ALCdevice *device)
deleting = AL_FALSE;
for(j = 0;j < num_sounds;j++)
{
- if(sounds[j] && sounds[j]->ref == 0)
+ if(sounds[j] && ReadRef(&sounds[j]->ref) == 0)
{
deleting = AL_TRUE;
RemoveFontsound(device, sounds[j]->id);
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 167208e5..78ccef9a 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -2230,16 +2230,16 @@ AL_API ALvoid AL_APIENTRY alSourceUnqueueBuffers(ALuint src, ALsizei nb, ALuint
if(BufferList)
{
ALCdevice *device = context->Device;
- RefCount count;
+ uint count;
/* Cut the new head's link back to the old body. The mixer is robust
* enough to handle the link back going away. Once the active mix (if
* any) is complete, it's safe to finish cutting the old tail from the
* new head. */
BufferList = ExchangePtr((XchgPtr*)&BufferList->prev, NULL);
- if(((count=device->MixCount)&1) != 0)
+ if(((count=ReadRef(&device->MixCount))&1) != 0)
{
- while(count == device->MixCount)
+ while(count == ReadRef(&device->MixCount))
althrd_yield();
}
BufferList->next = NULL;