diff options
author | Chris Robinson <[email protected]> | 2014-03-21 23:56:18 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-03-21 23:56:18 -0700 |
commit | 0a030c2bd91a0f7c94ce310ea4b03c6a923463b9 (patch) | |
tree | c91ac0d951365b091e85490d6896d4e366e3a3ff /Alc/effects/null.c | |
parent | f5ce73646c23e42118309c4139685a0d2ffe6f0f (diff) |
Use a void* for the effect state Delete method param
Diffstat (limited to 'Alc/effects/null.c')
-rw-r--r-- | Alc/effects/null.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Alc/effects/null.c b/Alc/effects/null.c index 816a2525..6dacd021 100644 --- a/Alc/effects/null.c +++ b/Alc/effects/null.c @@ -48,10 +48,20 @@ static ALvoid ALnullState_process(ALnullState* UNUSED(state), ALuint UNUSED(samp (void)samplesOut; } -/* This frees the memory used by the object, after it has been destructed. */ -static void ALnullState_Delete(ALnullState *state) +/* This allocates memory to store the object, before it gets constructed. + * DECLARE_DEFAULT_ALLOCATORS can be used to declate a default method. + */ +static void *ALnullState_New(size_t size) +{ + return malloc(size); +} + +/* This frees the memory used by the object, after it has been destructed. + * DECLARE_DEFAULT_ALLOCATORS can be used to declate a default method. + */ +static void ALnullState_Delete(void *ptr) { - free(state); + free(ptr); } /* Define the forwards and the ALeffectState vtable for this type. */ @@ -67,7 +77,7 @@ ALeffectState *ALnullStateFactory_create(ALnullStateFactory *UNUSED(factory)) { ALnullState *state; - state = calloc(1, sizeof(*state)); + state = ALnullState_New(sizeof(*state)); if(!state) return NULL; /* Set vtables for inherited types. */ SET_VTABLE2(ALnullState, ALeffectState, state); |