aboutsummaryrefslogtreecommitdiff
path: root/src/core/cube.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/cube.h')
-rw-r--r--src/core/cube.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/core/cube.h b/src/core/cube.h
index cdd3946..3ba282e 100644
--- a/src/core/cube.h
+++ b/src/core/cube.h
@@ -5,7 +5,7 @@ STATIC bool issolved(oriented_cube_t);
5STATIC bool iserror(oriented_cube_t); 5STATIC bool iserror(oriented_cube_t);
6STATIC void getcube_fix(long long *, long long *, 6STATIC void getcube_fix(long long *, long long *,
7 long long *, long long *, long long *); 7 long long *, long long *, long long *);
8STATIC cube_t getcube(int64_t, int64_t, int64_t, int64_t); 8STATIC cube_t getcube(uint64_t, uint64_t, uint64_t, uint64_t);
9 9
10STATIC oriented_cube_t readcube(const char *); 10STATIC oriented_cube_t readcube(const char *);
11STATIC int64_t writecube(oriented_cube_t, size_t n, char [n]); 11STATIC int64_t writecube(oriented_cube_t, size_t n, char [n]);
@@ -150,26 +150,26 @@ getcube_fix(
150{ 150{
151 uint8_t e[12], c[8], coarr[8]; 151 uint8_t e[12], c[8], coarr[8];
152 152
153 *ep = (*ep % FACT_12 + FACT_12) % FACT_12; 153 *ep = POSITIVE_MOD(*ep, (long long)FACT_12);
154 *eo = (*eo % POW_2_11 + POW_2_11) % POW_2_11; 154 *eo = POSITIVE_MOD(*eo, (long long)POW_2_11);
155 *cp = (*cp % FACT_8 + FACT_8) % FACT_8; 155 *cp = POSITIVE_MOD(*cp, (long long)FACT_8);
156 *co = (*cp % POW_3_7 + POW_3_7) % POW_3_7; 156 *co = POSITIVE_MOD(*co, (long long)POW_3_7);
157 *orien = (*orien % 24 + 24) % 24; 157 *orien = POSITIVE_MOD(*orien, 24LL);
158 158
159 indextoperm(*ep, 12, e); 159 indextoperm((uint64_t)*ep, 12, e);
160 indextoperm(*cp, 8, c); 160 indextoperm((uint64_t)*cp, 8, c);
161 if (permsign(12, e) != permsign(8, c)) { 161 if (permsign(12, e) != permsign(8, c)) {
162 SWAP(c[0], c[1]); 162 SWAP(c[0], c[1]);
163 *cp = permtoindex(8, c); 163 *cp = (long long)permtoindex(8, c);
164 164
165 sumzerotodigits(*co, 8, 3, coarr); 165 sumzerotodigits((uint64_t)*co, 8, 3, coarr);
166 SWAP(coarr[0], coarr[1]); 166 SWAP(coarr[0], coarr[1]);
167 *co = digitstosumzero(8, coarr, 3); 167 *co = (uint64_t)digitstosumzero(8, coarr, 3);
168 } 168 }
169} 169}
170 170
171STATIC cube_t 171STATIC cube_t
172getcube(int64_t ep, int64_t eo, int64_t cp, int64_t co) 172getcube(uint64_t ep, uint64_t eo, uint64_t cp, uint64_t co)
173{ 173{
174 uint8_t i, earr[12], carr[8], eoarr[12], coarr[8]; 174 uint8_t i, earr[12], carr[8], eoarr[12], coarr[8];
175 175

Generated with cgit - Back to sebastiano.tronto.net