From f851c4aa330e1064a66db50be62db2466f4fb768 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 5 Apr 2022 13:40:26 +0300 Subject: Fix some issues found by cppcheck. --- drivers/pulseaudio/audio_driver_pulseaudio.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/pulseaudio') diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index ef9bbc3483..0c27b76ed8 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -41,7 +41,7 @@ #endif void AudioDriverPulseAudio::pa_state_cb(pa_context *c, void *userdata) { - AudioDriverPulseAudio *ad = (AudioDriverPulseAudio *)userdata; + AudioDriverPulseAudio *ad = static_cast(userdata); switch (pa_context_get_state(c)) { case PA_CONTEXT_TERMINATED: @@ -65,7 +65,7 @@ void AudioDriverPulseAudio::pa_state_cb(pa_context *c, void *userdata) { } void AudioDriverPulseAudio::pa_sink_info_cb(pa_context *c, const pa_sink_info *l, int eol, void *userdata) { - AudioDriverPulseAudio *ad = (AudioDriverPulseAudio *)userdata; + AudioDriverPulseAudio *ad = static_cast(userdata); // If eol is set to a positive number, you're at the end of the list if (eol > 0) { @@ -84,7 +84,7 @@ void AudioDriverPulseAudio::pa_sink_info_cb(pa_context *c, const pa_sink_info *l } void AudioDriverPulseAudio::pa_source_info_cb(pa_context *c, const pa_source_info *l, int eol, void *userdata) { - AudioDriverPulseAudio *ad = (AudioDriverPulseAudio *)userdata; + AudioDriverPulseAudio *ad = static_cast(userdata); // If eol is set to a positive number, you're at the end of the list if (eol > 0) { @@ -104,7 +104,7 @@ void AudioDriverPulseAudio::pa_source_info_cb(pa_context *c, const pa_source_inf void AudioDriverPulseAudio::pa_server_info_cb(pa_context *c, const pa_server_info *i, void *userdata) { ERR_FAIL_COND_MSG(!i, "PulseAudio server info is null."); - AudioDriverPulseAudio *ad = (AudioDriverPulseAudio *)userdata; + AudioDriverPulseAudio *ad = static_cast(userdata); ad->capture_default_device = i->default_source_name; ad->default_device = i->default_sink_name; @@ -588,7 +588,7 @@ AudioDriver::SpeakerMode AudioDriverPulseAudio::get_speaker_mode() const { } void AudioDriverPulseAudio::pa_sinklist_cb(pa_context *c, const pa_sink_info *l, int eol, void *userdata) { - AudioDriverPulseAudio *ad = (AudioDriverPulseAudio *)userdata; + AudioDriverPulseAudio *ad = static_cast(userdata); // If eol is set to a positive number, you're at the end of the list if (eol > 0) { @@ -771,7 +771,7 @@ void AudioDriverPulseAudio::capture_set_device(const String &p_name) { } void AudioDriverPulseAudio::pa_sourcelist_cb(pa_context *c, const pa_source_info *l, int eol, void *userdata) { - AudioDriverPulseAudio *ad = (AudioDriverPulseAudio *)userdata; + AudioDriverPulseAudio *ad = static_cast(userdata); // If eol is set to a positive number, you're at the end of the list if (eol > 0) { -- cgit v1.2.3