diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-12 17:01:17 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 10:01:56 +0200 |
commit | 1f6f364a56319eabd02c050746fe7df3f55ffee3 (patch) | |
tree | 8bebdce946466ce8e9476ccd46c9dba62c323938 /drivers/coreaudio | |
parent | e7c9d818766a119089873e4941e4865fb36883ec (diff) |
Port member initialization from constructor to declaration (C++11)
Using `clang-tidy`'s `modernize-use-default-member-init` check and
manual review of the changes, and some extra manual changes that
`clang-tidy` failed to do.
Also went manually through all of `core` to find occurrences that
`clang-tidy` couldn't handle, especially all initializations done
in a constructor without using initializer lists.
Diffstat (limited to 'drivers/coreaudio')
-rw-r--r-- | drivers/coreaudio/audio_driver_coreaudio.cpp | 15 | ||||
-rw-r--r-- | drivers/coreaudio/audio_driver_coreaudio.h | 20 |
2 files changed, 12 insertions, 23 deletions
diff --git a/drivers/coreaudio/audio_driver_coreaudio.cpp b/drivers/coreaudio/audio_driver_coreaudio.cpp index 21c3649445..76d2d13dfe 100644 --- a/drivers/coreaudio/audio_driver_coreaudio.cpp +++ b/drivers/coreaudio/audio_driver_coreaudio.cpp @@ -676,19 +676,8 @@ String AudioDriverCoreAudio::capture_get_device() { #endif -AudioDriverCoreAudio::AudioDriverCoreAudio() : - audio_unit(nullptr), - input_unit(nullptr), - active(false), - device_name("Default"), - capture_device_name("Default"), - mix_rate(0), - channels(2), - capture_channels(2), - buffer_frames(0) { +AudioDriverCoreAudio::AudioDriverCoreAudio() { samples_in.clear(); } -AudioDriverCoreAudio::~AudioDriverCoreAudio(){}; - -#endif +#endif // COREAUDIO_ENABLED diff --git a/drivers/coreaudio/audio_driver_coreaudio.h b/drivers/coreaudio/audio_driver_coreaudio.h index fb9473e230..89dd52181f 100644 --- a/drivers/coreaudio/audio_driver_coreaudio.h +++ b/drivers/coreaudio/audio_driver_coreaudio.h @@ -42,19 +42,19 @@ class AudioDriverCoreAudio : public AudioDriver { - AudioComponentInstance audio_unit; - AudioComponentInstance input_unit; + AudioComponentInstance audio_unit = nullptr; + AudioComponentInstance input_unit = nullptr; - bool active; + bool active = false; Mutex mutex; - String device_name; - String capture_device_name; + String device_name = "Default"; + String capture_device_name = "Default"; - int mix_rate; - unsigned int channels; - unsigned int capture_channels; - unsigned int buffer_frames; + int mix_rate = 0; + unsigned int channels = 2; + unsigned int capture_channels = 2; + unsigned int buffer_frames = 0; Vector<int32_t> samples_in; Vector<int16_t> input_buf; @@ -118,7 +118,7 @@ public: #endif AudioDriverCoreAudio(); - ~AudioDriverCoreAudio(); + ~AudioDriverCoreAudio() {} }; #endif |