aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-08-28 05:56:57 -0700
committerChris Robinson <[email protected]>2017-08-28 05:56:57 -0700
commit6c367cad6e358a0ea4fd71fc94120dd7e036c621 (patch)
tree1c92d6691a3c7f4f1f6ef95f65551e2a87a87ff9
parentfde02abc359d81f7c25d6d24ac747613537efb1f (diff)
Ensure some macros have the correct size
-rw-r--r--Alc/bsinc_inc.c4
-rw-r--r--utils/bsincgen.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/Alc/bsinc_inc.c b/Alc/bsinc_inc.c
index 65f3fe8f..1370ce5a 100644
--- a/Alc/bsinc_inc.c
+++ b/Alc/bsinc_inc.c
@@ -1,5 +1,9 @@
/* Generated by bsincgen, do not edit! */
+static_assert(BSINC_SCALE_COUNT == 16, "Unexpected BSINC_SCALE_COUNT value!");
+static_assert(BSINC_PHASE_COUNT == 16, "Unexpected BSINC_PHASE_COUNT value!");
+static_assert(FRACTIONONE == 4096, "Unexpected FRACTIONONE value!");
+
typedef struct BSincTable {
const float scaleBase, scaleRange;
const int m[BSINC_SCALE_COUNT];
diff --git a/utils/bsincgen.c b/utils/bsincgen.c
index 945a99eb..03421da9 100644
--- a/utils/bsincgen.c
+++ b/utils/bsincgen.c
@@ -381,12 +381,15 @@ int main(int argc, char *argv[])
output = stdout;
fprintf(output, "/* Generated by bsincgen, do not edit! */\n\n"
+"static_assert(BSINC_SCALE_COUNT == %d, \"Unexpected BSINC_SCALE_COUNT value!\");\n"
+"static_assert(BSINC_PHASE_COUNT == %d, \"Unexpected BSINC_PHASE_COUNT value!\");\n"
+"static_assert(FRACTIONONE == %d, \"Unexpected FRACTIONONE value!\");\n\n"
"typedef struct BSincTable {\n"
" const float scaleBase, scaleRange;\n"
" const int m[BSINC_SCALE_COUNT];\n"
" const int filterOffset[BSINC_SCALE_COUNT];\n"
" alignas(16) const float Tab[];\n"
-"} BSincTable;\n\n");
+"} BSincTable;\n\n", BSINC_SCALE_COUNT, BSINC_PHASE_COUNT, FRACTIONONE);
/* A 23rd order filter with a -60dB drop at nyquist. */
BsiGenerateTables(output, "bsinc24", 60.0, 23);
/* An 11th order filter with a -60dB drop at nyquist. */