aboutsummaryrefslogtreecommitdiff
path: root/src/arch/portable.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/portable.h')
-rw-r--r--src/arch/portable.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/arch/portable.h b/src/arch/portable.h
index e9a8dd0..b8c5211 100644
--- a/src/arch/portable.h
+++ b/src/arch/portable.h
@@ -9,6 +9,18 @@
9#define SOLVED_CUBE STATIC_CUBE( \ 9#define SOLVED_CUBE STATIC_CUBE( \
10 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) 10 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
11 11
12/* TODO: optimize this (use bit tricks?) */
13STATIC_INLINE int
14popcount_u32(uint32_t x)
15{
16 int ret;
17
18 for (ret = 0; x != 0; x >>= 1)
19 ret += x & 1;
20
21 return ret;
22}
23
12STATIC void 24STATIC void
13pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12]) 25pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12])
14{ 26{

Generated with cgit - Back to sebastiano.tronto.net