aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alThunk.h35
-rw-r--r--OpenAL32/alAuxEffectSlot.c8
-rw-r--r--OpenAL32/alBuffer.c8
-rw-r--r--OpenAL32/alEffect.c8
-rw-r--r--OpenAL32/alFilter.c8
-rw-r--r--OpenAL32/alSource.c8
-rw-r--r--OpenAL32/alThunk.c8
7 files changed, 32 insertions, 51 deletions
diff --git a/OpenAL32/Include/alThunk.h b/OpenAL32/Include/alThunk.h
index 9514db4d..adc77dec 100644
--- a/OpenAL32/Include/alThunk.h
+++ b/OpenAL32/Include/alThunk.h
@@ -1,39 +1,20 @@
-#ifndef _AL_THUNK_H_
-#define _AL_THUNK_H_
+#ifndef ALTHUNK_H
+#define ALTHUNK_H
-#include "config.h"
-
-#include "AL/al.h"
-#include "AL/alc.h"
+#include "alMain.h"
#ifdef __cplusplus
extern "C" {
#endif
-void alThunkInit(void);
-void alThunkExit(void);
-ALenum alThunkNewEntry(ALuint *idx);
-void alThunkRemoveEntry(ALuint index);
-
-#if (SIZEOF_VOIDP > SIZEOF_UINT)
-
-#define ALTHUNK_INIT() alThunkInit()
-#define ALTHUNK_EXIT() alThunkExit()
-#define ALTHUNK_NEWENTRY(p,i) alThunkNewEntry(i)
-#define ALTHUNK_REMOVEENTRY(i) alThunkRemoveEntry(i)
-
-#else
-
-#define ALTHUNK_INIT()
-#define ALTHUNK_EXIT()
-#define ALTHUNK_NEWENTRY(p,i) ((*(i) = (ALuint)p),AL_NO_ERROR)
-#define ALTHUNK_REMOVEENTRY(i) ((ALvoid)i)
-
-#endif // (SIZEOF_VOIDP > SIZEOF_INT)
+void ThunkInit(void);
+void ThunkExit(void);
+ALenum NewThunkEntry(ALuint *index);
+void FreeThunkEntry(ALuint index);
#ifdef __cplusplus
}
#endif
-#endif //_AL_THUNK_H_
+#endif //ALTHUNK_H
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index 0d67423e..edd29fb2 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -68,12 +68,12 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo
break;
}
- err = ALTHUNK_NEWENTRY(slot, &slot->effectslot);
+ err = NewThunkEntry(&slot->effectslot);
if(err == AL_NO_ERROR)
err = InsertUIntMapEntry(&Context->EffectSlotMap, slot->effectslot, slot);
if(err != AL_NO_ERROR)
{
- ALTHUNK_REMOVEENTRY(slot->effectslot);
+ FreeThunkEntry(slot->effectslot);
ALEffect_Destroy(slot->EffectState);
free(slot);
@@ -146,7 +146,7 @@ AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, ALuint *effect
ALEffect_Destroy(EffectSlot->EffectState);
RemoveUIntMapKey(&Context->EffectSlotMap, EffectSlot->effectslot);
- ALTHUNK_REMOVEENTRY(EffectSlot->effectslot);
+ FreeThunkEntry(EffectSlot->effectslot);
memset(EffectSlot, 0, sizeof(ALeffectslot));
free(EffectSlot);
@@ -533,7 +533,7 @@ ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *Context)
// Release effectslot structure
ALEffect_Destroy(temp->EffectState);
- ALTHUNK_REMOVEENTRY(temp->effectslot);
+ FreeThunkEntry(temp->effectslot);
memset(temp, 0, sizeof(ALeffectslot));
free(temp);
}
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 1f54752c..7d5b895f 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -163,12 +163,12 @@ AL_API ALvoid AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers)
break;
}
- err = ALTHUNK_NEWENTRY(buffer, &buffer->buffer);
+ err = NewThunkEntry(&buffer->buffer);
if(err == AL_NO_ERROR)
err = InsertUIntMapEntry(&device->BufferMap, buffer->buffer, buffer);
if(err != AL_NO_ERROR)
{
- ALTHUNK_REMOVEENTRY(buffer->buffer);
+ FreeThunkEntry(buffer->buffer);
memset(buffer, 0, sizeof(ALbuffer));
free(buffer);
@@ -245,7 +245,7 @@ AL_API ALvoid AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers)
/* Release buffer structure */
RemoveUIntMapKey(&device->BufferMap, ALBuf->buffer);
- ALTHUNK_REMOVEENTRY(ALBuf->buffer);
+ FreeThunkEntry(ALBuf->buffer);
memset(ALBuf, 0, sizeof(ALbuffer));
free(ALBuf);
@@ -2204,7 +2204,7 @@ ALvoid ReleaseALBuffers(ALCdevice *device)
free(temp->data);
- ALTHUNK_REMOVEENTRY(temp->buffer);
+ FreeThunkEntry(temp->buffer);
memset(temp, 0, sizeof(ALbuffer));
free(temp);
}
diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c
index 84cb81e3..51ebba0b 100644
--- a/OpenAL32/alEffect.c
+++ b/OpenAL32/alEffect.c
@@ -63,12 +63,12 @@ AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
break;
}
- err = ALTHUNK_NEWENTRY(effect, &effect->effect);
+ err = NewThunkEntry(&effect->effect);
if(err == AL_NO_ERROR)
err = InsertUIntMapEntry(&device->EffectMap, effect->effect, effect);
if(err != AL_NO_ERROR)
{
- ALTHUNK_REMOVEENTRY(effect->effect);
+ FreeThunkEntry(effect->effect);
memset(effect, 0, sizeof(ALeffect));
free(effect);
@@ -128,7 +128,7 @@ AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, ALuint *effects)
continue;
RemoveUIntMapKey(&device->EffectMap, ALEffect->effect);
- ALTHUNK_REMOVEENTRY(ALEffect->effect);
+ FreeThunkEntry(ALEffect->effect);
memset(ALEffect, 0, sizeof(ALeffect));
free(ALEffect);
@@ -1076,7 +1076,7 @@ ALvoid ReleaseALEffects(ALCdevice *device)
device->EffectMap.array[i].value = NULL;
// Release effect structure
- ALTHUNK_REMOVEENTRY(temp->effect);
+ FreeThunkEntry(temp->effect);
memset(temp, 0, sizeof(ALeffect));
free(temp);
}
diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c
index 040014c2..995d1851 100644
--- a/OpenAL32/alFilter.c
+++ b/OpenAL32/alFilter.c
@@ -59,12 +59,12 @@ AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters)
break;
}
- err = ALTHUNK_NEWENTRY(filter, &filter->filter);
+ err = NewThunkEntry(&filter->filter);
if(err == AL_NO_ERROR)
err = InsertUIntMapEntry(&device->FilterMap, filter->filter, filter);
if(err != AL_NO_ERROR)
{
- ALTHUNK_REMOVEENTRY(filter->filter);
+ FreeThunkEntry(filter->filter);
memset(filter, 0, sizeof(ALfilter));
free(filter);
@@ -124,7 +124,7 @@ AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, ALuint *filters)
continue;
RemoveUIntMapKey(&device->FilterMap, ALFilter->filter);
- ALTHUNK_REMOVEENTRY(ALFilter->filter);
+ FreeThunkEntry(ALFilter->filter);
memset(ALFilter, 0, sizeof(ALfilter));
free(ALFilter);
@@ -404,7 +404,7 @@ ALvoid ReleaseALFilters(ALCdevice *device)
device->FilterMap.array[i].value = NULL;
// Release filter structure
- ALTHUNK_REMOVEENTRY(temp->filter);
+ FreeThunkEntry(temp->filter);
memset(temp, 0, sizeof(ALfilter));
free(temp);
}
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 6a6edfa0..cf71e2e9 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -85,12 +85,12 @@ AL_API ALvoid AL_APIENTRY alGenSources(ALsizei n,ALuint *sources)
break;
}
- err = ALTHUNK_NEWENTRY(source, &source->source);
+ err = NewThunkEntry(&source->source);
if(err == AL_NO_ERROR)
err = InsertUIntMapEntry(&Context->SourceMap, source->source, source);
if(err != AL_NO_ERROR)
{
- ALTHUNK_REMOVEENTRY(source->source);
+ FreeThunkEntry(source->source);
memset(source, 0, sizeof(ALsource));
free(source);
@@ -175,7 +175,7 @@ AL_API ALvoid AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources)
// Remove Source from list of Sources
RemoveUIntMapKey(&Context->SourceMap, Source->source);
- ALTHUNK_REMOVEENTRY(Source->source);
+ FreeThunkEntry(Source->source);
memset(Source,0,sizeof(ALsource));
free(Source);
@@ -2165,7 +2165,7 @@ ALvoid ReleaseALSources(ALCcontext *Context)
}
// Release source structure
- ALTHUNK_REMOVEENTRY(temp->source);
+ FreeThunkEntry(temp->source);
memset(temp, 0, sizeof(ALsource));
free(temp);
}
diff --git a/OpenAL32/alThunk.c b/OpenAL32/alThunk.c
index bb843c3e..da5a5285 100644
--- a/OpenAL32/alThunk.c
+++ b/OpenAL32/alThunk.c
@@ -31,14 +31,14 @@ static ALuint g_ThunkArraySize;
static CRITICAL_SECTION g_ThunkLock;
-void alThunkInit(void)
+void ThunkInit(void)
{
InitializeCriticalSection(&g_ThunkLock);
g_ThunkArraySize = 1;
g_ThunkArray = calloc(1, g_ThunkArraySize * sizeof(*g_ThunkArray));
}
-void alThunkExit(void)
+void ThunkExit(void)
{
free(g_ThunkArray);
g_ThunkArray = NULL;
@@ -46,7 +46,7 @@ void alThunkExit(void)
DeleteCriticalSection(&g_ThunkLock);
}
-ALenum alThunkNewEntry(ALuint *idx)
+ALenum NewThunkEntry(ALuint *idx)
{
ALuint index;
@@ -82,7 +82,7 @@ ALenum alThunkNewEntry(ALuint *idx)
return AL_NO_ERROR;
}
-void alThunkRemoveEntry(ALuint index)
+void FreeThunkEntry(ALuint index)
{
EnterCriticalSection(&g_ThunkLock);