diff options
author | Chris Robinson <[email protected]> | 2011-06-17 23:59:25 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-06-17 23:59:25 -0700 |
commit | 0d39ac652889bc2ecea0286fe24fcdcd6c04995e (patch) | |
tree | d21b0a88ed08e2901c5e5a6049705fb64a9d8247 /OpenAL32/alThunk.c | |
parent | 157e1394d6d3d32630d287a9725396ec4dff24bb (diff) |
Allow alThunkAddEntry to return a proper error
Diffstat (limited to 'OpenAL32/alThunk.c')
-rw-r--r-- | OpenAL32/alThunk.c | 7 |
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) |