diff options
Diffstat (limited to '')
| -rw-r--r-- | tools/000_gendata/gendata.c | 4 | ||||
| -rw-r--r-- | tools/001_derive_h48/derive_h48.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 | 2 | ||||
| -rw-r--r-- | tools/tool.h | 15 |
9 files changed, 13 insertions, 20 deletions
diff --git a/tools/000_gendata/gendata.c b/tools/000_gendata/gendata.c index f2ac1a0..3123bf5 100644 --- a/tools/000_gendata/gendata.c +++ b/tools/000_gendata/gendata.c | |||
| @@ -17,7 +17,7 @@ run(void) { | |||
| 17 | case -2: | 17 | case -2: |
| 18 | goto gendata_run_finish; | 18 | goto gendata_run_finish; |
| 19 | default: | 19 | default: |
| 20 | nissy_datainfo(size, buf, write_stdout); | 20 | nissy_datainfo(size, buf); |
| 21 | consistent = nissy_checkdata(size, buf) == 0; | 21 | consistent = nissy_checkdata(size, buf) == 0; |
| 22 | expected = check_distribution(solver, size, buf); | 22 | expected = check_distribution(solver, size, buf); |
| 23 | if (consistent && expected) { | 23 | if (consistent && expected) { |
| @@ -51,7 +51,7 @@ int main(int argc, char **argv) { | |||
| 51 | parse_h48_solver(solver, &h, &k); | 51 | parse_h48_solver(solver, &h, &k); |
| 52 | expected = expected_h48[h][k]; | 52 | expected = expected_h48[h][k]; |
| 53 | 53 | ||
| 54 | nissy_setlogger(log_stderr); | 54 | nissy_setlogger(log_stdout, NULL); |
| 55 | 55 | ||
| 56 | timerun(run); | 56 | timerun(run); |
| 57 | 57 | ||
diff --git a/tools/001_derive_h48/derive_h48.c b/tools/001_derive_h48/derive_h48.c index c964882..e471f9b 100644 --- a/tools/001_derive_h48/derive_h48.c +++ b/tools/001_derive_h48/derive_h48.c | |||
| @@ -32,7 +32,7 @@ int main(int argc, char **argv) { | |||
| 32 | filename_large = argv[3]; | 32 | filename_large = argv[3]; |
| 33 | filename_small = argv[4]; | 33 | filename_small = argv[4]; |
| 34 | 34 | ||
| 35 | nissy_setlogger(log_stderr); | 35 | nissy_setlogger(log_stdout, NULL); |
| 36 | 36 | ||
| 37 | timerun(run); | 37 | timerun(run); |
| 38 | 38 | ||
diff --git a/tools/100_checkdata/checkdata.c b/tools/100_checkdata/checkdata.c index 5b3db2c..00875fa 100644 --- a/tools/100_checkdata/checkdata.c +++ b/tools/100_checkdata/checkdata.c | |||
| @@ -41,7 +41,7 @@ int main(int argc, char **argv) { | |||
| 41 | 41 | ||
| 42 | solver = argv[1]; | 42 | solver = argv[1]; |
| 43 | filename = argv[2]; | 43 | filename = argv[2]; |
| 44 | nissy_setlogger(log_stderr); | 44 | nissy_setlogger(log_stdout, NULL); |
| 45 | 45 | ||
| 46 | timerun(run); | 46 | timerun(run); |
| 47 | 47 | ||
diff --git a/tools/300_solve_small/solve_small.c b/tools/300_solve_small/solve_small.c index bec8add..c6dd661 100644 --- a/tools/300_solve_small/solve_small.c +++ b/tools/300_solve_small/solve_small.c | |||
| @@ -56,7 +56,7 @@ int main(int argc, char **argv) { | |||
| 56 | 56 | ||
| 57 | solver = argv[1]; | 57 | solver = argv[1]; |
| 58 | srand(time(NULL)); | 58 | srand(time(NULL)); |
| 59 | nissy_setlogger(log_stderr); | 59 | nissy_setlogger(log_stdout, NULL); |
| 60 | 60 | ||
| 61 | 61 | ||
| 62 | sprintf(filename, "tables/%s", solver); | 62 | sprintf(filename, "tables/%s", solver); |
diff --git a/tools/301_solve_file/solve_file.c b/tools/301_solve_file/solve_file.c index a772e95..06b8198 100644 --- a/tools/301_solve_file/solve_file.c +++ b/tools/301_solve_file/solve_file.c | |||
| @@ -46,7 +46,7 @@ int main(int argc, char **argv) { | |||
| 46 | scrfilename = argv[2]; | 46 | scrfilename = argv[2]; |
| 47 | 47 | ||
| 48 | srand(time(NULL)); | 48 | srand(time(NULL)); |
| 49 | nissy_setlogger(log_stderr); | 49 | nissy_setlogger(log_stdout, NULL); |
| 50 | 50 | ||
| 51 | sprintf(filename, "tables/%s", solver); | 51 | sprintf(filename, "tables/%s", solver); |
| 52 | if (getdata(solver, &buf, filename) != 0) | 52 | if (getdata(solver, &buf, filename) != 0) |
diff --git a/tools/302_solve_multisol/solve_multisol.c b/tools/302_solve_multisol/solve_multisol.c index e933a94..ec36711 100644 --- a/tools/302_solve_multisol/solve_multisol.c +++ b/tools/302_solve_multisol/solve_multisol.c | |||
| @@ -50,7 +50,7 @@ int main(int argc, char **argv) { | |||
| 50 | solver = argv[1]; | 50 | solver = argv[1]; |
| 51 | nsol = atoi(argv[2]); | 51 | nsol = atoi(argv[2]); |
| 52 | srand(time(NULL)); | 52 | srand(time(NULL)); |
| 53 | nissy_setlogger(log_stderr); | 53 | nissy_setlogger(log_stdout, NULL); |
| 54 | 54 | ||
| 55 | 55 | ||
| 56 | sprintf(filename, "tables/%s", solver); | 56 | sprintf(filename, "tables/%s", solver); |
diff --git a/tools/400_solvetest/solve_test.c b/tools/400_solvetest/solve_test.c index e881030..6e7b2a5 100644 --- a/tools/400_solvetest/solve_test.c +++ b/tools/400_solvetest/solve_test.c | |||
| @@ -104,7 +104,7 @@ int main(int argc, char **argv) { | |||
| 104 | 104 | ||
| 105 | solver = argv[1]; | 105 | solver = argv[1]; |
| 106 | srand(time(NULL)); | 106 | srand(time(NULL)); |
| 107 | nissy_setlogger(log_stderr); | 107 | nissy_setlogger(log_stdout, NULL); |
| 108 | 108 | ||
| 109 | sprintf(filename, "tables/%s", solver); | 109 | sprintf(filename, "tables/%s", solver); |
| 110 | if (getdata(solver, &buf, filename) != 0) | 110 | if (getdata(solver, &buf, filename) != 0) |
diff --git a/tools/nissy_extra.h b/tools/nissy_extra.h index 3e9c9ab..505f53a 100644 --- a/tools/nissy_extra.h +++ b/tools/nissy_extra.h | |||
| @@ -11,5 +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(uint64_t, const char *, void (*)(const char *)); | 14 | long long int nissy_datainfo(uint64_t, const char *); |
| 15 | 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 51301c6..ee6c8eb 100644 --- a/tools/tool.h +++ b/tools/tool.h | |||
| @@ -9,8 +9,7 @@ | |||
| 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_stdout(const char *, void *); |
| 13 | static void log_stdout(const char *); | ||
| 14 | static double timerun(void (*)(void)); | 13 | static double timerun(void (*)(void)); |
| 15 | static void writetable(const char *, int64_t, const char *); | 14 | static void writetable(const char *, int64_t, const char *); |
| 16 | static long long int generatetable(const char *, char **, | 15 | static long long int generatetable(const char *, char **, |
| @@ -23,13 +22,7 @@ static void derivedata_run( | |||
| 23 | const char *, const char *, const char *, const char *); | 22 | const char *, const char *, const char *, const char *); |
| 24 | 23 | ||
| 25 | static void | 24 | static void |
| 26 | log_stderr(const char *str) | 25 | log_stdout(const char *str, void *unused) |
| 27 | { | ||
| 28 | fprintf(stderr, "%s", str); | ||
| 29 | } | ||
| 30 | |||
| 31 | static void | ||
| 32 | write_stdout(const char *str) | ||
| 33 | { | 26 | { |
| 34 | fprintf(stdout, "%s", str); | 27 | fprintf(stdout, "%s", str); |
| 35 | } | 28 | } |
| @@ -211,7 +204,7 @@ gendata_run( | |||
| 211 | case -2: | 204 | case -2: |
| 212 | goto gendata_run_finish; | 205 | goto gendata_run_finish; |
| 213 | default: | 206 | default: |
| 214 | nissy_datainfo(size, buf, write_stdout); | 207 | nissy_datainfo(size, buf); |
| 215 | printf("\n"); | 208 | printf("\n"); |
| 216 | printf("Succesfully generated %lld bytes. " | 209 | printf("Succesfully generated %lld bytes. " |
| 217 | "See above for details on the tables.\n", size); | 210 | "See above for details on the tables.\n", size); |
| @@ -244,7 +237,7 @@ derivedata_run( | |||
| 244 | case -2: | 237 | case -2: |
| 245 | goto derivedata_run_finish; | 238 | goto derivedata_run_finish; |
| 246 | default: | 239 | default: |
| 247 | nissy_datainfo(size, buf, write_stdout); | 240 | nissy_datainfo(size, buf); |
| 248 | printf("\n"); | 241 | printf("\n"); |
| 249 | printf("Succesfully generated %lld bytes. " | 242 | printf("Succesfully generated %lld bytes. " |
| 250 | "See above for details on the tables.\n", size); | 243 | "See above for details on the tables.\n", size); |
