Use a consistent name for the self-id field
This commit is contained in:
parent
08bd5e8b37
commit
c9e64596a4
@ -28,8 +28,8 @@ typedef struct ALeffectslot
|
||||
|
||||
RefCount ref;
|
||||
|
||||
// Index to itself
|
||||
ALuint effectslot;
|
||||
/* Self ID */
|
||||
ALuint id;
|
||||
|
||||
struct ALeffectslot *next;
|
||||
} ALeffectslot;
|
||||
|
@ -85,8 +85,8 @@ typedef struct ALeffect
|
||||
void (*GetParamf)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val);
|
||||
void (*GetParamfv)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals);
|
||||
|
||||
// Index to itself
|
||||
ALuint effect;
|
||||
/* Self ID */
|
||||
ALuint id;
|
||||
} ALeffect;
|
||||
|
||||
#define ALeffect_SetParami(x, c, p, v) ((x)->SetParami((x),(c),(p),(v)))
|
||||
|
@ -87,8 +87,8 @@ typedef struct ALfilter {
|
||||
void (*GetParamf)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val);
|
||||
void (*GetParamfv)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *vals);
|
||||
|
||||
// Index to itself
|
||||
ALuint filter;
|
||||
/* Self ID */
|
||||
ALuint id;
|
||||
} ALfilter;
|
||||
|
||||
#define ALfilter_SetParami(x, c, p, v) ((x)->SetParami((x),(c),(p),(v)))
|
||||
|
@ -125,8 +125,8 @@ typedef struct ALsource
|
||||
|
||||
ALvoid (*Update)(struct ALsource *self, const ALCcontext *context);
|
||||
|
||||
// Index to itself
|
||||
ALuint source;
|
||||
/* Self ID */
|
||||
ALuint id;
|
||||
} ALsource;
|
||||
#define ALsource_Update(s,a) ((s)->Update(s,a))
|
||||
|
||||
|
@ -75,13 +75,13 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo
|
||||
Context->ActiveEffectSlots[Context->ActiveEffectSlotCount++] = slot;
|
||||
UnlockContext(Context);
|
||||
if(err == AL_NO_ERROR)
|
||||
err = NewThunkEntry(&slot->effectslot);
|
||||
err = NewThunkEntry(&slot->id);
|
||||
if(err == AL_NO_ERROR)
|
||||
err = InsertUIntMapEntry(&Context->EffectSlotMap, slot->effectslot, slot);
|
||||
err = InsertUIntMapEntry(&Context->EffectSlotMap, slot->id, slot);
|
||||
if(err != AL_NO_ERROR)
|
||||
{
|
||||
RemoveEffectSlotArray(Context, slot);
|
||||
FreeThunkEntry(slot->effectslot);
|
||||
FreeThunkEntry(slot->id);
|
||||
ALeffectState_Destroy(slot->EffectState);
|
||||
free(slot);
|
||||
|
||||
@ -90,7 +90,7 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo
|
||||
break;
|
||||
}
|
||||
|
||||
effectslots[i] = slot->effectslot;
|
||||
effectslots[i] = slot->id;
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *
|
||||
// Recheck that the effectslot is valid, because there could be duplicated names
|
||||
if((EffectSlot=RemoveEffectSlot(Context, effectslots[i])) == NULL)
|
||||
continue;
|
||||
FreeThunkEntry(EffectSlot->effectslot);
|
||||
FreeThunkEntry(EffectSlot->id);
|
||||
|
||||
RemoveEffectSlotArray(Context, EffectSlot);
|
||||
ALeffectState_Destroy(EffectSlot->EffectState);
|
||||
@ -318,7 +318,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum pa
|
||||
switch(param)
|
||||
{
|
||||
case AL_EFFECTSLOT_EFFECT:
|
||||
*piValue = EffectSlot->effect.effect;
|
||||
*piValue = EffectSlot->effect.id;
|
||||
break;
|
||||
|
||||
case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
|
||||
@ -623,7 +623,7 @@ ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *Context)
|
||||
// Release effectslot structure
|
||||
ALeffectState_Destroy(temp->EffectState);
|
||||
|
||||
FreeThunkEntry(temp->effectslot);
|
||||
FreeThunkEntry(temp->id);
|
||||
memset(temp, 0, sizeof(ALeffectslot));
|
||||
free(temp);
|
||||
}
|
||||
|
@ -63,12 +63,12 @@ AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
|
||||
break;
|
||||
}
|
||||
|
||||
err = NewThunkEntry(&effect->effect);
|
||||
err = NewThunkEntry(&effect->id);
|
||||
if(err == AL_NO_ERROR)
|
||||
err = InsertUIntMapEntry(&device->EffectMap, effect->effect, effect);
|
||||
err = InsertUIntMapEntry(&device->EffectMap, effect->id, effect);
|
||||
if(err != AL_NO_ERROR)
|
||||
{
|
||||
FreeThunkEntry(effect->effect);
|
||||
FreeThunkEntry(effect->id);
|
||||
memset(effect, 0, sizeof(ALeffect));
|
||||
free(effect);
|
||||
|
||||
@ -77,7 +77,7 @@ AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
|
||||
break;
|
||||
}
|
||||
|
||||
effects[i] = effect->effect;
|
||||
effects[i] = effect->id;
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects)
|
||||
// Recheck that the effect is valid, because there could be duplicated names
|
||||
if((ALEffect=RemoveEffect(device, effects[i])) == NULL)
|
||||
continue;
|
||||
FreeThunkEntry(ALEffect->effect);
|
||||
FreeThunkEntry(ALEffect->id);
|
||||
|
||||
memset(ALEffect, 0, sizeof(ALeffect));
|
||||
free(ALEffect);
|
||||
@ -1188,7 +1188,7 @@ ALvoid ReleaseALEffects(ALCdevice *device)
|
||||
device->EffectMap.array[i].value = NULL;
|
||||
|
||||
// Release effect structure
|
||||
FreeThunkEntry(temp->effect);
|
||||
FreeThunkEntry(temp->id);
|
||||
memset(temp, 0, sizeof(ALeffect));
|
||||
free(temp);
|
||||
}
|
||||
|
@ -59,12 +59,12 @@ AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters)
|
||||
}
|
||||
InitFilterParams(filter, AL_FILTER_NULL);
|
||||
|
||||
err = NewThunkEntry(&filter->filter);
|
||||
err = NewThunkEntry(&filter->id);
|
||||
if(err == AL_NO_ERROR)
|
||||
err = InsertUIntMapEntry(&device->FilterMap, filter->filter, filter);
|
||||
err = InsertUIntMapEntry(&device->FilterMap, filter->id, filter);
|
||||
if(err != AL_NO_ERROR)
|
||||
{
|
||||
FreeThunkEntry(filter->filter);
|
||||
FreeThunkEntry(filter->id);
|
||||
memset(filter, 0, sizeof(ALfilter));
|
||||
free(filter);
|
||||
|
||||
@ -73,7 +73,7 @@ AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters)
|
||||
break;
|
||||
}
|
||||
|
||||
filters[i] = filter->filter;
|
||||
filters[i] = filter->id;
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters)
|
||||
// Recheck that the filter is valid, because there could be duplicated names
|
||||
if((ALFilter=RemoveFilter(device, filters[i])) == NULL)
|
||||
continue;
|
||||
FreeThunkEntry(ALFilter->filter);
|
||||
FreeThunkEntry(ALFilter->id);
|
||||
|
||||
memset(ALFilter, 0, sizeof(ALfilter));
|
||||
free(ALFilter);
|
||||
@ -448,7 +448,7 @@ ALvoid ReleaseALFilters(ALCdevice *device)
|
||||
device->FilterMap.array[i].value = NULL;
|
||||
|
||||
// Release filter structure
|
||||
FreeThunkEntry(temp->filter);
|
||||
FreeThunkEntry(temp->id);
|
||||
memset(temp, 0, sizeof(ALfilter));
|
||||
free(temp);
|
||||
}
|
||||
|
@ -78,12 +78,12 @@ AL_API ALvoid AL_APIENTRY alGenSources(ALsizei n, ALuint *sources)
|
||||
}
|
||||
InitSourceParams(source);
|
||||
|
||||
err = NewThunkEntry(&source->source);
|
||||
err = NewThunkEntry(&source->id);
|
||||
if(err == AL_NO_ERROR)
|
||||
err = InsertUIntMapEntry(&Context->SourceMap, source->source, source);
|
||||
err = InsertUIntMapEntry(&Context->SourceMap, source->id, source);
|
||||
if(err != AL_NO_ERROR)
|
||||
{
|
||||
FreeThunkEntry(source->source);
|
||||
FreeThunkEntry(source->id);
|
||||
memset(source, 0, sizeof(ALsource));
|
||||
free(source);
|
||||
|
||||
@ -92,7 +92,7 @@ AL_API ALvoid AL_APIENTRY alGenSources(ALsizei n, ALuint *sources)
|
||||
break;
|
||||
}
|
||||
|
||||
sources[i++] = source->source;
|
||||
sources[i++] = source->id;
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,8 +133,7 @@ AL_API ALvoid AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources)
|
||||
// Remove Source from list of Sources
|
||||
if((Source=RemoveSource(Context, sources[i])) == NULL)
|
||||
continue;
|
||||
|
||||
FreeThunkEntry(Source->source);
|
||||
FreeThunkEntry(Source->id);
|
||||
|
||||
LockContext(Context);
|
||||
srclist = Context->ActiveSources;
|
||||
@ -2202,7 +2201,7 @@ ALvoid ReleaseALSources(ALCcontext *Context)
|
||||
}
|
||||
|
||||
// Release source structure
|
||||
FreeThunkEntry(temp->source);
|
||||
FreeThunkEntry(temp->id);
|
||||
memset(temp, 0, sizeof(ALsource));
|
||||
free(temp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user