From 0d39ac652889bc2ecea0286fe24fcdcd6c04995e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 17 Jun 2011 23:59:25 -0700 Subject: Allow alThunkAddEntry to return a proper error --- OpenAL32/alThunk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenAL32/alThunk.c') 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) -- cgit v1.2.3