From ea0387796a349c91032fbcb10f50c6ad8607b0f6 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 29 Jul 2025 12:12:43 +0200 Subject: All coordinates unsigned --- src/solvers/h48/coordinate.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/solvers/h48/coordinate.h') diff --git a/src/solvers/h48/coordinate.h b/src/solvers/h48/coordinate.h index 9437fa7..a7f0087 100644 --- a/src/solvers/h48/coordinate.h +++ b/src/solvers/h48/coordinate.h @@ -1,17 +1,17 @@ -STATIC_INLINE int64_t coord_h48( +STATIC_INLINE uint64_t coord_h48( cube_t, const uint32_t [static COCSEP_TABLESIZE], uint8_t); -STATIC_INLINE int64_t coord_h48_edges(cube_t, int64_t, uint8_t, uint8_t); +STATIC_INLINE uint64_t coord_h48_edges(cube_t, uint64_t, uint8_t, uint8_t); STATIC_INLINE cube_t invcoord_h48( - int64_t, const cube_t [static COCSEP_CLASSES], uint8_t); + uint64_t, const cube_t [static COCSEP_CLASSES], uint8_t); -STATIC_INLINE int64_t +STATIC_INLINE uint64_t coord_h48( cube_t c, const uint32_t cocsepdata[static COCSEP_TABLESIZE], uint8_t h ) { - int64_t cocsep, coclass; + uint64_t cocsep, coclass; uint32_t data; uint8_t ttrep; @@ -19,24 +19,24 @@ coord_h48( cocsep = coord_cocsep(c); data = cocsepdata[cocsep]; - coclass = (int64_t)COCLASS(data); - ttrep = (int64_t)TTREP(data); + coclass = COCLASS(data); + ttrep = TTREP(data); return coord_h48_edges(c, coclass, ttrep, h); } -STATIC_INLINE int64_t -coord_h48_edges(cube_t c, int64_t coclass, uint8_t ttrep, uint8_t h) +STATIC_INLINE uint64_t +coord_h48_edges(cube_t c, uint64_t coclass, uint8_t ttrep, uint8_t h) { cube_t d; - int64_t esep, eo, edges; + uint64_t esep, eo, edges; d = transform_edges(c, ttrep); esep = coord_esep(d); eo = coord_eo(d); edges = (esep << 11) + eo; - return (coclass * H48_ESIZE(11) + edges) >> (11 - (int64_t)h); + return (coclass * H48_ESIZE(11) + edges) >> (11 - (uint64_t)h); } /* @@ -46,17 +46,17 @@ returned cube is a transformed cube of one that gives the correct value. */ STATIC_INLINE cube_t invcoord_h48( - int64_t i, + uint64_t i, const cube_t crep[static COCSEP_CLASSES], uint8_t h ) { cube_t ret; - int64_t hh, coclass, ee, esep, eo; + uint64_t hh, coclass, ee, esep, eo; DBG_ASSERT(h <= 11, "invcoord_h48: h must be between 0 and 11\n"); - hh = (int64_t)h; + hh = (uint64_t)h; coclass = i / H48_ESIZE(h); ee = i % H48_ESIZE(h); esep = ee >> hh; -- cgit v1.3