From 54d51842553efd3af151836636ab821efee6c961 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 7 Nov 2016 08:50:58 +0100 Subject: [PATCH] output/winmm: use std::array --- src/output/plugins/WinmmOutputPlugin.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/output/plugins/WinmmOutputPlugin.cxx b/src/output/plugins/WinmmOutputPlugin.cxx index 7301cf369..a92286166 100644 --- a/src/output/plugins/WinmmOutputPlugin.cxx +++ b/src/output/plugins/WinmmOutputPlugin.cxx @@ -28,6 +28,8 @@ #include "util/Macros.hxx" #include "util/StringCompare.hxx" +#include + #include #include @@ -51,7 +53,7 @@ class WinmmOutput { */ HANDLE event; - WinmmBuffer buffers[8]; + std::array buffers; unsigned next_buffer; public: @@ -275,7 +277,7 @@ WinmmOutput::Play(const void *chunk, size_t size, Error &) } /* mark our buffer as "used" */ - next_buffer = (next_buffer + 1) % ARRAY_SIZE(buffers); + next_buffer = (next_buffer + 1) % buffers.size(); return size; } @@ -283,7 +285,7 @@ WinmmOutput::Play(const void *chunk, size_t size, Error &) void WinmmOutput::DrainAllBuffers() { - for (unsigned i = next_buffer; i < ARRAY_SIZE(buffers); ++i) + for (unsigned i = next_buffer; i < buffers.size(); ++i) DrainBuffer(buffers[i]); for (unsigned i = 0; i < next_buffer; ++i)