diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2021-04-27 16:19:21 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2021-04-27 16:26:27 +0200 |
commit | 8247667a3ee0d86f26094e722497b0cbb99cc12b (patch) | |
tree | d03fb75cca2ad4dd63d3c55e1d6ecde074441182 /drivers/coreaudio | |
parent | 288f484d0a034d02fbca3db0a2f14f5a0084a36b (diff) |
Core: Drop custom `copymem`/`zeromem` defines
We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb.
There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.
Diffstat (limited to 'drivers/coreaudio')
-rw-r--r-- | drivers/coreaudio/audio_driver_coreaudio.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/coreaudio/audio_driver_coreaudio.cpp b/drivers/coreaudio/audio_driver_coreaudio.cpp index f40036d628..4139727422 100644 --- a/drivers/coreaudio/audio_driver_coreaudio.cpp +++ b/drivers/coreaudio/audio_driver_coreaudio.cpp @@ -70,7 +70,7 @@ OSStatus AudioDriverCoreAudio::output_device_address_cb(AudioObjectID inObjectID Error AudioDriverCoreAudio::init() { AudioComponentDescription desc; - zeromem(&desc, sizeof(desc)); + memset(&desc, 0, sizeof(desc)); desc.componentType = kAudioUnitType_Output; #ifdef OSX_ENABLED desc.componentSubType = kAudioUnitSubType_HALOutput; @@ -97,7 +97,7 @@ Error AudioDriverCoreAudio::init() { AudioStreamBasicDescription strdesc; - zeromem(&strdesc, sizeof(strdesc)); + memset(&strdesc, 0, sizeof(strdesc)); UInt32 size = sizeof(strdesc); result = AudioUnitGetProperty(audio_unit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, kOutputBus, &strdesc, &size); ERR_FAIL_COND_V(result != noErr, FAILED); @@ -118,7 +118,7 @@ Error AudioDriverCoreAudio::init() { mix_rate = GLOBAL_GET("audio/driver/mix_rate"); - zeromem(&strdesc, sizeof(strdesc)); + memset(&strdesc, 0, sizeof(strdesc)); strdesc.mFormatID = kAudioFormatLinearPCM; strdesc.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked; strdesc.mChannelsPerFrame = channels; @@ -148,7 +148,7 @@ Error AudioDriverCoreAudio::init() { print_verbose("CoreAudio: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms"); AURenderCallbackStruct callback; - zeromem(&callback, sizeof(AURenderCallbackStruct)); + memset(&callback, 0, sizeof(AURenderCallbackStruct)); callback.inputProc = &AudioDriverCoreAudio::output_callback; callback.inputProcRefCon = this; result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, kOutputBus, &callback, sizeof(callback)); @@ -173,7 +173,7 @@ OSStatus AudioDriverCoreAudio::output_callback(void *inRefCon, if (!ad->active || !ad->try_lock()) { for (unsigned int i = 0; i < ioData->mNumberBuffers; i++) { AudioBuffer *abuf = &ioData->mBuffers[i]; - zeromem(abuf->mData, abuf->mDataByteSize); + memset(abuf->mData, 0, abuf->mDataByteSize); }; return 0; }; @@ -293,7 +293,7 @@ void AudioDriverCoreAudio::finish() { lock(); AURenderCallbackStruct callback; - zeromem(&callback, sizeof(AURenderCallbackStruct)); + memset(&callback, 0, sizeof(AURenderCallbackStruct)); result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, kOutputBus, &callback, sizeof(callback)); if (result != noErr) { ERR_PRINT("AudioUnitSetProperty failed"); @@ -337,7 +337,7 @@ void AudioDriverCoreAudio::finish() { Error AudioDriverCoreAudio::capture_init() { AudioComponentDescription desc; - zeromem(&desc, sizeof(desc)); + memset(&desc, 0, sizeof(desc)); desc.componentType = kAudioUnitType_Output; #ifdef OSX_ENABLED desc.componentSubType = kAudioUnitSubType_HALOutput; @@ -383,7 +383,7 @@ Error AudioDriverCoreAudio::capture_init() { #endif AudioStreamBasicDescription strdesc; - zeromem(&strdesc, sizeof(strdesc)); + memset(&strdesc, 0, sizeof(strdesc)); size = sizeof(strdesc); result = AudioUnitGetProperty(input_unit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, kInputBus, &strdesc, &size); ERR_FAIL_COND_V(result != noErr, FAILED); @@ -405,7 +405,7 @@ Error AudioDriverCoreAudio::capture_init() { mix_rate = GLOBAL_GET("audio/driver/mix_rate"); - zeromem(&strdesc, sizeof(strdesc)); + memset(&strdesc, 0, sizeof(strdesc)); strdesc.mFormatID = kAudioFormatLinearPCM; strdesc.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked; strdesc.mChannelsPerFrame = capture_channels; @@ -419,7 +419,7 @@ Error AudioDriverCoreAudio::capture_init() { ERR_FAIL_COND_V(result != noErr, FAILED); AURenderCallbackStruct callback; - zeromem(&callback, sizeof(AURenderCallbackStruct)); + memset(&callback, 0, sizeof(AURenderCallbackStruct)); callback.inputProc = &AudioDriverCoreAudio::input_callback; callback.inputProcRefCon = this; result = AudioUnitSetProperty(input_unit, kAudioOutputUnitProperty_SetInputCallback, kAudioUnitScope_Global, kInputBus, &callback, sizeof(callback)); @@ -436,7 +436,7 @@ void AudioDriverCoreAudio::capture_finish() { lock(); AURenderCallbackStruct callback; - zeromem(&callback, sizeof(AURenderCallbackStruct)); + memset(&callback, 0, sizeof(AURenderCallbackStruct)); OSStatus result = AudioUnitSetProperty(input_unit, kAudioOutputUnitProperty_SetInputCallback, kAudioUnitScope_Global, 0, &callback, sizeof(callback)); if (result != noErr) { ERR_PRINT("AudioUnitSetProperty failed"); |