Style: Partially apply clang-tidy's cppcoreguidelines-pro-type-member-init

Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
This commit is contained in:
Rémi Verschelde 2022-05-02 16:28:25 +02:00
parent dd06cb90c5
commit c273ddc3ee
156 changed files with 749 additions and 951 deletions

View file

@ -29,7 +29,9 @@
/*************************************************************************/
#include "audio_effect_stereo_enhance.h"
#include "servers/audio_server.h"
void AudioEffectStereoEnhanceInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) {
float intensity = base->pan_pullout;
bool surround_mode = base->surround > 0;
@ -140,8 +142,4 @@ void AudioEffectStereoEnhance::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "surround", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_surround", "get_surround");
}
AudioEffectStereoEnhance::AudioEffectStereoEnhance() {
pan_pullout = 1;
time_pullout = 0;
surround = 0;
}
AudioEffectStereoEnhance::AudioEffectStereoEnhance() {}

View file

@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef AUDIOEFFECTSTEREOENHANCE_H
#define AUDIOEFFECTSTEREOENHANCE_H
#ifndef AUDIO_EFFECT_STEREO_ENHANCE_H
#define AUDIO_EFFECT_STEREO_ENHANCE_H
#include "servers/audio/audio_effect.h"
@ -45,8 +45,8 @@ class AudioEffectStereoEnhanceInstance : public AudioEffectInstance {
};
float *delay_ringbuff = nullptr;
unsigned int ringbuff_pos;
unsigned int ringbuff_mask;
unsigned int ringbuff_pos = 0;
unsigned int ringbuff_mask = 0;
public:
virtual void process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) override;
@ -58,11 +58,11 @@ class AudioEffectStereoEnhance : public AudioEffect {
GDCLASS(AudioEffectStereoEnhance, AudioEffect);
friend class AudioEffectStereoEnhanceInstance;
float volume_db;
float volume_db = 0.0f;
float pan_pullout;
float time_pullout;
float surround;
float pan_pullout = 1.0f;
float time_pullout = 0.0f;
float surround = 0.0f;
protected:
static void _bind_methods();
@ -82,4 +82,4 @@ public:
AudioEffectStereoEnhance();
};
#endif // AUDIOEFFECTSTEREOENHANCE_H
#endif // AUDIO_EFFECT_STEREO_ENHANCE_H

View file

@ -28,8 +28,6 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
// Author: Juan Linietsky <reduzio@gmail.com>, (C) 2006
#include "reverb.h"
#include "core/math/math_funcs.h"

View file

@ -77,10 +77,11 @@ private:
AllPass allpass[MAX_ALLPASS];
float *input_buffer = nullptr;
float *echo_buffer = nullptr;
int echo_buffer_size;
int echo_buffer_pos;
int echo_buffer_size = 0;
int echo_buffer_pos = 0;
float hpf_h1, hpf_h2 = 0;
float hpf_h1 = 0.0f;
float hpf_h2 = 0.0f;
struct Parameters {
float room_size;