aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alFilter.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-24 18:34:45 -0700
committerChris Robinson <[email protected]>2011-09-24 18:34:45 -0700
commite9da6950eeef2d7d3b43e3878db0b0804cf397b0 (patch)
tree0964c0f8e7e15a2fb5b52914bb8d10ecb00f0a8b /OpenAL32/alFilter.c
parent12abd75aed83555c0a7b34273a8823662507a3d0 (diff)
Centralize the Lookup and Remove macros
Diffstat (limited to 'OpenAL32/alFilter.c')
-rw-r--r--OpenAL32/alFilter.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c
index adf689ca..07cc1ea3 100644
--- a/OpenAL32/alFilter.c
+++ b/OpenAL32/alFilter.c
@@ -32,8 +32,6 @@
static void InitFilterParams(ALfilter *filter, ALenum type);
-#define LookupFilter(m, k) ((ALfilter*)LookupUIntMapKey(&(m), (k)))
-#define RemoveFilter(m, k) ((ALfilter*)PopUIntMapValue(&(m), (k)))
AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters)
{
@@ -103,7 +101,7 @@ AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters)
if(!filters[i])
continue;
- if(LookupFilter(device->FilterMap, filters[i]) == NULL)
+ if(LookupFilter(device, filters[i]) == NULL)
{
alSetError(Context, AL_INVALID_NAME);
n = 0;
@@ -114,7 +112,7 @@ AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters)
for(i = 0;i < n;i++)
{
// Recheck that the filter is valid, because there could be duplicated names
- if((ALFilter=RemoveFilter(device->FilterMap, filters[i])) == NULL)
+ if((ALFilter=RemoveFilter(device, filters[i])) == NULL)
continue;
FreeThunkEntry(ALFilter->filter);
@@ -134,7 +132,7 @@ AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter)
Context = GetContextRef();
if(!Context) return AL_FALSE;
- result = ((!filter || LookupFilter(Context->Device->FilterMap, filter)) ?
+ result = ((!filter || LookupFilter(Context->Device, filter)) ?
AL_TRUE : AL_FALSE);
ALCcontext_DecRef(Context);
@@ -152,7 +150,7 @@ AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue)
if(!Context) return;
Device = Context->Device;
- if((ALFilter=LookupFilter(Device->FilterMap, filter)) != NULL)
+ if((ALFilter=LookupFilter(Device, filter)) != NULL)
{
switch(param)
{
@@ -192,7 +190,7 @@ AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *p
if(!Context) return;
Device = Context->Device;
- if((ALFilter=LookupFilter(Device->FilterMap, filter)) != NULL)
+ if((ALFilter=LookupFilter(Device, filter)) != NULL)
{
/* Call the appropriate handler */
ALfilter_SetParamiv(ALFilter, Context, param, piValues);
@@ -213,7 +211,7 @@ AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue
if(!Context) return;
Device = Context->Device;
- if((ALFilter=LookupFilter(Device->FilterMap, filter)) != NULL)
+ if((ALFilter=LookupFilter(Device, filter)) != NULL)
{
/* Call the appropriate handler */
ALfilter_SetParamf(ALFilter, Context, param, flValue);
@@ -234,7 +232,7 @@ AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat
if(!Context) return;
Device = Context->Device;
- if((ALFilter=LookupFilter(Device->FilterMap, filter)) != NULL)
+ if((ALFilter=LookupFilter(Device, filter)) != NULL)
{
/* Call the appropriate handler */
ALfilter_SetParamfv(ALFilter, Context, param, pflValues);
@@ -255,7 +253,7 @@ AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piVal
if(!Context) return;
Device = Context->Device;
- if((ALFilter=LookupFilter(Device->FilterMap, filter)) != NULL)
+ if((ALFilter=LookupFilter(Device, filter)) != NULL)
{
switch(param)
{
@@ -292,7 +290,7 @@ AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piVa
if(!Context) return;
Device = Context->Device;
- if((ALFilter=LookupFilter(Device->FilterMap, filter)) != NULL)
+ if((ALFilter=LookupFilter(Device, filter)) != NULL)
{
/* Call the appropriate handler */
ALfilter_GetParamiv(ALFilter, Context, param, piValues);
@@ -313,7 +311,7 @@ AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pfl
if(!Context) return;
Device = Context->Device;
- if((ALFilter=LookupFilter(Device->FilterMap, filter)) != NULL)
+ if((ALFilter=LookupFilter(Device, filter)) != NULL)
{
/* Call the appropriate handler */
ALfilter_GetParamf(ALFilter, Context, param, pflValue);
@@ -334,7 +332,7 @@ AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pf
if(!Context) return;
Device = Context->Device;
- if((ALFilter=LookupFilter(Device->FilterMap, filter)) != NULL)
+ if((ALFilter=LookupFilter(Device, filter)) != NULL)
{
/* Call the appropriate handler */
ALfilter_GetParamfv(ALFilter, Context, param, pflValues);