aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/base.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-11-02 13:23:20 -0700
committerChris Robinson <[email protected]>2013-11-02 13:23:20 -0700
commitc851e2c6110de948802ce0e229a0bf4c3c067ed6 (patch)
treea3eba14580d43649ecba001b98520884fa80ac33 /Alc/backends/base.c
parentddf521eddce2552ca7fdb3ba3255cf8f224489d4 (diff)
Set vtables in the constructor
Diffstat (limited to 'Alc/backends/base.c')
-rw-r--r--Alc/backends/base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/backends/base.c b/Alc/backends/base.c
index 2f3ff924..0c285993 100644
--- a/Alc/backends/base.c
+++ b/Alc/backends/base.c
@@ -55,11 +55,12 @@ void ALCbackend_unlock(ALCbackend *self)
typedef struct PlaybackWrapper {
DERIVE_FROM_TYPE(ALCbackend);
} PlaybackWrapper;
-#define PLAYBACKWRAPPER_INITIALIZER { { GET_VTABLE2(ALCbackend, PlaybackWrapper) } }
+DECLARE_ALCBACKEND_VTABLE(PlaybackWrapper);
static void PlaybackWrapper_Construct(PlaybackWrapper *self, ALCdevice *device)
{
ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device);
+ SET_VTABLE2(PlaybackWrapper, ALCbackend, self);
}
static void PlaybackWrapper_Destruct(PlaybackWrapper *self)
@@ -136,11 +137,12 @@ DEFINE_ALCBACKEND_VTABLE(PlaybackWrapper);
typedef struct CaptureWrapper {
DERIVE_FROM_TYPE(ALCbackend);
} CaptureWrapper;
-#define CAPTUREWRAPPER_INITIALIZER { { GET_VTABLE2(ALCbackend, PlaybackWrapper) } }
+DECLARE_ALCBACKEND_VTABLE(CaptureWrapper);
static void CaptureWrapper_Construct(CaptureWrapper *self, ALCdevice *device)
{
ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device);
+ SET_VTABLE2(CaptureWrapper, ALCbackend, self);
}
static void CaptureWrapper_Destruct(CaptureWrapper *self)
@@ -224,7 +226,6 @@ ALCbackend *create_backend_wrapper(ALCdevice *device, ALCbackend_Type type)
backend = malloc(sizeof(*backend));
if(!backend) return NULL;
- SET_VTABLE2(PlaybackWrapper, ALCbackend, backend);
PlaybackWrapper_Construct(backend, device);
@@ -237,7 +238,6 @@ ALCbackend *create_backend_wrapper(ALCdevice *device, ALCbackend_Type type)
backend = malloc(sizeof(*backend));
if(!backend) return NULL;
- SET_VTABLE2(CaptureWrapper, ALCbackend, backend);
CaptureWrapper_Construct(backend, device);