Style: Replaces uses of 0/NULL by nullptr (C++11)

Using clang-tidy's `modernize-use-nullptr`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
This commit is contained in:
Rémi Verschelde
2021-05-04 16:00:45 +02:00
parent 2b429b24b5
commit a828398655
633 changed files with 4454 additions and 4410 deletions

View File

@@ -89,17 +89,17 @@ private:
VideoStreamPlaybackWebm::VideoStreamPlaybackWebm() :
audio_track(0),
webm(NULL),
video(NULL),
audio(NULL),
video_frames(NULL),
audio_frame(NULL),
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(NULL),
mix_udata(NULL),
mix_callback(nullptr),
mix_udata(nullptr),
playing(false),
paused(false),
delay_compensation(0.0),
@@ -107,7 +107,7 @@ VideoStreamPlaybackWebm::VideoStreamPlaybackWebm() :
video_frame_delay(0.0),
video_pos(0.0),
texture(memnew(ImageTexture)),
pcm(NULL) {}
pcm(nullptr) {}
VideoStreamPlaybackWebm::~VideoStreamPlaybackWebm() {
delete_pointers();
}
@@ -124,7 +124,7 @@ bool VideoStreamPlaybackWebm::open_file(const String &p_file) {
pcm = (float *)memalloc(sizeof(float) * audio->getBufferSamples() * webm->getChannels());
} else {
memdelete(audio);
audio = NULL;
audio = nullptr;
}
frame_data.resize((webm->getWidth() * webm->getHeight()) << 2);
@@ -133,10 +133,10 @@ bool VideoStreamPlaybackWebm::open_file(const String &p_file) {
return true;
}
memdelete(video);
video = NULL;
video = nullptr;
}
memdelete(webm);
webm = NULL;
webm = nullptr;
return false;
}
@@ -144,13 +144,13 @@ void VideoStreamPlaybackWebm::stop() {
if (playing) {
delete_pointers();
pcm = NULL;
pcm = nullptr;
audio_frame = NULL;
video_frames = NULL;
audio_frame = nullptr;
video_frames = nullptr;
video = NULL;
audio = NULL;
video = nullptr;
audio = nullptr;
open_file(file_name); //Should not fail here...
@@ -396,7 +396,7 @@ Ref<VideoStreamPlayback> VideoStreamWebm::instance_playback() {
pb->set_audio_track(audio_track);
if (pb->open_file(file))
return pb;
return NULL;
return nullptr;
}
void VideoStreamWebm::set_file(const String &p_file) {