diff options
author | Max Kellermann <max@duempel.org> | 2013-10-15 22:04:17 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-15 22:47:39 +0200 |
commit | 509f8dab8946cfc311def89f62352c0881e73348 (patch) | |
tree | 913fbb714704bcffc0ca6b8f44cdfb293ec9ee24 /src/output/OssOutputPlugin.cxx | |
parent | 77429b6dd35e23efac92630bab35d935b9496345 (diff) | |
download | mpd-509f8dab8946cfc311def89f62352c0881e73348.tar.gz mpd-509f8dab8946cfc311def89f62352c0881e73348.tar.xz mpd-509f8dab8946cfc311def89f62352c0881e73348.zip |
Util/Macros: replacement for GLib's G_N_ELEMENTS()
Diffstat (limited to 'src/output/OssOutputPlugin.cxx')
-rw-r--r-- | src/output/OssOutputPlugin.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/output/OssOutputPlugin.cxx b/src/output/OssOutputPlugin.cxx index 781e2bf43..147ad7975 100644 --- a/src/output/OssOutputPlugin.cxx +++ b/src/output/OssOutputPlugin.cxx @@ -24,6 +24,7 @@ #include "system/fd_util.h" #include "util/Error.hxx" #include "util/Domain.hxx" +#include "util/Macros.hxx" #include "Log.hxx" #include <glib.h> @@ -133,7 +134,7 @@ oss_output_test_default_device(void) { int fd, i; - for (i = G_N_ELEMENTS(default_devices); --i >= 0; ) { + for (i = ARRAY_SIZE(default_devices); --i >= 0; ) { fd = open_cloexec(default_devices[i], O_WRONLY, 0); if (fd >= 0) { @@ -152,11 +153,11 @@ oss_output_test_default_device(void) static struct audio_output * oss_open_default(Error &error) { - int err[G_N_ELEMENTS(default_devices)]; - enum oss_stat ret[G_N_ELEMENTS(default_devices)]; + int err[ARRAY_SIZE(default_devices)]; + enum oss_stat ret[ARRAY_SIZE(default_devices)]; const config_param empty; - for (int i = G_N_ELEMENTS(default_devices); --i >= 0; ) { + for (int i = ARRAY_SIZE(default_devices); --i >= 0; ) { ret[i] = oss_stat_device(default_devices[i], &err[i]); if (ret[i] == OSS_STAT_NO_ERROR) { OssOutput *od = new OssOutput(); @@ -170,7 +171,7 @@ oss_open_default(Error &error) } } - for (int i = G_N_ELEMENTS(default_devices); --i >= 0; ) { + for (int i = ARRAY_SIZE(default_devices); --i >= 0; ) { const char *dev = default_devices[i]; switch(ret[i]) { case OSS_STAT_NO_ERROR: |