Commit bc5b6470 authored by Max Kellermann's avatar Max Kellermann

pcm/Dsd2Pcm: use `sizet_t` instead of `unsigned`

parent 1708ae3e
......@@ -162,10 +162,10 @@ Dsd2Pcm::Reset() noexcept
}
inline float
Dsd2Pcm::CalcOutputSample(unsigned ffp) const noexcept
Dsd2Pcm::CalcOutputSample(size_t ffp) const noexcept
{
double acc = 0;
for (unsigned i = 0; i < CTABLES; ++i) {
for (size_t i = 0; i < CTABLES; ++i) {
unsigned bite1 = fifo[(ffp -i) & FIFOMASK] & 0xFF;
unsigned bite2 = fifo[(ffp-(CTABLES*2-1)+i) & FIFOMASK] & 0xFF;
acc += ctables[i][bite1] + ctables[i][bite2];
......@@ -179,7 +179,7 @@ Dsd2Pcm::Translate(size_t samples,
bool lsbf,
float *dst, ptrdiff_t dst_stride) noexcept
{
unsigned ffp = fifopos;
size_t ffp = fifopos;
while (samples-- > 0) {
unsigned bite1 = *src & 0xFFu;
if (lsbf) bite1 = bit_reverse(bite1);
......
......@@ -47,7 +47,7 @@ private:
static constexpr size_t FIFOMASK = FIFOSIZE - 1;
uint8_t fifo[FIFOSIZE];
unsigned fifopos;
size_t fifopos;
public:
Dsd2Pcm() noexcept {
......@@ -76,7 +76,7 @@ public:
float *dst, ptrdiff_t dst_stride) noexcept;
private:
float CalcOutputSample(unsigned ffp) const noexcept;
float CalcOutputSample(size_t ffp) const noexcept;
};
#endif /* include guard DSD2PCM_H_INCLUDED */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment