citra-emu
/
citra
Archived
1
0
Fork 0

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>
This commit is contained in:
Tobias 2020-12-07 16:06:16 +01:00 committed by GitHub
parent f0e3637c7a
commit 3f13e1cc24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -117,8 +117,8 @@ void CubebSink::SetCallback(std::function<void(s16*, std::size_t)> 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<Impl*>(user_data);
s16* buffer = reinterpret_cast<s16*>(output_buffer);
auto* impl = static_cast<Impl*>(user_data);
auto* buffer = static_cast<s16*>(output_buffer);
if (!impl || !impl->cb) {
LOG_DEBUG(Audio_Sink, "Emitting zeros");