diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/cube.h | 4 | ||||
| -rw-r--r-- | src/core/moves.h | 22 | ||||
| -rw-r--r-- | src/core/transform.h | 12 |
3 files changed, 19 insertions, 19 deletions
diff --git a/src/core/cube.h b/src/core/cube.h index 9e79dda..f52c15e 100644 --- a/src/core/cube.h +++ b/src/core/cube.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | STATIC bool cube_true(cube_t); | 1 | STATIC bool cube_true(cube_t); |
| 2 | 2 | ||
| 3 | STATIC cube_t cubefromarray(uint8_t [static 8], uint8_t [static 12]); | 3 | STATIC cube_t cubefromarray(uint8_t [SIZE(8)], uint8_t [SIZE(12)]); |
| 4 | STATIC bool isconsistent(oriented_cube_t); | 4 | STATIC bool isconsistent(oriented_cube_t); |
| 5 | STATIC bool issolvable(oriented_cube_t); | 5 | STATIC bool issolvable(oriented_cube_t); |
| 6 | STATIC bool issolved(oriented_cube_t); | 6 | STATIC bool issolved(oriented_cube_t); |
| @@ -29,7 +29,7 @@ cube_true(cube_t cube) | |||
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | STATIC cube_t | 31 | STATIC cube_t |
| 32 | cubefromarray(uint8_t c[static 8], uint8_t e[static 12]) | 32 | cubefromarray(uint8_t c[SIZE(8)], uint8_t e[SIZE(12)]) |
| 33 | { | 33 | { |
| 34 | return STATIC_CUBE( | 34 | return STATIC_CUBE( |
| 35 | c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], | 35 | c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], |
diff --git a/src/core/moves.h b/src/core/moves.h index 6169c6e..c162c1d 100644 --- a/src/core/moves.h +++ b/src/core/moves.h | |||
| @@ -4,15 +4,15 @@ | |||
| 4 | STATIC uint8_t readmove(char); | 4 | STATIC uint8_t readmove(char); |
| 5 | STATIC int64_t readmoves(const char *, | 5 | STATIC int64_t readmoves(const char *, |
| 6 | size_t, size_t, size_t *, size_t *, uint8_t *, uint8_t *); | 6 | size_t, size_t, size_t *, size_t *, uint8_t *, uint8_t *); |
| 7 | STATIC int64_t readmoves_struct(const char *, moves_struct_t [static 1]); | 7 | STATIC int64_t readmoves_struct(const char *, moves_struct_t [NON_NULL]); |
| 8 | STATIC int64_t countmoves(const char *); | 8 | STATIC int64_t countmoves(const char *); |
| 9 | STATIC bool moves_struct_equal( | 9 | STATIC bool moves_struct_equal( |
| 10 | const moves_struct_t [static 1], const moves_struct_t [static 1]); | 10 | const moves_struct_t [NON_NULL], const moves_struct_t [NON_NULL]); |
| 11 | STATIC long long comparemoves(const char *, const char *); | 11 | STATIC long long comparemoves(const char *, const char *); |
| 12 | STATIC uint8_t readmodifier(char); | 12 | STATIC uint8_t readmodifier(char); |
| 13 | STATIC int64_t writemoves(size_t, const uint8_t *, size_t, char *); | 13 | STATIC int64_t writemoves(size_t, const uint8_t *, size_t, char *); |
| 14 | STATIC int64_t writemoves_struct( | 14 | STATIC int64_t writemoves_struct( |
| 15 | const moves_struct_t [static 1], size_t, char *); | 15 | const moves_struct_t [NON_NULL], size_t, char *); |
| 16 | 16 | ||
| 17 | STATIC_INLINE bool allowednextmove(uint8_t, uint8_t); | 17 | STATIC_INLINE bool allowednextmove(uint8_t, uint8_t); |
| 18 | STATIC bool allowedmoves(size_t, const uint8_t *); | 18 | STATIC bool allowedmoves(size_t, const uint8_t *); |
| @@ -36,9 +36,9 @@ STATIC bool are_lastmoves_singlecw(size_t, const uint8_t*); | |||
| 36 | 36 | ||
| 37 | STATIC int64_t move_variations(const char *, const char *, size_t, char *); | 37 | STATIC int64_t move_variations(const char *, const char *, size_t, char *); |
| 38 | STATIC int64_t move_variations_lastqt( | 38 | STATIC int64_t move_variations_lastqt( |
| 39 | const moves_struct_t [static 1], size_t, char *); | 39 | const moves_struct_t [NON_NULL], size_t, char *); |
| 40 | STATIC int64_t move_variations_unniss( | 40 | STATIC int64_t move_variations_unniss( |
| 41 | const moves_struct_t [static 1], size_t, char *); | 41 | const moves_struct_t [NON_NULL], size_t, char *); |
| 42 | 42 | ||
| 43 | #define FOREACH_READMOVE(ARG_BUF, ARG_MOVE, ARG_C, ARG_MAX, \ | 43 | #define FOREACH_READMOVE(ARG_BUF, ARG_MOVE, ARG_C, ARG_MAX, \ |
| 44 | RET_ERROR, ARG_ACTION) \ | 44 | RET_ERROR, ARG_ACTION) \ |
| @@ -167,7 +167,7 @@ readmoves( | |||
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | STATIC int64_t | 169 | STATIC int64_t |
| 170 | readmoves_struct(const char *moves, moves_struct_t ret[static 1]) | 170 | readmoves_struct(const char *moves, moves_struct_t ret[NON_NULL]) |
| 171 | { | 171 | { |
| 172 | return readmoves(moves, NISSY_SIZE_MOVES, NISSY_SIZE_MOVES, | 172 | return readmoves(moves, NISSY_SIZE_MOVES, NISSY_SIZE_MOVES, |
| 173 | &ret->nnormal, &ret->ninverse, ret->normal, ret->inverse); | 173 | &ret->nnormal, &ret->ninverse, ret->normal, ret->inverse); |
| @@ -190,8 +190,8 @@ countmoves(const char *buf) | |||
| 190 | 190 | ||
| 191 | STATIC bool | 191 | STATIC bool |
| 192 | moves_struct_equal( | 192 | moves_struct_equal( |
| 193 | const moves_struct_t ms1[static 1], | 193 | const moves_struct_t ms1[NON_NULL], |
| 194 | const moves_struct_t ms2[static 1] | 194 | const moves_struct_t ms2[NON_NULL] |
| 195 | ) | 195 | ) |
| 196 | { | 196 | { |
| 197 | size_t i; | 197 | size_t i; |
| @@ -281,7 +281,7 @@ writemoves_error: | |||
| 281 | 281 | ||
| 282 | STATIC int64_t | 282 | STATIC int64_t |
| 283 | writemoves_struct( | 283 | writemoves_struct( |
| 284 | const moves_struct_t moves[static 1], | 284 | const moves_struct_t moves[NON_NULL], |
| 285 | size_t buf_size, | 285 | size_t buf_size, |
| 286 | char *buf | 286 | char *buf |
| 287 | ) | 287 | ) |
| @@ -612,7 +612,7 @@ move_variations( | |||
| 612 | 612 | ||
| 613 | STATIC int64_t | 613 | STATIC int64_t |
| 614 | move_variations_lastqt( | 614 | move_variations_lastqt( |
| 615 | const moves_struct_t s[static 1], | 615 | const moves_struct_t s[NON_NULL], |
| 616 | size_t result_size, | 616 | size_t result_size, |
| 617 | char *result | 617 | char *result |
| 618 | ) | 618 | ) |
| @@ -686,7 +686,7 @@ lastqt_error: | |||
| 686 | 686 | ||
| 687 | STATIC int64_t | 687 | STATIC int64_t |
| 688 | move_variations_unniss( | 688 | move_variations_unniss( |
| 689 | const moves_struct_t s[static 1], | 689 | const moves_struct_t s[NON_NULL], |
| 690 | size_t result_size, | 690 | size_t result_size, |
| 691 | char *result | 691 | char *result |
| 692 | ) | 692 | ) |
diff --git a/src/core/transform.h b/src/core/transform.h index f19c44f..206449b 100644 --- a/src/core/transform.h +++ b/src/core/transform.h | |||
| @@ -17,9 +17,9 @@ | |||
| 17 | invertco(compose(compose(TRANS_CUBE_ ## T, c), \ | 17 | invertco(compose(compose(TRANS_CUBE_ ## T, c), \ |
| 18 | TRANS_CUBE_ ## T ## _INVERSE)) | 18 | TRANS_CUBE_ ## T ## _INVERSE)) |
| 19 | 19 | ||
| 20 | STATIC uint8_t readtrans(const char [static NISSY_SIZE_TRANSFORMATION]); | 20 | STATIC uint8_t readtrans(const char [SIZE(NISSY_SIZE_TRANSFORMATION)]); |
| 21 | STATIC uint8_t readrotation(const char [static 2]); | 21 | STATIC uint8_t readrotation(const char [SIZE(2)]); |
| 22 | STATIC void writetrans(uint8_t, char [static NISSY_SIZE_TRANSFORMATION]); | 22 | STATIC void writetrans(uint8_t, char [SIZE(NISSY_SIZE_TRANSFORMATION)]); |
| 23 | 23 | ||
| 24 | STATIC cube_t transform_edges(cube_t, uint8_t); | 24 | STATIC cube_t transform_edges(cube_t, uint8_t); |
| 25 | STATIC cube_t transform_corners(cube_t, uint8_t); | 25 | STATIC cube_t transform_corners(cube_t, uint8_t); |
| @@ -29,7 +29,7 @@ STATIC_INLINE uint8_t inverse_trans(uint8_t); | |||
| 29 | STATIC uint64_t symmetry_mask(cube_t); | 29 | STATIC uint64_t symmetry_mask(cube_t); |
| 30 | 30 | ||
| 31 | STATIC uint8_t | 31 | STATIC uint8_t |
| 32 | readtrans(const char buf[static NISSY_SIZE_TRANSFORMATION]) | 32 | readtrans(const char buf[SIZE(NISSY_SIZE_TRANSFORMATION)]) |
| 33 | { | 33 | { |
| 34 | uint8_t t; | 34 | uint8_t t; |
| 35 | 35 | ||
| @@ -41,7 +41,7 @@ readtrans(const char buf[static NISSY_SIZE_TRANSFORMATION]) | |||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | STATIC uint8_t | 43 | STATIC uint8_t |
| 44 | readrotation(const char buf[static 2]) | 44 | readrotation(const char buf[SIZE(2)]) |
| 45 | { | 45 | { |
| 46 | char trans_str[NISSY_SIZE_TRANSFORMATION]; | 46 | char trans_str[NISSY_SIZE_TRANSFORMATION]; |
| 47 | 47 | ||
| @@ -53,7 +53,7 @@ readrotation(const char buf[static 2]) | |||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | STATIC void | 55 | STATIC void |
| 56 | writetrans(uint8_t t, char buf[static NISSY_SIZE_TRANSFORMATION]) | 56 | writetrans(uint8_t t, char buf[SIZE(NISSY_SIZE_TRANSFORMATION)]) |
| 57 | { | 57 | { |
| 58 | if (t >= 48) | 58 | if (t >= 48) |
| 59 | memcpy(buf, "error trans", 11); | 59 | memcpy(buf, "error trans", 11); |
