aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-15 22:04:17 +0200
committerMax Kellermann <max@duempel.org>2013-10-15 22:47:39 +0200
commit509f8dab8946cfc311def89f62352c0881e73348 (patch)
tree913fbb714704bcffc0ca6b8f44cdfb293ec9ee24 /src/pcm
parent77429b6dd35e23efac92630bab35d935b9496345 (diff)
downloadmpd-509f8dab8946cfc311def89f62352c0881e73348.tar.gz
mpd-509f8dab8946cfc311def89f62352c0881e73348.tar.xz
mpd-509f8dab8946cfc311def89f62352c0881e73348.zip
Util/Macros: replacement for GLib's G_N_ELEMENTS()
Diffstat (limited to 'src/pcm')
-rw-r--r--src/pcm/PcmDsd.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/pcm/PcmDsd.cxx b/src/pcm/PcmDsd.cxx
index 096c5464a..4db274635 100644
--- a/src/pcm/PcmDsd.cxx
+++ b/src/pcm/PcmDsd.cxx
@@ -20,8 +20,7 @@
#include "config.h"
#include "PcmDsd.hxx"
#include "dsd2pcm/dsd2pcm.h"
-
-#include <glib.h>
+#include "util/Macros.hxx"
#include <algorithm>
@@ -30,12 +29,12 @@
PcmDsd::PcmDsd()
{
- std::fill_n(dsd2pcm, G_N_ELEMENTS(dsd2pcm), nullptr);
+ std::fill_n(dsd2pcm, ARRAY_SIZE(dsd2pcm), nullptr);
}
PcmDsd::~PcmDsd()
{
- for (unsigned i = 0; i < G_N_ELEMENTS(dsd2pcm); ++i)
+ for (unsigned i = 0; i < ARRAY_SIZE(dsd2pcm); ++i)
if (dsd2pcm[i] != nullptr)
dsd2pcm_destroy(dsd2pcm[i]);
}
@@ -43,7 +42,7 @@ PcmDsd::~PcmDsd()
void
PcmDsd::Reset()
{
- for (unsigned i = 0; i < G_N_ELEMENTS(dsd2pcm); ++i)
+ for (unsigned i = 0; i < ARRAY_SIZE(dsd2pcm); ++i)
if (dsd2pcm[i] != nullptr)
dsd2pcm_reset(dsd2pcm[i]);
}
@@ -56,7 +55,7 @@ PcmDsd::ToFloat(unsigned channels, bool lsbfirst,
assert(src != nullptr);
assert(src_size > 0);
assert(src_size % channels == 0);
- assert(channels <= G_N_ELEMENTS(dsd2pcm));
+ assert(channels <= ARRAY_SIZE(dsd2pcm));
const unsigned num_samples = src_size;
const unsigned num_frames = src_size / channels;