pcm/Dsd2Pcm: use sizet_t instead of int

This commit is contained in:
Max Kellermann 2020-01-14 22:39:12 +01:00
parent a65f7b1006
commit 2d5bf53240
2 changed files with 5 additions and 4 deletions

View File

@ -41,7 +41,7 @@ or implied, of Sebastian Gesemann.
static constexpr size_t HTAPS = 48;
/** number of "8 MACs" lookup tables */
static constexpr int CTABLES = (HTAPS + 7) / 8;
static constexpr size_t CTABLES = (HTAPS + 7) / 8;
static_assert(Dsd2Pcm::FIFOSIZE * 8 >= HTAPS * 2, "FIFOSIZE too small");
@ -117,7 +117,7 @@ static constexpr double htaps[HTAPS] = {
};
static constexpr float
CalculateCtableValue(int t, int k, int e) noexcept
CalculateCtableValue(size_t t, int k, int e) noexcept
{
double acc = 0;
for (int m = 0; m < k; ++m) {
@ -130,7 +130,8 @@ CalculateCtableValue(int t, int k, int e) noexcept
/* this needs to be a struct because GCC 6 doesn't have constexpr
lambdas (C++17) */
struct GenerateCtableValue {
int t, k;
size_t t;
int k;
constexpr auto operator()(int e) const noexcept {
return CalculateCtableValue(t, k, e);

View File

@ -40,7 +40,7 @@ or implied, of Sebastian Gesemann.
class Dsd2Pcm {
public:
/* must be a power of two */
static constexpr int FIFOSIZE = 16;
static constexpr size_t FIFOSIZE = 16;
private:
/** bit mask for FIFO offsets */