diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-20 14:07:51 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-20 14:07:51 +0200 |
| commit | 71c0188306377940ae172dceb58f2bd5f4fcdb4f (patch) | |
| tree | 7f08457ecfb35f908ec26929ebd84d8a0ca125ae /src/solve_generic.h | |
| parent | e986713657bc5f9880e91ed49dd9b0d0227f048d (diff) | |
| download | nissy-core-71c0188306377940ae172dceb58f2bd5f4fcdb4f.tar.gz nissy-core-71c0188306377940ae172dceb58f2bd5f4fcdb4f.zip | |
Changed logger from va_args to ...
Diffstat (limited to 'src/solve_generic.h')
| -rw-r--r-- | src/solve_generic.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/solve_generic.h b/src/solve_generic.h index a8d6b39..6a1dcf3 100644 --- a/src/solve_generic.h +++ b/src/solve_generic.h | |||
| @@ -49,11 +49,11 @@ solve( | |||
| 49 | solutions | 49 | solutions |
| 50 | ); | 50 | ); |
| 51 | } else { | 51 | } else { |
| 52 | _log("solve: unknown solver '%s'\n", solver); | 52 | LOG("solve: unknown solver '%s'\n", solver); |
| 53 | return -1; | 53 | return -1; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | _log("solve: error\n"); | 56 | LOG("solve: error\n"); |
| 57 | return -1; | 57 | return -1; |
| 58 | } | 58 | } |
| 59 | 59 | ||
| @@ -63,7 +63,7 @@ solve_generic_appendsolution(dfsarg_generic_t *arg) | |||
| 63 | int strl; | 63 | int strl; |
| 64 | 64 | ||
| 65 | strl = writemoves(arg->moves, arg->depth, *arg->nextsol); | 65 | strl = writemoves(arg->moves, arg->depth, *arg->nextsol); |
| 66 | _log("Solution found: %s\n", *arg->nextsol); | 66 | LOG("Solution found: %s\n", *arg->nextsol); |
| 67 | *arg->nextsol += strl; | 67 | *arg->nextsol += strl; |
| 68 | **arg->nextsol = '\n'; | 68 | **arg->nextsol = '\n'; |
| 69 | (*arg->nextsol)++; | 69 | (*arg->nextsol)++; |
| @@ -126,12 +126,12 @@ solve_generic( | |||
| 126 | int64_t ret, tmp, first; | 126 | int64_t ret, tmp, first; |
| 127 | 127 | ||
| 128 | if (!issolvable(cube)) { | 128 | if (!issolvable(cube)) { |
| 129 | _log("solve: cube is not solvable\n"); | 129 | LOG("solve: cube is not solvable\n"); |
| 130 | return -1; | 130 | return -1; |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | if (issolved(cube)) { | 133 | if (issolved(cube)) { |
| 134 | _log("solve: cube is already solved\n"); | 134 | LOG("solve: cube is already solved\n"); |
| 135 | sols[0] = '\n'; | 135 | sols[0] = '\n'; |
| 136 | sols[1] = 0; | 136 | sols[1] = 0; |
| 137 | return 1; | 137 | return 1; |
| @@ -141,32 +141,32 @@ solve_generic( | |||
| 141 | "solve: NISS not implemented yet, 'nisstype' ignored\n"); | 141 | "solve: NISS not implemented yet, 'nisstype' ignored\n"); |
| 142 | 142 | ||
| 143 | if (minmoves < 0) { | 143 | if (minmoves < 0) { |
| 144 | _log("solve: 'minmoves' is negative, setting to 0\n"); | 144 | LOG("solve: 'minmoves' is negative, setting to 0\n"); |
| 145 | minmoves = 0; | 145 | minmoves = 0; |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | if (maxmoves < 0) { | 148 | if (maxmoves < 0) { |
| 149 | _log("solve: invalid 'maxmoves', setting to 20\n"); | 149 | LOG("solve: invalid 'maxmoves', setting to 20\n"); |
| 150 | maxmoves = 20; | 150 | maxmoves = 20; |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | if (maxsols < 0) { | 153 | if (maxsols < 0) { |
| 154 | _log("solve: 'maxsols' is negative\n"); | 154 | LOG("solve: 'maxsols' is negative\n"); |
| 155 | return -1; | 155 | return -1; |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | if (maxsols == 0) { | 158 | if (maxsols == 0) { |
| 159 | _log("solve: 'maxsols' is 0\n"); | 159 | LOG("solve: 'maxsols' is 0\n"); |
| 160 | return 0; | 160 | return 0; |
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | if (sols == NULL) { | 163 | if (sols == NULL) { |
| 164 | _log("solve: return parameter 'sols' is NULL\n"); | 164 | LOG("solve: return parameter 'sols' is NULL\n"); |
| 165 | return -1; | 165 | return -1; |
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | if (estimate == NULL) { | 168 | if (estimate == NULL) { |
| 169 | _log("solve: 'estimate' is NULL\n"); | 169 | LOG("solve: 'estimate' is NULL\n"); |
| 170 | return -1; | 170 | return -1; |
| 171 | } | 171 | } |
| 172 | 172 | ||
| @@ -187,7 +187,7 @@ solve_generic( | |||
| 187 | if (tmp != 0) | 187 | if (tmp != 0) |
| 188 | first = arg.depth; | 188 | first = arg.depth; |
| 189 | 189 | ||
| 190 | _log("Found %" PRId64 " solution%s at depth %" PRIu8 "\n", | 190 | LOG("Found %" PRId64 " solution%s at depth %" PRIu8 "\n", |
| 191 | tmp, tmp == 1 ? "" : "s", arg.depth); | 191 | tmp, tmp == 1 ? "" : "s", arg.depth); |
| 192 | 192 | ||
| 193 | if (ret >= maxsols) | 193 | if (ret >= maxsols) |
| @@ -248,7 +248,7 @@ gendata(const char *solver, const char *options, void *data) | |||
| 248 | maxdepth = atoi(&options[i+1]); | 248 | maxdepth = atoi(&options[i+1]); |
| 249 | ret = gendata_h48(data, h, maxdepth); | 249 | ret = gendata_h48(data, h, maxdepth); |
| 250 | } else { | 250 | } else { |
| 251 | _log("gendata: implemented only for H48 solver\n"); | 251 | LOG("gendata: implemented only for H48 solver\n"); |
| 252 | ret = -1; | 252 | ret = -1; |
| 253 | } | 253 | } |
| 254 | 254 | ||
