diff options
Diffstat (limited to '')
| -rw-r--r-- | tools/000_gendata/gendata.c | 2 | ||||
| -rw-r--r-- | tools/100_checkdata/checkdata.c | 2 | ||||
| -rw-r--r-- | tools/300_solve_small/solve_small.c | 2 | ||||
| -rw-r--r-- | tools/301_solve_file/solve_file.c | 2 | ||||
| -rw-r--r-- | tools/302_solve_multisol/solve_multisol.c | 2 | ||||
| -rw-r--r-- | tools/400_solvetest/solve_test.c | 2 | ||||
| -rw-r--r-- | tools/nissy_extra.h | 3 | ||||
| -rw-r--r-- | tools/tool.h | 30 |
8 files changed, 18 insertions, 27 deletions
diff --git a/tools/000_gendata/gendata.c b/tools/000_gendata/gendata.c index 51c2f47..f2ac1a0 100644 --- a/tools/000_gendata/gendata.c +++ b/tools/000_gendata/gendata.c | |||
| @@ -8,7 +8,7 @@ static void | |||
| 8 | run(void) { | 8 | run(void) { |
| 9 | int64_t size; | 9 | int64_t size; |
| 10 | bool consistent, expected; | 10 | bool consistent, expected; |
| 11 | char *buf, filename[1024], dataid[NISSY_DATAID_SIZE]; | 11 | char *buf, filename[1024], dataid[NISSY_SIZE_DATAID]; |
| 12 | 12 | ||
| 13 | size = generatetable(solver, &buf, dataid); | 13 | size = generatetable(solver, &buf, dataid); |
| 14 | switch (size) { | 14 | switch (size) { |
diff --git a/tools/100_checkdata/checkdata.c b/tools/100_checkdata/checkdata.c index 8bc308c..5b3db2c 100644 --- a/tools/100_checkdata/checkdata.c +++ b/tools/100_checkdata/checkdata.c | |||
| @@ -6,7 +6,7 @@ char *solver, *filename; | |||
| 6 | static void | 6 | static void |
| 7 | run(void) { | 7 | run(void) { |
| 8 | long long int size, result; | 8 | long long int size, result; |
| 9 | char *buf, dataid[NISSY_DATAID_SIZE]; | 9 | char *buf, dataid[NISSY_SIZE_DATAID]; |
| 10 | FILE *f; | 10 | FILE *f; |
| 11 | 11 | ||
| 12 | size = nissy_solverinfo(solver, dataid); | 12 | size = nissy_solverinfo(solver, dataid); |
diff --git a/tools/300_solve_small/solve_small.c b/tools/300_solve_small/solve_small.c index 6a1f7b5..bec8add 100644 --- a/tools/300_solve_small/solve_small.c +++ b/tools/300_solve_small/solve_small.c | |||
| @@ -46,7 +46,7 @@ void run(void) { | |||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | int main(int argc, char **argv) { | 48 | int main(int argc, char **argv) { |
| 49 | char filename[255], dataid[NISSY_DATAID_SIZE]; | 49 | char filename[255], dataid[NISSY_SIZE_DATAID]; |
| 50 | 50 | ||
| 51 | if (argc < 2) { | 51 | if (argc < 2) { |
| 52 | printf("Error: not enough arguments. " | 52 | printf("Error: not enough arguments. " |
diff --git a/tools/301_solve_file/solve_file.c b/tools/301_solve_file/solve_file.c index cefc608..a772e95 100644 --- a/tools/301_solve_file/solve_file.c +++ b/tools/301_solve_file/solve_file.c | |||
| @@ -33,7 +33,7 @@ void run(void) { | |||
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | int main(int argc, char **argv) { | 35 | int main(int argc, char **argv) { |
| 36 | char filename[255], dataid[NISSY_DATAID_SIZE], *scrfilename; | 36 | char filename[255], dataid[NISSY_SIZE_DATAID], *scrfilename; |
| 37 | FILE *scrfile; | 37 | FILE *scrfile; |
| 38 | 38 | ||
| 39 | if (argc < 3) { | 39 | if (argc < 3) { |
diff --git a/tools/302_solve_multisol/solve_multisol.c b/tools/302_solve_multisol/solve_multisol.c index c6ab685..e933a94 100644 --- a/tools/302_solve_multisol/solve_multisol.c +++ b/tools/302_solve_multisol/solve_multisol.c | |||
| @@ -39,7 +39,7 @@ void run(void) { | |||
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | int main(int argc, char **argv) { | 41 | int main(int argc, char **argv) { |
| 42 | char filename[255], dataid[NISSY_DATAID_SIZE]; | 42 | char filename[255], dataid[NISSY_SIZE_DATAID]; |
| 43 | 43 | ||
| 44 | if (argc < 3) { | 44 | if (argc < 3) { |
| 45 | printf("Error: not enough arguments. " | 45 | printf("Error: not enough arguments. " |
diff --git a/tools/400_solvetest/solve_test.c b/tools/400_solvetest/solve_test.c index a98be26..e881030 100644 --- a/tools/400_solvetest/solve_test.c +++ b/tools/400_solvetest/solve_test.c | |||
| @@ -94,7 +94,7 @@ void run(void) { | |||
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | int main(int argc, char **argv) { | 96 | int main(int argc, char **argv) { |
| 97 | char filename[255], dataid[NISSY_DATAID_SIZE]; | 97 | char filename[255], dataid[NISSY_SIZE_DATAID]; |
| 98 | 98 | ||
| 99 | if (argc < 2) { | 99 | if (argc < 2) { |
| 100 | printf("Error: not enough arguments. " | 100 | printf("Error: not enough arguments. " |
diff --git a/tools/nissy_extra.h b/tools/nissy_extra.h index 1600681..3e9c9ab 100644 --- a/tools/nissy_extra.h +++ b/tools/nissy_extra.h | |||
| @@ -11,6 +11,5 @@ for testing purposes only. | |||
| 11 | 11 | ||
| 12 | size_t gendata_h48_derive(uint8_t, const void *, void *); | 12 | size_t gendata_h48_derive(uint8_t, const void *, void *); |
| 13 | int parse_h48_solver(const char *, uint8_t [static 1], uint8_t [static 1]); | 13 | int parse_h48_solver(const char *, uint8_t [static 1], uint8_t [static 1]); |
| 14 | long long int nissy_datainfo( | 14 | long long int nissy_datainfo(uint64_t, const char *, void (*)(const char *)); |
| 15 | uint64_t, const char *, void (*)(const char *, ...)); | ||
| 16 | long long int nissy_derivedata(const char *, const void *, void *); | 15 | long long int nissy_derivedata(const char *, const void *, void *); |
diff --git a/tools/tool.h b/tools/tool.h index b65f33a..51301c6 100644 --- a/tools/tool.h +++ b/tools/tool.h | |||
| @@ -9,12 +9,12 @@ | |||
| 9 | #include "../src/nissy.h" | 9 | #include "../src/nissy.h" |
| 10 | #include "nissy_extra.h" | 10 | #include "nissy_extra.h" |
| 11 | 11 | ||
| 12 | static void log_stderr(const char *, ...); | 12 | static void log_stderr(const char *); |
| 13 | static void log_stdout(const char *, ...); | 13 | static void log_stdout(const char *); |
| 14 | static double timerun(void (*)(void)); | 14 | static double timerun(void (*)(void)); |
| 15 | static void writetable(const char *, int64_t, const char *); | 15 | static void writetable(const char *, int64_t, const char *); |
| 16 | static long long int generatetable(const char *, char **, | 16 | static long long int generatetable(const char *, char **, |
| 17 | char [static NISSY_DATAID_SIZE]); | 17 | char [static NISSY_SIZE_DATAID]); |
| 18 | static long long int derivetable( | 18 | static long long int derivetable( |
| 19 | const char *, const char *, const char *, char **); | 19 | const char *, const char *, const char *, char **); |
| 20 | static int getdata(const char *, char **, const char *); | 20 | static int getdata(const char *, char **, const char *); |
| @@ -23,23 +23,15 @@ static void derivedata_run( | |||
| 23 | const char *, const char *, const char *, const char *); | 23 | const char *, const char *, const char *, const char *); |
| 24 | 24 | ||
| 25 | static void | 25 | static void |
| 26 | log_stderr(const char *str, ...) | 26 | log_stderr(const char *str) |
| 27 | { | 27 | { |
| 28 | va_list args; | 28 | fprintf(stderr, "%s", str); |
| 29 | |||
| 30 | va_start(args, str); | ||
| 31 | vfprintf(stderr, str, args); | ||
| 32 | va_end(args); | ||
| 33 | } | 29 | } |
| 34 | 30 | ||
| 35 | static void | 31 | static void |
| 36 | write_stdout(const char *str, ...) | 32 | write_stdout(const char *str) |
| 37 | { | 33 | { |
| 38 | va_list args; | 34 | fprintf(stdout, "%s", str); |
| 39 | |||
| 40 | va_start(args, str); | ||
| 41 | vfprintf(stdout, str, args); | ||
| 42 | va_end(args); | ||
| 43 | } | 35 | } |
| 44 | 36 | ||
| 45 | static double | 37 | static double |
| @@ -90,7 +82,7 @@ static long long int | |||
| 90 | generatetable( | 82 | generatetable( |
| 91 | const char *solver, | 83 | const char *solver, |
| 92 | char **buf, | 84 | char **buf, |
| 93 | char dataid[static NISSY_DATAID_SIZE] | 85 | char dataid[static NISSY_SIZE_DATAID] |
| 94 | ) | 86 | ) |
| 95 | { | 87 | { |
| 96 | long long int size, gensize; | 88 | long long int size, gensize; |
| @@ -125,7 +117,7 @@ derivetable( | |||
| 125 | { | 117 | { |
| 126 | uint8_t h, k; | 118 | uint8_t h, k; |
| 127 | long long int size, gensize; | 119 | long long int size, gensize; |
| 128 | char *fulltable, dataid[NISSY_DATAID_SIZE]; | 120 | char *fulltable, dataid[NISSY_SIZE_DATAID]; |
| 129 | 121 | ||
| 130 | if (getdata(solver_large, &fulltable, filename_large) != 0) { | 122 | if (getdata(solver_large, &fulltable, filename_large) != 0) { |
| 131 | printf("Error reading full table.\n"); | 123 | printf("Error reading full table.\n"); |
| @@ -169,7 +161,7 @@ getdata( | |||
| 169 | ) { | 161 | ) { |
| 170 | long long int size, sizeread; | 162 | long long int size, sizeread; |
| 171 | FILE *f; | 163 | FILE *f; |
| 172 | char dataid[NISSY_DATAID_SIZE]; | 164 | char dataid[NISSY_SIZE_DATAID]; |
| 173 | 165 | ||
| 174 | if ((f = fopen(filename, "rb")) == NULL) { | 166 | if ((f = fopen(filename, "rb")) == NULL) { |
| 175 | printf("Table file not found, generating it.\n"); | 167 | printf("Table file not found, generating it.\n"); |
| @@ -209,7 +201,7 @@ gendata_run( | |||
| 209 | uint64_t expected[static 21] | 201 | uint64_t expected[static 21] |
| 210 | ) { | 202 | ) { |
| 211 | long long int size; | 203 | long long int size; |
| 212 | char *buf, filename[1024], dataid[NISSY_DATAID_SIZE]; | 204 | char *buf, filename[1024], dataid[NISSY_SIZE_DATAID]; |
| 213 | 205 | ||
| 214 | size = generatetable(solver, &buf, dataid); | 206 | size = generatetable(solver, &buf, dataid); |
| 215 | sprintf(filename, "tables/%s", dataid); | 207 | sprintf(filename, "tables/%s", dataid); |
