From a1ad0db8a6d829eddf1478cee44ae976bbcd325f Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 6 Apr 2026 14:48:54 +0100 Subject: Fix integer conversions in code, tests and some tools --- src/solvers/coord/gendata.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/solvers/coord/gendata.h') 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( unsigned char *table ) { - uint64_t tablesize, i, d, tot, t, nm; + uint64_t tablesize, i, tot, t, nm; + uint8_t d; tableinfo_t info; tablesize = DIV_ROUND_UP(coord->max, 2); @@ -170,7 +171,7 @@ genptable_coord( tot = info.distribution[0] = genptable_coord_init_solved(coord, data, table); - nm = popcount_u32(coord->moves_mask_gendata); + nm = popcount_u64(coord->moves_mask_gendata); for (d = 1; tot < coord->max && d < 15; d++) { t = 0; if (switch_to_fromnew(tot, coord->max, nm)) { @@ -247,20 +248,21 @@ genptable_coord_fillneighbors( { bool isnasty; uint8_t m; - uint64_t ii, j, t, tot; + uint64_t ii, j, tot; + uint8_t t; cube_t c, moved; c = coord->cube(i, data); tot = 0; for (m = 0; m < NMOVES; m++) { - if (!((UINT32_C(1) << (uint32_t)m) & + if (!((UINT64_C(1) << (uint64_t)m) & coord->moves_mask_gendata)) continue; moved = move(c, m); ii = coord->coord(moved, data); isnasty = coord->isnasty(ii, data); for (t = 0; t < NTRANS && (t == 0 || isnasty); t++) { - if (!((UINT64_C(1) << t) & coord->trans_mask)) + if (!((UINT64_C(1) << (uint64_t)t) & coord->trans_mask)) continue; j = coord->coord(transform(moved, t), data); @@ -285,14 +287,15 @@ genptable_coord_fillfromnew( { bool found; uint8_t m; - uint64_t tot, t, ii, j, nsim, sim[NTRANS]; + uint64_t tot, j, ii, nsim, sim[NTRANS]; + uint8_t t; cube_t c; tot = 0; c = coord->cube(i, data); for (t = 0, nsim = 0; t < NTRANS; t++) { - if (!((UINT64_C(1) << t) & coord->trans_mask)) + if (!((UINT64_C(1) << (uint64_t)t) & coord->trans_mask)) continue; ii = coord->coord(transform(c, t), data); @@ -305,7 +308,7 @@ genptable_coord_fillfromnew( for (j = 0, found = false; j < nsim && !found; j++) { c = coord->cube(sim[j], data); for (m = 0; m < NMOVES; m++) { - if (!((UINT32_C(1) << (uint32_t)m) & + if (!((UINT64_C(1) << (uint64_t)m) & coord->moves_mask_gendata)) continue; ii = coord->coord(move(c, m), data); -- cgit v1.3