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.
This commit is contained in:
Rémi Verschelde
2020-05-12 17:01:17 +02:00
parent e7c9d81876
commit 1f6f364a56
325 changed files with 1689 additions and 3480 deletions

View File

@ -793,30 +793,9 @@ String AudioDriverPulseAudio::capture_get_device() {
return name;
}
AudioDriverPulseAudio::AudioDriverPulseAudio() :
thread(nullptr),
pa_ml(nullptr),
pa_ctx(nullptr),
pa_str(nullptr),
pa_rec_str(nullptr),
device_name("Default"),
new_device("Default"),
default_device(""),
mix_rate(0),
buffer_frames(0),
pa_buffer_size(0),
channels(0),
pa_ready(0),
pa_status(0),
active(false),
thread_exited(false),
exit_thread(false),
latency(0) {
AudioDriverPulseAudio::AudioDriverPulseAudio() {
samples_in.clear();
samples_out.clear();
}
AudioDriverPulseAudio::~AudioDriverPulseAudio() {
}
#endif
#endif // PULSEAUDIO_ENABLED

View File

@ -41,18 +41,18 @@
class AudioDriverPulseAudio : public AudioDriver {
Thread *thread;
Thread *thread = nullptr;
Mutex mutex;
pa_mainloop *pa_ml;
pa_context *pa_ctx;
pa_stream *pa_str;
pa_stream *pa_rec_str;
pa_mainloop *pa_ml = nullptr;
pa_context *pa_ctx = nullptr;
pa_stream *pa_str = nullptr;
pa_stream *pa_rec_str = nullptr;
pa_channel_map pa_map;
pa_channel_map pa_rec_map;
String device_name;
String new_device;
String device_name = "Default";
String new_device = "Default";
String default_device;
String capture_device_name;
@ -62,20 +62,20 @@ class AudioDriverPulseAudio : public AudioDriver {
Vector<int32_t> samples_in;
Vector<int16_t> samples_out;
unsigned int mix_rate;
unsigned int buffer_frames;
unsigned int pa_buffer_size;
int channels;
int pa_ready;
int pa_status;
unsigned int mix_rate = 0;
unsigned int buffer_frames = 0;
unsigned int pa_buffer_size = 0;
int channels = 0;
int pa_ready = 0;
int pa_status = 0;
Array pa_devices;
Array pa_rec_devices;
bool active;
bool thread_exited;
mutable bool exit_thread;
bool active = false;
bool thread_exited = false;
mutable bool exit_thread = false;
float latency;
float latency = 0;
static void pa_state_cb(pa_context *c, void *userdata);
static void pa_sink_info_cb(pa_context *c, const pa_sink_info *l, int eol, void *userdata);
@ -122,7 +122,7 @@ public:
virtual Error capture_stop();
AudioDriverPulseAudio();
~AudioDriverPulseAudio();
~AudioDriverPulseAudio() {}
};
#endif // AUDIO_DRIVER_PULSEAUDIO_H