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/alsa | |
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/alsa')
-rw-r--r-- | drivers/alsa/audio_driver_alsa.cpp | 12 | ||||
-rw-r--r-- | drivers/alsa/audio_driver_alsa.h | 12 |
2 files changed, 7 insertions, 17 deletions
diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp index 48e694dd3a..e394222d3a 100644 --- a/drivers/alsa/audio_driver_alsa.cpp +++ b/drivers/alsa/audio_driver_alsa.cpp @@ -331,14 +331,4 @@ void AudioDriverALSA::finish() { finish_device(); } -AudioDriverALSA::AudioDriverALSA() : - thread(nullptr), - pcm_handle(nullptr), - device_name("Default"), - new_device("Default") { -} - -AudioDriverALSA::~AudioDriverALSA() { -} - -#endif +#endif // ALSA_ENABLED diff --git a/drivers/alsa/audio_driver_alsa.h b/drivers/alsa/audio_driver_alsa.h index 50bd9e853d..d437993901 100644 --- a/drivers/alsa/audio_driver_alsa.h +++ b/drivers/alsa/audio_driver_alsa.h @@ -41,13 +41,13 @@ class AudioDriverALSA : public AudioDriver { - Thread *thread; + Thread *thread = nullptr; Mutex mutex; - snd_pcm_t *pcm_handle; + snd_pcm_t *pcm_handle = nullptr; - String device_name; - String new_device; + String device_name = "Default"; + String new_device = "Default"; Vector<int32_t> samples_in; Vector<int16_t> samples_out; @@ -85,8 +85,8 @@ public: virtual void unlock(); virtual void finish(); - AudioDriverALSA(); - ~AudioDriverALSA(); + AudioDriverALSA() {} + ~AudioDriverALSA() {} }; #endif // AUDIO_DRIVER_ALSA_H |