summaryrefslogtreecommitdiff
path: root/servers/audio
diff options
context:
space:
mode:
authorlupoDharkael <izhe@hotmail.es>2020-04-02 01:20:12 +0200
committerlupoDharkael <izhe@hotmail.es>2020-04-02 13:38:00 +0200
commit95a1400a2ac9de1a29fa305f45b928ce8e3044bd (patch)
treebe0cd59e5a90926e9d653fed9f3b1b77e735ca2f /servers/audio
parent5f11e1557156617366d2c316a97716172103980d (diff)
Replace NULL with nullptr
Diffstat (limited to 'servers/audio')
-rw-r--r--servers/audio/audio_driver_dummy.cpp6
-rw-r--r--servers/audio/audio_filter_sw.cpp2
-rw-r--r--servers/audio/audio_rb_resampler.cpp8
-rw-r--r--servers/audio/audio_rb_resampler.h2
-rw-r--r--servers/audio/effects/audio_effect_record.cpp8
-rw-r--r--servers/audio/effects/audio_stream_generator.cpp2
-rw-r--r--servers/audio/effects/reverb.cpp6
7 files changed, 17 insertions, 17 deletions
diff --git a/servers/audio/audio_driver_dummy.cpp b/servers/audio/audio_driver_dummy.cpp
index 69b098edfc..ed67e8902a 100644
--- a/servers/audio/audio_driver_dummy.cpp
+++ b/servers/audio/audio_driver_dummy.cpp
@@ -38,7 +38,7 @@ Error AudioDriverDummy::init() {
active = false;
thread_exited = false;
exit_thread = false;
- samples_in = NULL;
+ samples_in = nullptr;
mix_rate = DEFAULT_MIX_RATE;
speaker_mode = SPEAKER_MODE_STEREO;
@@ -119,12 +119,12 @@ void AudioDriverDummy::finish() {
};
memdelete(thread);
- thread = NULL;
+ thread = nullptr;
};
AudioDriverDummy::AudioDriverDummy() {
- thread = NULL;
+ thread = nullptr;
};
AudioDriverDummy::~AudioDriverDummy(){
diff --git a/servers/audio/audio_filter_sw.cpp b/servers/audio/audio_filter_sw.cpp
index c0bf4f3a55..2771fc177b 100644
--- a/servers/audio/audio_filter_sw.cpp
+++ b/servers/audio/audio_filter_sw.cpp
@@ -237,7 +237,7 @@ AudioFilterSW::AudioFilterSW() {
AudioFilterSW::Processor::Processor() {
- set_filter(NULL);
+ set_filter(nullptr);
}
void AudioFilterSW::Processor::set_filter(AudioFilterSW *p_filter, bool p_clear_history) {
diff --git a/servers/audio/audio_rb_resampler.cpp b/servers/audio/audio_rb_resampler.cpp
index 092c3315ee..0ac7ddc7a9 100644
--- a/servers/audio/audio_rb_resampler.cpp
+++ b/servers/audio/audio_rb_resampler.cpp
@@ -203,18 +203,18 @@ void AudioRBResampler::clear() {
//should be stopped at this point but just in case
memdelete_arr(rb);
memdelete_arr(read_buf);
- rb = NULL;
+ rb = nullptr;
offset = 0;
rb_read_pos = 0;
rb_write_pos = 0;
- read_buf = NULL;
+ read_buf = nullptr;
}
AudioRBResampler::AudioRBResampler() {
- rb = NULL;
+ rb = nullptr;
offset = 0;
- read_buf = NULL;
+ read_buf = nullptr;
rb_read_pos = 0;
rb_write_pos = 0;
diff --git a/servers/audio/audio_rb_resampler.h b/servers/audio/audio_rb_resampler.h
index 8cd9714d57..40cf3e4cd7 100644
--- a/servers/audio/audio_rb_resampler.h
+++ b/servers/audio/audio_rb_resampler.h
@@ -69,7 +69,7 @@ public:
}
_FORCE_INLINE_ bool is_ready() const {
- return rb != NULL;
+ return rb != nullptr;
}
_FORCE_INLINE_ int get_total() const {
diff --git a/servers/audio/effects/audio_effect_record.cpp b/servers/audio/effects/audio_effect_record.cpp
index 8f0c55ad83..f2784679b5 100644
--- a/servers/audio/effects/audio_effect_record.cpp
+++ b/servers/audio/effects/audio_effect_record.cpp
@@ -178,14 +178,14 @@ Ref<AudioEffectInstance> AudioEffectRecord::instance() {
void AudioEffectRecord::ensure_thread_stopped() {
recording_active = false;
- if (current_instance != 0) {
+ if (current_instance != nullptr) {
current_instance->finish();
}
}
void AudioEffectRecord::set_recording_active(bool p_record) {
if (p_record) {
- if (current_instance == 0) {
+ if (current_instance == nullptr) {
WARN_PRINT("Recording should not be set as active before Godot has initialized.");
recording_active = false;
return;
@@ -217,8 +217,8 @@ Ref<AudioStreamSample> AudioEffectRecord::get_recording() const {
Vector<uint8_t> dst_data;
- ERR_FAIL_COND_V(current_instance.is_null(), NULL);
- ERR_FAIL_COND_V(current_instance->recording_data.size() == 0, NULL);
+ ERR_FAIL_COND_V(current_instance.is_null(), nullptr);
+ ERR_FAIL_COND_V(current_instance->recording_data.size() == 0, nullptr);
if (dst_format == AudioStreamSample::FORMAT_8_BITS) {
int data_size = current_instance->recording_data.size();
diff --git a/servers/audio/effects/audio_stream_generator.cpp b/servers/audio/effects/audio_stream_generator.cpp
index 5f24cf3d6b..d272a2cdf7 100644
--- a/servers/audio/effects/audio_stream_generator.cpp
+++ b/servers/audio/effects/audio_stream_generator.cpp
@@ -205,7 +205,7 @@ void AudioStreamGeneratorPlayback::_bind_methods() {
}
AudioStreamGeneratorPlayback::AudioStreamGeneratorPlayback() {
- generator = NULL;
+ generator = nullptr;
skips = 0;
active = false;
mixed = 0;
diff --git a/servers/audio/effects/reverb.cpp b/servers/audio/effects/reverb.cpp
index 9946a5eeef..ea2174f1d4 100644
--- a/servers/audio/effects/reverb.cpp
+++ b/servers/audio/effects/reverb.cpp
@@ -314,7 +314,7 @@ void Reverb::clear_buffers() {
if (comb[i].buffer)
memdelete_arr(comb[i].buffer);
- comb[i].buffer = 0;
+ comb[i].buffer = nullptr;
}
for (int i = 0; i < MAX_ALLPASS; i++) {
@@ -322,7 +322,7 @@ void Reverb::clear_buffers() {
if (allpass[i].buffer)
memdelete_arr(allpass[i].buffer);
- allpass[i].buffer = 0;
+ allpass[i].buffer = nullptr;
}
}
@@ -342,7 +342,7 @@ Reverb::Reverb() {
hpf_h2 = 0;
input_buffer = memnew_arr(float, INPUT_BUFFER_MAX_SIZE);
- echo_buffer = 0;
+ echo_buffer = nullptr;
configure_buffers();
update_parameters();