aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/mmdevapi.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-05-18 16:39:44 -0700
committerChris Robinson <[email protected]>2015-05-18 16:39:44 -0700
commit9f49ac0fda04cc4bdc9e47a0d3c026722283c3a4 (patch)
treea5654bd758c2e7de5b58c50a8147541505f1b7bb /Alc/backends/mmdevapi.c
parent9479ea656bd4c7d3059b63405237829296776c10 (diff)
Add a macro to simplify allocating and constructing an object
Diffstat (limited to 'Alc/backends/mmdevapi.c')
-rw-r--r--Alc/backends/mmdevapi.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c
index cfd12d8d..a4fd1071 100644
--- a/Alc/backends/mmdevapi.c
+++ b/Alc/backends/mmdevapi.c
@@ -1756,25 +1756,15 @@ static ALCbackend* ALCmmdevBackendFactory_createBackend(ALCmmdevBackendFactory*
if(type == ALCbackend_Playback)
{
ALCmmdevPlayback *backend;
-
- backend = ALCmmdevPlayback_New(sizeof(*backend));
+ NEW_OBJ(backend, ALCmmdevPlayback)(device);
if(!backend) return NULL;
- memset(backend, 0, sizeof(*backend));
-
- ALCmmdevPlayback_Construct(backend, device);
-
return STATIC_CAST(ALCbackend, backend);
}
if(type == ALCbackend_Capture)
{
ALCmmdevCapture *backend;
-
- backend = ALCmmdevCapture_New(sizeof(*backend));
+ NEW_OBJ(backend, ALCmmdevCapture)(device);
if(!backend) return NULL;
- memset(backend, 0, sizeof(*backend));
-
- ALCmmdevCapture_Construct(backend, device);
-
return STATIC_CAST(ALCbackend, backend);
}