diff options
author | Chris Robinson <[email protected]> | 2015-10-20 11:20:15 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2015-10-20 11:20:15 -0700 |
commit | d9a77a7edc309f399ce257f4b69d240008f47b49 (patch) | |
tree | 5e3408729b77d079a3d703fe359a81711adf4483 | |
parent | acb37edc4fd152eb5c405cff2e865e63fb16b08a (diff) |
Use NEW_OBJ in a few more places
-rw-r--r-- | Alc/midi/dummy.c | 6 | ||||
-rw-r--r-- | Alc/midi/fluidsynth.c | 4 | ||||
-rw-r--r-- | Alc/midi/soft.c | 3 |
3 files changed, 5 insertions, 8 deletions
diff --git a/Alc/midi/dummy.c b/Alc/midi/dummy.c index a04c1c9b..23c0d2cb 100644 --- a/Alc/midi/dummy.c +++ b/Alc/midi/dummy.c @@ -64,13 +64,13 @@ static void DSynth_process(DSynth *self, ALuint SamplesToDo, ALfloatBUFFERSIZE*r MidiSynth *DSynth_create(ALCdevice *device) { - DSynth *synth = DSynth_New(sizeof(*synth)); + DSynth *synth; + + NEW_OBJ(synth, DSynth)(device); if(!synth) { ERR("Failed to allocate DSynth\n"); return NULL; } - memset(synth, 0, sizeof(*synth)); - DSynth_Construct(synth, device); return STATIC_CAST(MidiSynth, synth); } diff --git a/Alc/midi/fluidsynth.c b/Alc/midi/fluidsynth.c index 976fce78..2236c812 100644 --- a/Alc/midi/fluidsynth.c +++ b/Alc/midi/fluidsynth.c @@ -908,14 +908,12 @@ MidiSynth *FSynth_create(ALCdevice *device) if(!LoadFSynth()) return NULL; - synth = FSynth_New(sizeof(*synth)); + NEW_OBJ(synth, FSynth)(device); if(!synth) { ERR("Failed to allocate FSynth\n"); return NULL; } - memset(synth, 0, sizeof(*synth)); - FSynth_Construct(synth, device); if(FSynth_init(synth, device) == AL_FALSE) { diff --git a/Alc/midi/soft.c b/Alc/midi/soft.c index 688924d4..a000266b 100644 --- a/Alc/midi/soft.c +++ b/Alc/midi/soft.c @@ -129,12 +129,11 @@ MidiSynth *SSynth_create(ALCdevice *device) return NULL; } - synth = SSynth_New(sizeof(*synth)); + NEW_OBJ(synth, SSynth)(device); if(!synth) { ERR("Failed to allocate SSynth\n"); return NULL; } - SSynth_Construct(synth, device); return STATIC_CAST(MidiSynth, synth); } |