Currently the _sinTable and _gammaTable are generated by sophisticated preprocessor logic, and rely on sin and pow being evaluated at compile time. The resulting code is hard to follow and there are potential portability problems.
In Issue #23, there's a complaint that M_PI isn't defined on some stdlibs.
It's also not unlikely that some compilers won't have constexpr support for pow and sin,
or the nonstandard __COUNTER__, so it feels risky to depend on them for PROGMEM table initialization, which must be initialized with constant expressions, and I think will only build with optimizer flag -O2.
I've verified that these tables are identical to those generated by the existing preprocessor code.
To keep the tables maintainable, I provide a comment with the Python snippet to regenerate them.
Currently the _sinTable and _gammaTable are generated by sophisticated preprocessor logic, and rely on sin and pow being evaluated at compile time. The resulting code is hard to follow and there are potential portability problems.
In Issue #23, there's a complaint that
M_PI
isn't defined on some stdlibs.It's also not unlikely that some compilers won't have constexpr support for
pow
andsin
, or the nonstandard__COUNTER__
, so it feels risky to depend on them forPROGMEM
table initialization, which must be initialized with constant expressions, and I think will only build with optimizer flag -O2.I've verified that these tables are identical to those generated by the existing preprocessor code. To keep the tables maintainable, I provide a comment with the Python snippet to regenerate them.