From 77226bc0d84a58b9fd00c36dfc8531e5cd9acdbe Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 13 Nov 2024 10:42:31 +0100 Subject: [PATCH] test/ReadFrames: pass std::span to FileDescriptor::Read() --- test/ReadFrames.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/ReadFrames.cxx b/test/ReadFrames.cxx index cdf58baa3..d6fe3f48d 100644 --- a/test/ReadFrames.cxx +++ b/test/ReadFrames.cxx @@ -6,9 +6,9 @@ #include "io/FileDescriptor.hxx" static size_t -ReadOrThrow(FileDescriptor fd, void *buffer, size_t size) +ReadOrThrow(FileDescriptor fd, std::span dest) { - auto nbytes = fd.Read(buffer, size); + auto nbytes = fd.Read(dest); if (nbytes < 0) throw MakeErrno("Read failed"); @@ -23,7 +23,7 @@ ReadFrames(FileDescriptor fd, void *_buffer, std::size_t size, size = (size / frame_size) * frame_size; - size_t nbytes = ReadOrThrow(fd, buffer, size); + size_t nbytes = ReadOrThrow(fd, {buffer, size}); const size_t modulo = nbytes % frame_size; if (modulo > 0) {