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/compressor.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'Alc/effects/compressor.c') diff --git a/Alc/effects/compressor.c b/Alc/effects/compressor.c index ea035fa7..8c639f43 100644 --- a/Alc/effects/compressor.c +++ b/Alc/effects/compressor.c @@ -26,12 +26,6 @@ #include "alAuxEffectSlot.h" #include "alu.h" -typedef struct ALcompressorStateFactory { - DERIVE_FROM_TYPE(ALeffectStateFactory); -} ALcompressorStateFactory; - -static ALcompressorStateFactory CompressorFactory; - typedef struct ALcompressorState { DERIVE_FROM_TYPE(ALeffectState); @@ -138,6 +132,10 @@ static void ALcompressorState_Delete(ALcompressorState *state) DEFINE_ALEFFECTSTATE_VTABLE(ALcompressorState); +typedef struct ALcompressorStateFactory { + DERIVE_FROM_TYPE(ALeffectStateFactory); +} ALcompressorStateFactory; + static ALeffectState *ALcompressorStateFactory_create(ALcompressorStateFactory *UNUSED(factory)) { ALcompressorState *state; @@ -153,7 +151,8 @@ DEFINE_ALEFFECTSTATEFACTORY_VTABLE(ALcompressorStateFactory); ALeffectStateFactory *ALcompressorStateFactory_getFactory(void) { - SET_VTABLE2(ALcompressorStateFactory, ALeffectStateFactory, &CompressorFactory); + static ALcompressorStateFactory CompressorFactory = { { GET_VTABLE2(ALcompressorStateFactory, ALeffectStateFactory) } }; + return STATIC_CAST(ALeffectStateFactory, &CompressorFactory); } -- cgit v1.2.3