From 388b55b4ea644aa1b6074a70652b8f62e7755280 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 27 Sep 2024 09:11:00 +0200 Subject: Use constant instead of magic number --- tools/001_derive_h48h0k2/derive_h48h0k2.c | 21 +++++++++++++++++++++ tools/1002_derive_h48h0k2/derive_h48h0k2.c | 21 --------------------- tools/tool.h | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 tools/001_derive_h48h0k2/derive_h48h0k2.c delete mode 100644 tools/1002_derive_h48h0k2/derive_h48h0k2.c (limited to 'tools') diff --git a/tools/001_derive_h48h0k2/derive_h48h0k2.c b/tools/001_derive_h48h0k2/derive_h48h0k2.c new file mode 100644 index 0000000..73fab2e --- /dev/null +++ b/tools/001_derive_h48h0k2/derive_h48h0k2.c @@ -0,0 +1,21 @@ +#include "../tool.h" + +uint64_t expected[21] = { + /* Base value is 8 */ + [0] = 5473562, + [1] = 34776317, + [2] = 68566704, + [3] = 8750867, +}; + +void run(void) { + derivedata_run(0, "tables/h48h0k2_derived", expected); +} + +int main(void) { + nissy_setlogger(log_stderr); + + timerun(run, "benchmark derivedata_h48 h = 0, k = 2"); + + return 0; +} diff --git a/tools/1002_derive_h48h0k2/derive_h48h0k2.c b/tools/1002_derive_h48h0k2/derive_h48h0k2.c deleted file mode 100644 index 73fab2e..0000000 --- a/tools/1002_derive_h48h0k2/derive_h48h0k2.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "../tool.h" - -uint64_t expected[21] = { - /* Base value is 8 */ - [0] = 5473562, - [1] = 34776317, - [2] = 68566704, - [3] = 8750867, -}; - -void run(void) { - derivedata_run(0, "tables/h48h0k2_derived", expected); -} - -int main(void) { - nissy_setlogger(log_stderr); - - timerun(run, "benchmark derivedata_h48 h = 0, k = 2"); - - return 0; -} diff --git a/tools/tool.h b/tools/tool.h index 5eec318..d9071fb 100644 --- a/tools/tool.h +++ b/tools/tool.h @@ -130,7 +130,7 @@ derivetable(uint8_t h, char **buf) int64_t size, gensize; char *fulltable; - char options[20] = " ;2;20"; /* Fixed for k = 2 for now */ + char options[20] = " ;2;20"; /* Only for k = 2 for now */ options[0] = (char)(h + '0'); /* h = 10 not supported for now */ /* Support only b8 for now */ -- cgit v1.3