diff options
author | Chris Robinson <[email protected]> | 2018-12-27 14:27:35 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-27 14:27:35 -0800 |
commit | f2c2b7c5383ddd999b56f28730258f270b0d2576 (patch) | |
tree | f8940ac867fe81647597c0c42888fa23222fdb93 /Alc/backends/coreaudio.cpp | |
parent | 4782d6107d250e3528c5e567dca48da727584ee7 (diff) |
Get rid of the unnecessary STATIC_(UP)CAST macros
Diffstat (limited to 'Alc/backends/coreaudio.cpp')
-rw-r--r-- | Alc/backends/coreaudio.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Alc/backends/coreaudio.cpp b/Alc/backends/coreaudio.cpp index d0d0060c..62a88da1 100644 --- a/Alc/backends/coreaudio.cpp +++ b/Alc/backends/coreaudio.cpp @@ -83,11 +83,10 @@ static OSStatus ALCcoreAudioPlayback_MixerProc(void *inRefCon, AudioUnitRenderActionFlags* UNUSED(ioActionFlags), const AudioTimeStamp* UNUSED(inTimeStamp), UInt32 UNUSED(inBusNumber), UInt32 UNUSED(inNumberFrames), AudioBufferList *ioData) { - ALCcoreAudioPlayback *self = static_cast<ALCcoreAudioPlayback*>(inRefCon); - ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice; + auto self = static_cast<ALCcoreAudioPlayback*>(inRefCon); ALCcoreAudioPlayback_lock(self); - aluMixData(device, ioData->mBuffers[0].mData, + aluMixData(self->mDevice, ioData->mBuffers[0].mData, ioData->mBuffers[0].mDataByteSize / self->mFrameSize); ALCcoreAudioPlayback_unlock(self); @@ -97,7 +96,7 @@ static OSStatus ALCcoreAudioPlayback_MixerProc(void *inRefCon, static ALCenum ALCcoreAudioPlayback_open(ALCcoreAudioPlayback *self, const ALCchar *name) { - ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice; + ALCdevice *device{self->mDevice}; AudioComponentDescription desc; AudioComponent comp; OSStatus err; @@ -147,7 +146,7 @@ static ALCenum ALCcoreAudioPlayback_open(ALCcoreAudioPlayback *self, const ALCch static ALCboolean ALCcoreAudioPlayback_reset(ALCcoreAudioPlayback *self) { - ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice; + ALCdevice *device{self->mDevice}; AudioStreamBasicDescription streamFormat; AURenderCallbackStruct input; OSStatus err; @@ -413,7 +412,7 @@ static OSStatus ALCcoreAudioCapture_RecordProc(void *inRefCon, static ALCenum ALCcoreAudioCapture_open(ALCcoreAudioCapture *self, const ALCchar *name) { - ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice; + ALCdevice *device{self->mDevice}; AudioStreamBasicDescription requestedFormat; // The application requested format AudioStreamBasicDescription hardwareFormat; // The hardware format AudioStreamBasicDescription outputFormat; // The AudioUnit output format @@ -730,15 +729,13 @@ ALCbackend *CoreAudioBackendFactory::createBackend(ALCdevice *device, ALCbackend { ALCcoreAudioPlayback *backend; NEW_OBJ(backend, ALCcoreAudioPlayback)(device); - if(!backend) return nullptr; - return STATIC_CAST(ALCbackend, backend); + return backend; } if(type == ALCbackend_Capture) { ALCcoreAudioCapture *backend; NEW_OBJ(backend, ALCcoreAudioCapture)(device); - if(!backend) return nullptr; - return STATIC_CAST(ALCbackend, backend); + return backend; } return nullptr; |