From 3f13e1cc2419fac837952c44d7be9db78b054a2f Mon Sep 17 00:00:00 2001 From: Tobias Date: Mon, 7 Dec 2020 16:06:16 +0100 Subject: [PATCH] cubeb_sink: Use static_cast instead of reinterpret_cast in DataCallback() (#5573) Conversions from void* to the proper data type are well-defined and supported by static_cast. We don't need to use reinterpret_cast here. Co-Authored-By: LC <712067+lioncash@users.noreply.github.com> Co-authored-by: LC <712067+lioncash@users.noreply.github.com> --- src/audio_core/cubeb_sink.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio_core/cubeb_sink.cpp b/src/audio_core/cubeb_sink.cpp index ec09f7030..16f25f9da 100644 --- a/src/audio_core/cubeb_sink.cpp +++ b/src/audio_core/cubeb_sink.cpp @@ -117,8 +117,8 @@ void CubebSink::SetCallback(std::function cb) { long CubebSink::Impl::DataCallback(cubeb_stream* stream, void* user_data, const void* input_buffer, void* output_buffer, long num_frames) { - Impl* impl = static_cast(user_data); - s16* buffer = reinterpret_cast(output_buffer); + auto* impl = static_cast(user_data); + auto* buffer = static_cast(output_buffer); if (!impl || !impl->cb) { LOG_DEBUG(Audio_Sink, "Emitting zeros");