diff options
author | Chris Robinson <[email protected]> | 2013-10-29 11:22:18 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-10-29 11:22:18 -0700 |
commit | d4aa4e16a0b6bb53ec9bbe0a8b3f467fb9a243f7 (patch) | |
tree | 6c34a62f7675b06375cc4ef23afe01cfdc4c1f85 /Alc/backends/null.c | |
parent | d2b36159431789d6934f5569e54982d7c54c4e84 (diff) |
Add a macro to forward methods to a base type
Diffstat (limited to 'Alc/backends/null.c')
-rw-r--r-- | Alc/backends/null.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/Alc/backends/null.c b/Alc/backends/null.c index c5b178de..8eeb2689 100644 --- a/Alc/backends/null.c +++ b/Alc/backends/null.c @@ -39,11 +39,23 @@ typedef struct ALCnullBackend { volatile int killNow; althread_t thread; } ALCnullBackend; -#define ALCNULLBACKEND_INITIALIZER { { GET_VTABLE2(ALCbackend, ALCnullBackend) } } +DECLARE_ALCBACKEND_VTABLE(ALCnullBackend); +static DECLARE_FORWARD(ALCnullBackend, ALCbackend, void, Destruct) +static DECLARE_FORWARD(ALCnullBackend, ALCbackend, ALint64, getLatency) +static DECLARE_FORWARD(ALCnullBackend, ALCbackend, void, lock) +static DECLARE_FORWARD(ALCnullBackend, ALCbackend, void, unlock) static const ALCchar nullDevice[] = "No Output"; + +static void ALCnullBackend_Construct(ALCnullBackend *self, ALCdevice *device) +{ + ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device); + SET_VTABLE2(ALCnullBackend, ALCbackend, self); +} + + static ALuint ALCnullBackend_mixerProc(ALvoid *ptr) { ALCnullBackend *self = (ALCnullBackend*)ptr; @@ -86,16 +98,6 @@ static ALuint ALCnullBackend_mixerProc(ALvoid *ptr) } -static void ALCnullBackend_Construct(ALCnullBackend *self, ALCdevice *device) -{ - ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device); -} - -static void ALCnullBackend_Destruct(ALCnullBackend *self) -{ - ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); -} - static ALCenum ALCnullBackend_open(ALCnullBackend *self, const ALCchar *name) { ALCdevice *device; @@ -150,20 +152,6 @@ ALCuint ALCnullBackend_availableSamples(ALCnullBackend* UNUSED(self)) return 0; } -static ALint64 ALCnullBackend_getLatency(ALCnullBackend *self) -{ - return ALCbackend_getLatency(STATIC_CAST(ALCbackend, self)); -} - -static void ALCnullBackend_lock(ALCnullBackend *self) -{ - ALCbackend_lock(STATIC_CAST(ALCbackend, self)); -} - -static void ALCnullBackend_unlock(ALCnullBackend *self) -{ - ALCbackend_unlock(STATIC_CAST(ALCbackend, self)); -} static void ALCnullBackend_Delete(ALCnullBackend *self) { @@ -214,7 +202,6 @@ ALCbackend* ALCnullBackendFactory_createBackend(ALCnullBackendFactory* UNUSED(se backend = calloc(1, sizeof(*backend)); if(!backend) return NULL; - SET_VTABLE2(ALCnullBackend, ALCbackend, backend); ALCnullBackend_Construct(backend, device); |