From a859de68062a2b5c9aa660bd3e93a19082320f45 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 28 Dec 2023 20:23:39 -0800 Subject: [PATCH] sndfile: fix compilation with clang's libc++ error: non-constant-expression cannot be narrowed from type 'sf_count_t' (aka 'long long') to 'size_type' (aka 'unsigned int') in initializer list [-Wc++11-narrowing] 215 | std::span{buffer, num_frames * frame_size}, | ^~~~~~~~~~~~~~~~~~~~~~~ note: insert an explicit cast to silence this issue 215 | std::span{buffer, num_frames * frame_size}, | ^~~~~~~~~~~~~~~~~~~~~~~ | static_cast() Signed-off-by: Rosen Penev --- src/decoder/plugins/SndfileDecoderPlugin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decoder/plugins/SndfileDecoderPlugin.cxx b/src/decoder/plugins/SndfileDecoderPlugin.cxx index 94c2e964e..953c15c62 100644 --- a/src/decoder/plugins/SndfileDecoderPlugin.cxx +++ b/src/decoder/plugins/SndfileDecoderPlugin.cxx @@ -212,7 +212,7 @@ sndfile_stream_decode(DecoderClient &client, InputStream &is) break; cmd = client.SubmitAudio(is, - std::span{buffer, num_frames * frame_size}, + std::span{buffer, static_cast(num_frames) * frame_size}, 0); if (cmd == DecoderCommand::SEEK) { sf_count_t c = client.GetSeekFrame();