diff options
Diffstat (limited to 'src/solvers/h48/solve_multithread.h')
| -rw-r--r-- | src/solvers/h48/solve_multithread.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/solvers/h48/solve_multithread.h b/src/solvers/h48/solve_multithread.h index 8e00404..d8c81af 100644 --- a/src/solvers/h48/solve_multithread.h +++ b/src/solvers/h48/solve_multithread.h | |||
| @@ -36,13 +36,14 @@ solve_h48_appendsolution_thread(dfsarg_solveh48_t *arg, task_queue_t *tq) | |||
| 36 | 36 | ||
| 37 | if (strl < 0) | 37 | if (strl < 0) |
| 38 | goto solve_h48_appendsolution_thread_error; | 38 | goto solve_h48_appendsolution_thread_error; |
| 39 | *arg->nextsol += strl; | 39 | *arg->nextsol += strl-1; |
| 40 | arg->solutions_size -= strl; | 40 | arg->solutions_size -= strl-1; |
| 41 | 41 | ||
| 42 | if (arg->npremoves) | 42 | if (arg->npremoves) |
| 43 | { | 43 | { |
| 44 | **arg->nextsol = ' '; | 44 | **arg->nextsol = ' '; |
| 45 | (*arg->nextsol)++; | 45 | (*arg->nextsol)++; |
| 46 | arg->solutions_size--; | ||
| 46 | 47 | ||
| 47 | invertmoves(arg->premoves, arg->npremoves, invertedpremoves); | 48 | invertmoves(arg->premoves, arg->npremoves, invertedpremoves); |
| 48 | strl = writemoves(invertedpremoves, | 49 | strl = writemoves(invertedpremoves, |
| @@ -50,13 +51,14 @@ solve_h48_appendsolution_thread(dfsarg_solveh48_t *arg, task_queue_t *tq) | |||
| 50 | 51 | ||
| 51 | if (strl < 0) | 52 | if (strl < 0) |
| 52 | goto solve_h48_appendsolution_thread_error; | 53 | goto solve_h48_appendsolution_thread_error; |
| 53 | *arg->nextsol += strl; | 54 | *arg->nextsol += strl-1; |
| 54 | arg->solutions_size -= strl; | 55 | arg->solutions_size -= strl-1; |
| 55 | } | 56 | } |
| 56 | LOG("Solution found: %s\n", solution); | 57 | LOG("Solution found: %s\n", solution); |
| 57 | 58 | ||
| 58 | **arg->nextsol = '\n'; | 59 | **arg->nextsol = '\n'; |
| 59 | (*arg->nextsol)++; | 60 | (*arg->nextsol)++; |
| 61 | arg->solutions_size--; | ||
| 60 | (*arg->nsols)++; | 62 | (*arg->nsols)++; |
| 61 | 63 | ||
| 62 | solve_h48_appendsolution_thread_error: | 64 | solve_h48_appendsolution_thread_error: |
