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<size_type>()

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2023-12-28 20:23:39 -08:00
parent 13202bfce4
commit a859de6806

View File

@ -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<size_t>(num_frames) * frame_size},
0);
if (cmd == DecoderCommand::SEEK) {
sf_count_t c = client.GetSeekFrame();