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 /modules/webm | |
| parent | e7c9d818766a119089873e4941e4865fb36883ec (diff) | |
| download | redot-engine-1f6f364a56319eabd02c050746fe7df3f55ffee3.tar.gz | |
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 'modules/webm')
| -rw-r--r-- | modules/webm/video_stream_webm.cpp | 25 | ||||
| -rw-r--r-- | modules/webm/video_stream_webm.h | 28 |
2 files changed, 17 insertions, 36 deletions
diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index a2d0f78f5f..faf1f32124 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -95,26 +95,8 @@ private: /**/ VideoStreamPlaybackWebm::VideoStreamPlaybackWebm() : - audio_track(0), - webm(nullptr), - video(nullptr), - audio(nullptr), - video_frames(nullptr), - audio_frame(nullptr), - video_frames_pos(0), - video_frames_capacity(0), - num_decoded_samples(0), - samples_offset(-1), - mix_callback(nullptr), - mix_udata(nullptr), - playing(false), - paused(false), - delay_compensation(0.0), - time(0.0), - video_frame_delay(0.0), - video_pos(0.0), - texture(memnew(ImageTexture)), - pcm(nullptr) {} + + texture(memnew(ImageTexture)) {} VideoStreamPlaybackWebm::~VideoStreamPlaybackWebm() { delete_pointers(); @@ -438,8 +420,7 @@ void VideoStreamPlaybackWebm::delete_pointers() { /**/ -VideoStreamWebm::VideoStreamWebm() : - audio_track(0) {} +VideoStreamWebm::VideoStreamWebm() {} Ref<VideoStreamPlayback> VideoStreamWebm::instance_playback() { diff --git a/modules/webm/video_stream_webm.h b/modules/webm/video_stream_webm.h index 6677fb85aa..0a32dfc671 100644 --- a/modules/webm/video_stream_webm.h +++ b/modules/webm/video_stream_webm.h @@ -44,27 +44,27 @@ class VideoStreamPlaybackWebm : public VideoStreamPlayback { GDCLASS(VideoStreamPlaybackWebm, VideoStreamPlayback); String file_name; - int audio_track; + int audio_track = 0; - WebMDemuxer *webm; - VPXDecoder *video; - OpusVorbisDecoder *audio; + WebMDemuxer *webm = nullptr; + VPXDecoder *video = nullptr; + OpusVorbisDecoder *audio = nullptr; - WebMFrame **video_frames, *audio_frame; - int video_frames_pos, video_frames_capacity; + WebMFrame **video_frames = nullptr, *audio_frame = nullptr; + int video_frames_pos = 0, video_frames_capacity = 0; - int num_decoded_samples, samples_offset; - AudioMixCallback mix_callback; - void *mix_udata; + int num_decoded_samples = 0, samples_offset = -1; + AudioMixCallback mix_callback = nullptr; + void *mix_udata = nullptr; - bool playing, paused; - double delay_compensation; - double time, video_frame_delay, video_pos; + bool playing = false, paused = false; + double delay_compensation = 0.0; + double time = 0.0, video_frame_delay = 0.0, video_pos = 0.0; Vector<uint8_t> frame_data; Ref<ImageTexture> texture; - float *pcm; + float *pcm = nullptr; public: VideoStreamPlaybackWebm(); @@ -111,7 +111,7 @@ class VideoStreamWebm : public VideoStream { GDCLASS(VideoStreamWebm, VideoStream); String file; - int audio_track; + int audio_track = 0; protected: static void _bind_methods(); |
