array conversions

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2021-11-13 17:27:07 -08:00
parent e08c85ae2d
commit 9bcd425a85
5 changed files with 12 additions and 10 deletions

View File

@@ -172,7 +172,7 @@ void
Dsd2Pcm::Reset() noexcept
{
/* my favorite silence pattern */
std::fill_n(fifo, std::size(fifo), 0x69);
fifo.fill(0x69);
fifopos = 0;
/* 0x69 = 01101001
@@ -186,7 +186,7 @@ inline void
Dsd2Pcm::ApplySample(size_t ffp, uint8_t src) noexcept
{
fifo[ffp] = src;
uint8_t *p = fifo + ((ffp-CTABLES) & FIFOMASK);
uint8_t *p = fifo.data() + ((ffp-CTABLES) & FIFOMASK);
*p = bit_reverse(*p);
}

View File

@@ -51,7 +51,7 @@ private:
/** bit mask for FIFO offsets */
static constexpr size_t FIFOMASK = FIFOSIZE - 1;
uint8_t fifo[FIFOSIZE];
std::array<uint8_t, FIFOSIZE> fifo;
size_t fifopos;
public: