pcm/Dsd2Pcm: use sizet_t
instead of int
This commit is contained in:
parent
a65f7b1006
commit
2d5bf53240
@ -41,7 +41,7 @@ or implied, of Sebastian Gesemann.
|
|||||||
static constexpr size_t HTAPS = 48;
|
static constexpr size_t HTAPS = 48;
|
||||||
|
|
||||||
/** number of "8 MACs" lookup tables */
|
/** 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");
|
static_assert(Dsd2Pcm::FIFOSIZE * 8 >= HTAPS * 2, "FIFOSIZE too small");
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ static constexpr double htaps[HTAPS] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static constexpr float
|
static constexpr float
|
||||||
CalculateCtableValue(int t, int k, int e) noexcept
|
CalculateCtableValue(size_t t, int k, int e) noexcept
|
||||||
{
|
{
|
||||||
double acc = 0;
|
double acc = 0;
|
||||||
for (int m = 0; m < k; ++m) {
|
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
|
/* this needs to be a struct because GCC 6 doesn't have constexpr
|
||||||
lambdas (C++17) */
|
lambdas (C++17) */
|
||||||
struct GenerateCtableValue {
|
struct GenerateCtableValue {
|
||||||
int t, k;
|
size_t t;
|
||||||
|
int k;
|
||||||
|
|
||||||
constexpr auto operator()(int e) const noexcept {
|
constexpr auto operator()(int e) const noexcept {
|
||||||
return CalculateCtableValue(t, k, e);
|
return CalculateCtableValue(t, k, e);
|
||||||
|
@ -40,7 +40,7 @@ or implied, of Sebastian Gesemann.
|
|||||||
class Dsd2Pcm {
|
class Dsd2Pcm {
|
||||||
public:
|
public:
|
||||||
/* must be a power of two */
|
/* must be a power of two */
|
||||||
static constexpr int FIFOSIZE = 16;
|
static constexpr size_t FIFOSIZE = 16;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** bit mask for FIFO offsets */
|
/** bit mask for FIFO offsets */
|
||||||
|
Loading…
Reference in New Issue
Block a user