diff options
author | Max Kellermann <max@duempel.org> | 2013-12-15 22:39:30 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-12-15 23:07:08 +0100 |
commit | 1f523be72decf652dfe64ac6885770d8e86de0c7 (patch) | |
tree | 530d9367773757f1f3b826a7afd1d4daa5ffd9b6 /src/util/PeakBuffer.cxx | |
parent | f2a20a0a800e879b0e52681b7f9b8829047c55a7 (diff) | |
download | mpd-1f523be72decf652dfe64ac6885770d8e86de0c7.tar.gz mpd-1f523be72decf652dfe64ac6885770d8e86de0c7.tar.xz mpd-1f523be72decf652dfe64ac6885770d8e86de0c7.zip |
util/PeakBuffer: return ConstBuffer<void>
Diffstat (limited to 'src/util/PeakBuffer.cxx')
-rw-r--r-- | src/util/PeakBuffer.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/util/PeakBuffer.cxx b/src/util/PeakBuffer.cxx index a3659b8f4..7db1c97dc 100644 --- a/src/util/PeakBuffer.cxx +++ b/src/util/PeakBuffer.cxx @@ -45,19 +45,21 @@ PeakBuffer::IsEmpty() const fifo_buffer_is_empty(peak_buffer)); } -const void * -PeakBuffer::Read(size_t *length_r) const +ConstBuffer<void> +PeakBuffer::Read() const { if (normal_buffer != nullptr) { - const void *p = fifo_buffer_read(normal_buffer, length_r); + size_t size; + const void *p = fifo_buffer_read(normal_buffer, &size); if (p != nullptr) - return p; + return { p, size }; } if (peak_buffer != nullptr) { - const void *p = fifo_buffer_read(peak_buffer, length_r); + size_t size; + const void *p = fifo_buffer_read(peak_buffer, &size); if (p != nullptr) - return p; + return { p, size }; } return nullptr; |