aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/compressor.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-10-07 14:49:36 -0700
committerChris Robinson <[email protected]>2013-10-07 14:49:36 -0700
commitb42fcce014da2c866a3d64f8f4831baed2f46e6f (patch)
tree41b9df2f2e2f7465e5147aafaa8dcf3ba67fd6f5 /Alc/effects/compressor.c
parentfc31a414732d1b45f69f66236bb52b8226762db5 (diff)
Use inline initialization for effect state factory vtables
Diffstat (limited to 'Alc/effects/compressor.c')
-rw-r--r--Alc/effects/compressor.c13
1 files changed, 6 insertions, 7 deletions
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);
}