diff options
author | Max Kellermann <max@musicpd.org> | 2019-08-03 13:10:49 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-08-03 13:10:49 +0200 |
commit | cde6c46d2fff083166c3aca7fbf07df737c07cdc (patch) | |
tree | 51c5706d03b6ea61fa6dad6566dfa67bc090efda /src/output/plugins/OssOutputPlugin.cxx | |
parent | d305f187d5268a040aca6df62849c33b05308963 (diff) |
util/Macros: replace with std::size() (C++17)
Diffstat (limited to 'src/output/plugins/OssOutputPlugin.cxx')
-rw-r--r-- | src/output/plugins/OssOutputPlugin.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/output/plugins/OssOutputPlugin.cxx b/src/output/plugins/OssOutputPlugin.cxx index 5bbb3983d..6449ceaf1 100644 --- a/src/output/plugins/OssOutputPlugin.cxx +++ b/src/output/plugins/OssOutputPlugin.cxx @@ -24,10 +24,10 @@ #include "system/Error.hxx" #include "util/ConstBuffer.hxx" #include "util/Domain.hxx" -#include "util/Macros.hxx" #include "util/ByteOrder.hxx" #include "Log.hxx" +#include <iterator> #include <stdexcept> #include <sys/stat.h> @@ -168,7 +168,7 @@ static const char *const default_devices[] = { "/dev/sound/dsp", "/dev/dsp" }; static bool oss_output_test_default_device() noexcept { - for (int i = ARRAY_SIZE(default_devices); --i >= 0; ) { + for (int i = std::size(default_devices); --i >= 0; ) { UniqueFileDescriptor fd; if (fd.Open(default_devices[i], O_WRONLY, 0)) return true; @@ -184,16 +184,16 @@ oss_output_test_default_device() noexcept static OssOutput * oss_open_default() { - int err[ARRAY_SIZE(default_devices)]; - enum oss_stat ret[ARRAY_SIZE(default_devices)]; + int err[std::size(default_devices)]; + enum oss_stat ret[std::size(default_devices)]; - for (int i = ARRAY_SIZE(default_devices); --i >= 0; ) { + for (int i = std::size(default_devices); --i >= 0; ) { ret[i] = oss_stat_device(default_devices[i], &err[i]); if (ret[i] == OSS_STAT_NO_ERROR) return new OssOutput(default_devices[i]); } - for (int i = ARRAY_SIZE(default_devices); --i >= 0; ) { + for (int i = std::size(default_devices); --i >= 0; ) { const char *dev = default_devices[i]; switch(ret[i]) { case OSS_STAT_NO_ERROR: |