diff options
author | Chris Robinson <[email protected]> | 2013-10-07 14:49:36 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-10-07 14:49:36 -0700 |
commit | b42fcce014da2c866a3d64f8f4831baed2f46e6f (patch) | |
tree | 41b9df2f2e2f7465e5147aafaa8dcf3ba67fd6f5 /Alc/effects/autowah.c | |
parent | fc31a414732d1b45f69f66236bb52b8226762db5 (diff) |
Use inline initialization for effect state factory vtables
Diffstat (limited to 'Alc/effects/autowah.c')
-rw-r--r-- | Alc/effects/autowah.c | 14 |
1 files changed, 6 insertions, 8 deletions
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); } |