aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alThunk.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-06-17 23:59:25 -0700
committerChris Robinson <[email protected]>2011-06-17 23:59:25 -0700
commit0d39ac652889bc2ecea0286fe24fcdcd6c04995e (patch)
treed21b0a88ed08e2901c5e5a6049705fb64a9d8247 /OpenAL32/alThunk.c
parent157e1394d6d3d32630d287a9725396ec4dff24bb (diff)
Allow alThunkAddEntry to return a proper error
Diffstat (limited to 'OpenAL32/alThunk.c')
-rw-r--r--OpenAL32/alThunk.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/OpenAL32/alThunk.c b/OpenAL32/alThunk.c
index 08b80b06..467615cf 100644
--- a/OpenAL32/alThunk.c
+++ b/OpenAL32/alThunk.c
@@ -50,7 +50,7 @@ void alThunkExit(void)
DeleteCriticalSection(&g_ThunkLock);
}
-ALuint alThunkAddEntry(ALvoid *ptr)
+ALenum alThunkAddEntry(ALvoid *ptr, ALuint *idx)
{
ALuint index;
@@ -71,7 +71,7 @@ ALuint alThunkAddEntry(ALvoid *ptr)
{
LeaveCriticalSection(&g_ThunkLock);
AL_PRINT("Realloc failed to increase to %u enties!\n", g_ThunkArraySize*2);
- return 0;
+ return AL_OUT_OF_MEMORY;
}
memset(&NewList[g_ThunkArraySize], 0, g_ThunkArraySize*sizeof(ThunkEntry));
g_ThunkArraySize *= 2;
@@ -80,10 +80,11 @@ ALuint alThunkAddEntry(ALvoid *ptr)
g_ThunkArray[index].ptr = ptr;
g_ThunkArray[index].InUse = AL_TRUE;
+ *idx = index+1;
LeaveCriticalSection(&g_ThunkLock);
- return index+1;
+ return AL_NO_ERROR;
}
void alThunkRemoveEntry(ALuint index)