diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-04-06 14:48:54 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-04-06 14:48:54 +0100 |
| commit | a1ad0db8a6d829eddf1478cee44ae976bbcd325f (patch) | |
| tree | a6e62232e05e7779034c5f9d1bf743b6f1c198e3 /src/solvers/coord/gendata.h | |
| parent | 0d4fa9ebbfcadfff4baf8fc3cd32a63dcfd7dd43 (diff) | |
| download | nissy-core-a1ad0db8a6d829eddf1478cee44ae976bbcd325f.tar.gz nissy-core-a1ad0db8a6d829eddf1478cee44ae976bbcd325f.zip | |
Fix integer conversions in code, tests and some toolsc-portability
Diffstat (limited to 'src/solvers/coord/gendata.h')
| -rw-r--r-- | src/solvers/coord/gendata.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/solvers/coord/gendata.h b/src/solvers/coord/gendata.h index f803044..edf6ce6 100644 --- a/src/solvers/coord/gendata.h +++ b/src/solvers/coord/gendata.h | |||
| @@ -146,7 +146,8 @@ genptable_coord( | |||
| 146 | unsigned char *table | 146 | unsigned char *table |
| 147 | ) | 147 | ) |
| 148 | { | 148 | { |
| 149 | uint64_t tablesize, i, d, tot, t, nm; | 149 | uint64_t tablesize, i, tot, t, nm; |
| 150 | uint8_t d; | ||
| 150 | tableinfo_t info; | 151 | tableinfo_t info; |
| 151 | 152 | ||
| 152 | tablesize = DIV_ROUND_UP(coord->max, 2); | 153 | tablesize = DIV_ROUND_UP(coord->max, 2); |
| @@ -170,7 +171,7 @@ genptable_coord( | |||
| 170 | 171 | ||
| 171 | tot = info.distribution[0] = | 172 | tot = info.distribution[0] = |
| 172 | genptable_coord_init_solved(coord, data, table); | 173 | genptable_coord_init_solved(coord, data, table); |
| 173 | nm = popcount_u32(coord->moves_mask_gendata); | 174 | nm = popcount_u64(coord->moves_mask_gendata); |
| 174 | for (d = 1; tot < coord->max && d < 15; d++) { | 175 | for (d = 1; tot < coord->max && d < 15; d++) { |
| 175 | t = 0; | 176 | t = 0; |
| 176 | if (switch_to_fromnew(tot, coord->max, nm)) { | 177 | if (switch_to_fromnew(tot, coord->max, nm)) { |
| @@ -247,20 +248,21 @@ genptable_coord_fillneighbors( | |||
| 247 | { | 248 | { |
| 248 | bool isnasty; | 249 | bool isnasty; |
| 249 | uint8_t m; | 250 | uint8_t m; |
| 250 | uint64_t ii, j, t, tot; | 251 | uint64_t ii, j, tot; |
| 252 | uint8_t t; | ||
| 251 | cube_t c, moved; | 253 | cube_t c, moved; |
| 252 | 254 | ||
| 253 | c = coord->cube(i, data); | 255 | c = coord->cube(i, data); |
| 254 | tot = 0; | 256 | tot = 0; |
| 255 | for (m = 0; m < NMOVES; m++) { | 257 | for (m = 0; m < NMOVES; m++) { |
| 256 | if (!((UINT32_C(1) << (uint32_t)m) & | 258 | if (!((UINT64_C(1) << (uint64_t)m) & |
| 257 | coord->moves_mask_gendata)) | 259 | coord->moves_mask_gendata)) |
| 258 | continue; | 260 | continue; |
| 259 | moved = move(c, m); | 261 | moved = move(c, m); |
| 260 | ii = coord->coord(moved, data); | 262 | ii = coord->coord(moved, data); |
| 261 | isnasty = coord->isnasty(ii, data); | 263 | isnasty = coord->isnasty(ii, data); |
| 262 | for (t = 0; t < NTRANS && (t == 0 || isnasty); t++) { | 264 | for (t = 0; t < NTRANS && (t == 0 || isnasty); t++) { |
| 263 | if (!((UINT64_C(1) << t) & coord->trans_mask)) | 265 | if (!((UINT64_C(1) << (uint64_t)t) & coord->trans_mask)) |
| 264 | continue; | 266 | continue; |
| 265 | 267 | ||
| 266 | j = coord->coord(transform(moved, t), data); | 268 | j = coord->coord(transform(moved, t), data); |
| @@ -285,14 +287,15 @@ genptable_coord_fillfromnew( | |||
| 285 | { | 287 | { |
| 286 | bool found; | 288 | bool found; |
| 287 | uint8_t m; | 289 | uint8_t m; |
| 288 | uint64_t tot, t, ii, j, nsim, sim[NTRANS]; | 290 | uint64_t tot, j, ii, nsim, sim[NTRANS]; |
| 291 | uint8_t t; | ||
| 289 | cube_t c; | 292 | cube_t c; |
| 290 | 293 | ||
| 291 | tot = 0; | 294 | tot = 0; |
| 292 | c = coord->cube(i, data); | 295 | c = coord->cube(i, data); |
| 293 | 296 | ||
| 294 | for (t = 0, nsim = 0; t < NTRANS; t++) { | 297 | for (t = 0, nsim = 0; t < NTRANS; t++) { |
| 295 | if (!((UINT64_C(1) << t) & coord->trans_mask)) | 298 | if (!((UINT64_C(1) << (uint64_t)t) & coord->trans_mask)) |
| 296 | continue; | 299 | continue; |
| 297 | 300 | ||
| 298 | ii = coord->coord(transform(c, t), data); | 301 | ii = coord->coord(transform(c, t), data); |
| @@ -305,7 +308,7 @@ genptable_coord_fillfromnew( | |||
| 305 | for (j = 0, found = false; j < nsim && !found; j++) { | 308 | for (j = 0, found = false; j < nsim && !found; j++) { |
| 306 | c = coord->cube(sim[j], data); | 309 | c = coord->cube(sim[j], data); |
| 307 | for (m = 0; m < NMOVES; m++) { | 310 | for (m = 0; m < NMOVES; m++) { |
| 308 | if (!((UINT32_C(1) << (uint32_t)m) & | 311 | if (!((UINT64_C(1) << (uint64_t)m) & |
| 309 | coord->moves_mask_gendata)) | 312 | coord->moves_mask_gendata)) |
| 310 | continue; | 313 | continue; |
| 311 | ii = coord->coord(move(c, m), data); | 314 | ii = coord->coord(move(c, m), data); |
