From d8bfd12d313372830f0e0b34fafcaa244395cf3c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 22 Mar 2014 00:28:55 -0700 Subject: Use a void* for the backend Delete method param --- Alc/backends/pulseaudio.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'Alc/backends/pulseaudio.c') diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index 1892e733..d2d5c9aa 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -509,6 +509,7 @@ static DECLARE_FORWARD2(ALCpulsePlayback, ALCbackend, ALCenum, captureSamples, A static DECLARE_FORWARD(ALCpulsePlayback, ALCbackend, ALCuint, availableSamples) static void ALCpulsePlayback_lock(ALCpulsePlayback *self); static void ALCpulsePlayback_unlock(ALCpulsePlayback *self); +DECLARE_DEFAULT_ALLOCATORS(ALCpulsePlayback) static void ALCpulsePlayback_Construct(ALCpulsePlayback *self, ALCdevice *device) @@ -1106,12 +1107,6 @@ static ALint64 ALCpulsePlayback_getLatency(ALCpulsePlayback *self) return (ALint64)minu64(latency, U64(0x7fffffffffffffff)/1000) * 1000; } - -static void ALCpulsePlayback_Delete(ALCpulsePlayback *self) -{ - free(self); -} - DEFINE_ALCBACKEND_VTABLE(ALCpulsePlayback); @@ -1159,6 +1154,7 @@ static ALCenum ALCpulseCapture_captureSamples(ALCpulseCapture *self, ALCvoid *bu static ALCuint ALCpulseCapture_availableSamples(ALCpulseCapture *self); static void ALCpulseCapture_lock(ALCpulseCapture *self); static void ALCpulseCapture_unlock(ALCpulseCapture *self); +DECLARE_DEFAULT_ALLOCATORS(ALCpulseCapture) static void ALCpulseCapture_Construct(ALCpulseCapture *self, ALCdevice *device) @@ -1585,12 +1581,6 @@ static ALint64 ALCpulseCapture_getLatency(ALCpulseCapture *self) return (ALint64)minu64(latency, U64(0x7fffffffffffffff)/1000) * 1000; } - -static void ALCpulseCapture_Delete(ALCpulseCapture *self) -{ - free(self); -} - DEFINE_ALCBACKEND_VTABLE(ALCpulseCapture); @@ -1725,8 +1715,9 @@ static ALCbackend* ALCpulseBackendFactory_createBackend(ALCpulseBackendFactory* { ALCpulsePlayback *backend; - backend = calloc(1, sizeof(*backend)); + backend = ALCpulsePlayback_New(sizeof(*backend)); if(!backend) return NULL; + memset(backend, 0, sizeof(*backend)); ALCpulsePlayback_Construct(backend, device); @@ -1736,8 +1727,9 @@ static ALCbackend* ALCpulseBackendFactory_createBackend(ALCpulseBackendFactory* { ALCpulseCapture *backend; - backend = calloc(1, sizeof(*backend)); + backend = ALCpulseCapture_New(sizeof(*backend)); if(!backend) return NULL; + memset(backend, 0, sizeof(*backend)); ALCpulseCapture_Construct(backend, device); -- cgit v1.2.3