From b42fcce014da2c866a3d64f8f4831baed2f46e6f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 7 Oct 2013 14:49:36 -0700 Subject: Use inline initialization for effect state factory vtables --- Alc/effects/autowah.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Alc/effects/autowah.c') diff --git a/Alc/effects/autowah.c b/Alc/effects/autowah.c index 1b2e166d..9a3f8b94 100644 --- a/Alc/effects/autowah.c +++ b/Alc/effects/autowah.c @@ -35,13 +35,6 @@ #define OCTAVE 2.0f -typedef struct ALautowahStateFactory { - DERIVE_FROM_TYPE(ALeffectStateFactory); -} ALautowahStateFactory; - -static ALautowahStateFactory AutowahFactory; - - /* We use a lfo with a custom low-pass filter to generate autowah * effect and a high-pass filter to avoid distortion and aliasing. * By adding the two filters up, we obtain a dynamic bandpass filter. @@ -171,6 +164,10 @@ static void ALautowahState_Delete(ALautowahState *state) DEFINE_ALEFFECTSTATE_VTABLE(ALautowahState); +typedef struct ALautowahStateFactory { + DERIVE_FROM_TYPE(ALeffectStateFactory); +} ALautowahStateFactory; + static ALeffectState *ALautowahStateFactory_create(ALautowahStateFactory *UNUSED(factory)) { ALautowahState *state; @@ -189,7 +186,8 @@ DEFINE_ALEFFECTSTATEFACTORY_VTABLE(ALautowahStateFactory); ALeffectStateFactory *ALautowahStateFactory_getFactory(void) { - SET_VTABLE2(ALautowahStateFactory, ALeffectStateFactory, &AutowahFactory); + static ALautowahStateFactory AutowahFactory = { { GET_VTABLE2(ALautowahStateFactory, ALeffectStateFactory) } }; + return STATIC_CAST(ALeffectStateFactory, &AutowahFactory); } -- cgit v1.2.3