diff options
Diffstat (limited to 'test')
21 files changed, 55 insertions, 54 deletions
diff --git a/test/001_pieces/pieces_tests.c b/test/001_pieces/pieces_tests.c index f46a143..7937fb1 100644 --- a/test/001_pieces/pieces_tests.c +++ b/test/001_pieces/pieces_tests.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | void pieces(cube_t *, uint8_t [static 8], uint8_t [static 12]); | 3 | void pieces(cube_t *, uint8_t [SIZE(8)], uint8_t [SIZE(12)]); |
| 4 | 4 | ||
| 5 | void run(void) { | 5 | void run(void) { |
| 6 | int i; | 6 | int i; |
diff --git a/test/010_math_permtoindex/permtoindex_tests.c b/test/010_math_permtoindex/permtoindex_tests.c index f246ef3..2a7ecf3 100644 --- a/test/010_math_permtoindex/permtoindex_tests.c +++ b/test/010_math_permtoindex/permtoindex_tests.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | uint64_t permtoindex(size_t n, const uint8_t [n]); | 3 | uint64_t permtoindex(size_t n, const uint8_t *); |
| 4 | 4 | ||
| 5 | void run(void) { | 5 | void run(void) { |
| 6 | char str[STRLENMAX]; | 6 | char str[STRLENMAX]; |
| @@ -11,7 +11,7 @@ void run(void) { | |||
| 11 | n = atoll(str); | 11 | n = atoll(str); |
| 12 | for (i = 0; i < n; i++) { | 12 | for (i = 0; i < n; i++) { |
| 13 | fgets(str, STRLENMAX, stdin); | 13 | fgets(str, STRLENMAX, stdin); |
| 14 | a[i] = atoi(str); | 14 | a[i] = (uint8_t)atoi(str); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | p = permtoindex(n, a); | 17 | p = permtoindex(n, a); |
diff --git a/test/011_math_indextoperm/indextoperm_tests.c b/test/011_math_indextoperm/indextoperm_tests.c index e83cbad..1464d7b 100644 --- a/test/011_math_indextoperm/indextoperm_tests.c +++ b/test/011_math_indextoperm/indextoperm_tests.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | void indextoperm(uint64_t, size_t n, uint8_t [n]); | 3 | void indextoperm(uint64_t, size_t n, uint8_t *); |
| 4 | 4 | ||
| 5 | void run(void) { | 5 | void run(void) { |
| 6 | char str[STRLENMAX]; | 6 | char str[STRLENMAX]; |
diff --git a/test/012_math_permsign/permsign_tests.c b/test/012_math_permsign/permsign_tests.c index 5b4daa3..f5a52d0 100644 --- a/test/012_math_permsign/permsign_tests.c +++ b/test/012_math_permsign/permsign_tests.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | int permsign(size_t n, const uint8_t [n]); | 3 | int permsign(size_t n, const uint8_t *); |
| 4 | 4 | ||
| 5 | void run(void) { | 5 | void run(void) { |
| 6 | char str[STRLENMAX]; | 6 | char str[STRLENMAX]; |
| @@ -13,7 +13,7 @@ void run(void) { | |||
| 13 | 13 | ||
| 14 | for (i = 0; i < n; i++) { | 14 | for (i = 0; i < n; i++) { |
| 15 | fgets(str, STRLENMAX, stdin); | 15 | fgets(str, STRLENMAX, stdin); |
| 16 | a[i] = atoi(str); | 16 | a[i] = (uint8_t)atoi(str); |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | p = permsign(n, a); | 19 | p = permsign(n, a); |
diff --git a/test/013_math_digitstosumzero/digitstosumzero_tests.c b/test/013_math_digitstosumzero/digitstosumzero_tests.c index 5c93083..8df1848 100644 --- a/test/013_math_digitstosumzero/digitstosumzero_tests.c +++ b/test/013_math_digitstosumzero/digitstosumzero_tests.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | uint64_t digitstosumzero(size_t n, uint8_t [n], uint8_t); | 3 | uint64_t digitstosumzero(size_t n, uint8_t *, uint8_t); |
| 4 | 4 | ||
| 5 | void run(void) { | 5 | void run(void) { |
| 6 | char str[STRLENMAX]; | 6 | char str[STRLENMAX]; |
| @@ -11,10 +11,10 @@ void run(void) { | |||
| 11 | fgets(str, STRLENMAX, stdin); | 11 | fgets(str, STRLENMAX, stdin); |
| 12 | n = atoi(str); | 12 | n = atoi(str); |
| 13 | fgets(str, STRLENMAX, stdin); | 13 | fgets(str, STRLENMAX, stdin); |
| 14 | b = atoi(str); | 14 | b = (uint8_t)atoi(str); |
| 15 | for (i = 0; i < n; i++) { | 15 | for (i = 0; i < n; i++) { |
| 16 | fgets(str, STRLENMAX, stdin); | 16 | fgets(str, STRLENMAX, stdin); |
| 17 | a[i] = atoi(str); | 17 | a[i] = (uint8_t)atoi(str); |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | p = digitstosumzero(n, a, b); | 20 | p = digitstosumzero(n, a, b); |
diff --git a/test/014_math_sumzerotodigits/sumzerotodigits.c b/test/014_math_sumzerotodigits/sumzerotodigits.c index e8d2814..256ca5a 100644 --- a/test/014_math_sumzerotodigits/sumzerotodigits.c +++ b/test/014_math_sumzerotodigits/sumzerotodigits.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | void sumzerotodigits(uint64_t, size_t n, uint8_t, uint8_t [n]); | 3 | void sumzerotodigits(uint64_t, size_t n, uint8_t, uint8_t *); |
| 4 | 4 | ||
| 5 | void run(void) { | 5 | void run(void) { |
| 6 | char str[STRLENMAX]; | 6 | char str[STRLENMAX]; |
| @@ -8,9 +8,9 @@ void run(void) { | |||
| 8 | uint64_t d; | 8 | uint64_t d; |
| 9 | 9 | ||
| 10 | fgets(str, STRLENMAX, stdin); | 10 | fgets(str, STRLENMAX, stdin); |
| 11 | n = atoi(str); | 11 | n = (uint8_t)atoi(str); |
| 12 | fgets(str, STRLENMAX, stdin); | 12 | fgets(str, STRLENMAX, stdin); |
| 13 | b = atoi(str); | 13 | b = (uint8_t)atoi(str); |
| 14 | fgets(str, STRLENMAX, stdin); | 14 | fgets(str, STRLENMAX, stdin); |
| 15 | d = atoll(str); | 15 | d = atoll(str); |
| 16 | 16 | ||
diff --git a/test/033_inverse_move/inverse_move_tests.c b/test/033_inverse_move/inverse_move_tests.c index 5453f83..86bf741 100644 --- a/test/033_inverse_move/inverse_move_tests.c +++ b/test/033_inverse_move/inverse_move_tests.c | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | extern char *movestr[]; | 3 | extern char *movestr[]; |
| 4 | 4 | ||
| 5 | int64_t readmoves(const char *, size_t n, size_t m, | 5 | int64_t readmoves(const char *, size_t n, size_t m, |
| 6 | size_t *, size_t *, uint8_t [n], uint8_t [m]); | 6 | size_t *, size_t *, uint8_t *, uint8_t *); |
| 7 | uint8_t inverse_move(uint8_t); | 7 | uint8_t inverse_move(uint8_t); |
| 8 | 8 | ||
| 9 | void run(void) { | 9 | void run(void) { |
diff --git a/test/061_inverse_trans/inverse_trans_tests.c b/test/061_inverse_trans/inverse_trans_tests.c index bad39fa..bb2a271 100644 --- a/test/061_inverse_trans/inverse_trans_tests.c +++ b/test/061_inverse_trans/inverse_trans_tests.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | uint8_t readtrans(char [static NISSY_SIZE_TRANSFORMATION]); | 3 | uint8_t readtrans(char [SIZE(NISSY_SIZE_TRANSFORMATION)]); |
| 4 | uint8_t inverse_trans(uint8_t); | 4 | uint8_t inverse_trans(uint8_t); |
| 5 | oriented_cube_t applymoves(oriented_cube_t, char *); | 5 | oriented_cube_t applymoves(oriented_cube_t, char *); |
| 6 | oriented_cube_t applytrans(oriented_cube_t, char *); | 6 | oriented_cube_t applytrans(oriented_cube_t, char *); |
diff --git a/test/062_transform_move/transform_move_tests.c b/test/062_transform_move/transform_move_tests.c index 218c6a1..a9beb60 100644 --- a/test/062_transform_move/transform_move_tests.c +++ b/test/062_transform_move/transform_move_tests.c | |||
| @@ -5,10 +5,10 @@ | |||
| 5 | cube_t applytrans(cube_t, const char *); | 5 | cube_t applytrans(cube_t, const char *); |
| 6 | uint8_t transform_move(uint8_t, uint8_t); | 6 | uint8_t transform_move(uint8_t, uint8_t); |
| 7 | int64_t readmoves(const char *, size_t n, size_t m, | 7 | int64_t readmoves(const char *, size_t n, size_t m, |
| 8 | size_t *, size_t *, uint8_t [n], uint8_t [m]); | 8 | size_t *, size_t *, uint8_t *, uint8_t *); |
| 9 | oriented_cube_t move_extended(oriented_cube_t, uint8_t); | 9 | oriented_cube_t move_extended(oriented_cube_t, uint8_t); |
| 10 | oriented_cube_t applymoves(oriented_cube_t, const char *); | 10 | oriented_cube_t applymoves(oriented_cube_t, const char *); |
| 11 | uint8_t readtrans(const char[static NISSY_SIZE_TRANSFORMATION]); | 11 | uint8_t readtrans(const char[SIZE(NISSY_SIZE_TRANSFORMATION)]); |
| 12 | 12 | ||
| 13 | void run(void) { | 13 | void run(void) { |
| 14 | char movestr[STRLENMAX], transtr[STRLENMAX], cubestr[STRLENMAX]; | 14 | char movestr[STRLENMAX], transtr[STRLENMAX], cubestr[STRLENMAX]; |
diff --git a/test/075_set_eo/set_eo_tests.c b/test/075_set_eo/set_eo_tests.c index a0ad3fe..0ce22e0 100644 --- a/test/075_set_eo/set_eo_tests.c +++ b/test/075_set_eo/set_eo_tests.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | uint64_t coord_eo(cube_t); | 3 | uint64_t coord_eo(cube_t); |
| 4 | void set_eo(cube_t *, uint64_t); | 4 | void set_eo(cube_t *, uint64_t); |
| 5 | void pieces(cube_t *, uint8_t [static 8], uint8_t [static 12]); | 5 | void pieces(cube_t *, uint8_t [SIZE(8)], uint8_t [SIZE(12)]); |
| 6 | 6 | ||
| 7 | void run(void) { | 7 | void run(void) { |
| 8 | char str[STRLENMAX]; | 8 | char str[STRLENMAX]; |
diff --git a/test/076_copy_co/copy_co_tests.c b/test/076_copy_co/copy_co_tests.c index 3ca109b..4127022 100644 --- a/test/076_copy_co/copy_co_tests.c +++ b/test/076_copy_co/copy_co_tests.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | void copy_co(cube_t *, cube_t); | 3 | void copy_co(cube_t *, cube_t); |
| 4 | void pieces(cube_t *, uint8_t [static 8], uint8_t [static 12]); | 4 | void pieces(cube_t *, uint8_t [SIZE(8)], uint8_t [SIZE(12)]); |
| 5 | 5 | ||
| 6 | void run(void) { | 6 | void run(void) { |
| 7 | char str[STRLENMAX]; | 7 | char str[STRLENMAX]; |
diff --git a/test/090_allowedmoves/allowedmoves_tests.c b/test/090_allowedmoves/allowedmoves_tests.c index aa6bda7..cff8303 100644 --- a/test/090_allowedmoves/allowedmoves_tests.c +++ b/test/090_allowedmoves/allowedmoves_tests.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | bool allowedmoves(size_t n, const uint8_t [n]); | 3 | bool allowedmoves(size_t n, const uint8_t *); |
| 4 | 4 | ||
| 5 | static char *moves[] = { | 5 | static char *moves[] = { |
| 6 | "U", "U2", "U'", | 6 | "U", "U2", "U'", |
| @@ -13,8 +13,8 @@ static char *moves[] = { | |||
| 13 | 13 | ||
| 14 | void run(void) { | 14 | void run(void) { |
| 15 | char movestr[STRLENMAX]; | 15 | char movestr[STRLENMAX]; |
| 16 | uint8_t m[100]; | 16 | uint8_t j, m[100]; |
| 17 | int n, i, j; | 17 | int n, i; |
| 18 | 18 | ||
| 19 | fgets(movestr, STRLENMAX, stdin); | 19 | fgets(movestr, STRLENMAX, stdin); |
| 20 | n = atoi(movestr); | 20 | n = atoi(movestr); |
diff --git a/test/114_cocsep_ttrep/cocsep_ttrep_tests.c b/test/114_cocsep_ttrep/cocsep_ttrep_tests.c index c5c1bb5..936dac3 100644 --- a/test/114_cocsep_ttrep/cocsep_ttrep_tests.c +++ b/test/114_cocsep_ttrep/cocsep_ttrep_tests.c | |||
| @@ -6,9 +6,9 @@ uint64_t coord_cocsep(cube_t); | |||
| 6 | size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); | 6 | size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); |
| 7 | 7 | ||
| 8 | void run(void) { | 8 | void run(void) { |
| 9 | uint8_t t; | 9 | uint8_t t, tt; |
| 10 | unsigned char buf[2000000]; | 10 | unsigned char buf[2000000]; |
| 11 | uint32_t *cocsepdata, tt; | 11 | uint32_t *cocsepdata; |
| 12 | uint64_t i, selfsim[COCSEP_CLASSES]; | 12 | uint64_t i, selfsim[COCSEP_CLASSES]; |
| 13 | uint64_t j, k, l; | 13 | uint64_t j, k, l; |
| 14 | cube_t rep[COCSEP_CLASSES], c, d; | 14 | cube_t rep[COCSEP_CLASSES], c, d; |
diff --git a/test/115_gendata_eoesep/gendata_eoesep_tests.c b/test/115_gendata_eoesep/gendata_eoesep_tests.c index 7ed9778..76de323 100644 --- a/test/115_gendata_eoesep/gendata_eoesep_tests.c +++ b/test/115_gendata_eoesep/gendata_eoesep_tests.c | |||
| @@ -25,7 +25,7 @@ The test does not generate the full table. For reference, these are the values: | |||
| 25 | 25 | ||
| 26 | unsigned char buf[FULLSIZE]; | 26 | unsigned char buf[FULLSIZE]; |
| 27 | 27 | ||
| 28 | size_t gendata_eoesep(unsigned char [static FULLSIZE], uint8_t); | 28 | size_t gendata_eoesep(unsigned char [SIZE(FULLSIZE)], uint8_t); |
| 29 | int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); | 29 | int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); |
| 30 | 30 | ||
| 31 | void run(void) { | 31 | void run(void) { |
diff --git a/test/121_h48map/h48map_tests.c b/test/121_h48map/h48map_tests.c index 927b157..e06c395 100644 --- a/test/121_h48map/h48map_tests.c +++ b/test/121_h48map/h48map_tests.c | |||
| @@ -2,11 +2,11 @@ | |||
| 2 | 2 | ||
| 3 | #define MAXPOS 1000 | 3 | #define MAXPOS 1000 |
| 4 | 4 | ||
| 5 | void h48map_create(h48map_t [static 1], uint64_t, uint64_t); | 5 | void h48map_create(h48map_t [NON_NULL], uint64_t, uint64_t); |
| 6 | void h48map_destroy(h48map_t [static 1]); | 6 | void h48map_destroy(h48map_t [NON_NULL]); |
| 7 | void h48map_insertmin(h48map_t [static 1], uint64_t, uint64_t); | 7 | void h48map_insertmin(h48map_t [NON_NULL], uint64_t, uint64_t); |
| 8 | uint64_t h48map_value(h48map_t [static 1], uint64_t); | 8 | uint64_t h48map_value(h48map_t [NON_NULL], uint64_t); |
| 9 | kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]); | 9 | kvpair_t h48map_nextkvpair(h48map_t [NON_NULL], uint64_t [NON_NULL]); |
| 10 | 10 | ||
| 11 | char str[STRLENMAX]; | 11 | char str[STRLENMAX]; |
| 12 | 12 | ||
diff --git a/test/122_gendata_h48short/gendata_h48short_tests.c b/test/122_gendata_h48short/gendata_h48short_tests.c index 0de9408..0996f8c 100644 --- a/test/122_gendata_h48short/gendata_h48short_tests.c +++ b/test/122_gendata_h48short/gendata_h48short_tests.c | |||
| @@ -2,11 +2,11 @@ | |||
| 2 | 2 | ||
| 3 | #define MAXPOS 200 | 3 | #define MAXPOS 200 |
| 4 | 4 | ||
| 5 | void h48map_create(h48map_t [static 1], uint64_t, uint64_t); | 5 | void h48map_create(h48map_t [NON_NULL], uint64_t, uint64_t); |
| 6 | void h48map_destroy(h48map_t [static 1]); | 6 | void h48map_destroy(h48map_t [NON_NULL]); |
| 7 | kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]); | 7 | kvpair_t h48map_nextkvpair(h48map_t [NON_NULL], uint64_t [NON_NULL]); |
| 8 | size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); | 8 | size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); |
| 9 | uint64_t gendata_h48short(gendata_h48short_arg_t [static 1]); | 9 | uint64_t gendata_h48short(gendata_h48short_arg_t [NON_NULL]); |
| 10 | 10 | ||
| 11 | char str[STRLENMAX]; | 11 | char str[STRLENMAX]; |
| 12 | 12 | ||
| @@ -34,7 +34,7 @@ void run(void) { | |||
| 34 | 34 | ||
| 35 | capacity = readl(); | 35 | capacity = readl(); |
| 36 | randomizer = readl(); | 36 | randomizer = readl(); |
| 37 | arg.maxdepth = readl(); | 37 | arg.maxdepth = (uint8_t)readl(); |
| 38 | arg.crep = crep; | 38 | arg.crep = crep; |
| 39 | arg.selfsim = selfsim; | 39 | arg.selfsim = selfsim; |
| 40 | arg.map = ↦ | 40 | arg.map = ↦ |
diff --git a/test/131_coorddata_dr/coorddata_dr.c b/test/131_coorddata_dr/coorddata_dr.c index d8ac94a..d262fe3 100644 --- a/test/131_coorddata_dr/coorddata_dr.c +++ b/test/131_coorddata_dr/coorddata_dr.c | |||
| @@ -11,7 +11,7 @@ size_t coordinate_dr_gendata(unsigned char *); | |||
| 11 | 11 | ||
| 12 | void run(void) { | 12 | void run(void) { |
| 13 | bool found; | 13 | bool found; |
| 14 | uint64_t t; | 14 | uint8_t t; |
| 15 | char str[STRLENMAX]; | 15 | char str[STRLENMAX]; |
| 16 | unsigned char *data; | 16 | unsigned char *data; |
| 17 | size_t size; | 17 | size_t size; |
| @@ -33,8 +33,8 @@ void run(void) { | |||
| 33 | goto cleanup; | 33 | goto cleanup; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | for (t = 0, found = false; t < 48; t++) { | 36 | for (t = 0, found = false, coord2 = UINT64_MAX; t < 48; t++) { |
| 37 | if (!((UINT64_C(1) << t) & TGROUP)) | 37 | if (!((UINT64_C(1) << (uint8_t)t) & TGROUP)) |
| 38 | continue; | 38 | continue; |
| 39 | 39 | ||
| 40 | coord2 = coordinate_dr_coord(transform(cube, t), data); | 40 | coord2 = coordinate_dr_coord(transform(cube, t), data); |
diff --git a/test/132_coorddata_dreo/coorddata_dreo.c b/test/132_coorddata_dreo/coorddata_dreo.c index 2b99b7f..50294ff 100644 --- a/test/132_coorddata_dreo/coorddata_dreo.c +++ b/test/132_coorddata_dreo/coorddata_dreo.c | |||
| @@ -11,7 +11,7 @@ size_t coordinate_dreo_gendata(unsigned char *); | |||
| 11 | 11 | ||
| 12 | void run(void) { | 12 | void run(void) { |
| 13 | bool found; | 13 | bool found; |
| 14 | uint64_t t; | 14 | uint8_t t; |
| 15 | char str[STRLENMAX]; | 15 | char str[STRLENMAX]; |
| 16 | unsigned char *data; | 16 | unsigned char *data; |
| 17 | size_t size; | 17 | size_t size; |
| @@ -33,8 +33,8 @@ void run(void) { | |||
| 33 | goto cleanup; | 33 | goto cleanup; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | for (t = 0, found = false; t < 48; t++) { | 36 | for (t = 0, found = false, coord2 = UINT64_MAX; t < 48; t++) { |
| 37 | if (!((UINT64_C(1) << t) & TGROUP)) | 37 | if (!((UINT64_C(1) << (uint64_t)t) & TGROUP)) |
| 38 | continue; | 38 | continue; |
| 39 | 39 | ||
| 40 | coord2 = coordinate_dreo_coord(transform(cube, t), data); | 40 | coord2 = coordinate_dreo_coord(transform(cube, t), data); |
diff --git a/test/133_coordata_drfinnoe/coorddata_drfinnoe.c b/test/133_coordata_drfinnoe/coorddata_drfinnoe.c index 11ae9f7..7d19361 100644 --- a/test/133_coordata_drfinnoe/coorddata_drfinnoe.c +++ b/test/133_coordata_drfinnoe/coorddata_drfinnoe.c | |||
| @@ -10,7 +10,7 @@ size_t coordinate_drfinnoe_gendata(unsigned char *); | |||
| 10 | 10 | ||
| 11 | void run(void) { | 11 | void run(void) { |
| 12 | bool found; | 12 | bool found; |
| 13 | uint64_t t; | 13 | uint8_t t; |
| 14 | char str[STRLENMAX]; | 14 | char str[STRLENMAX]; |
| 15 | unsigned char *data; | 15 | unsigned char *data; |
| 16 | size_t size; | 16 | size_t size; |
| @@ -32,8 +32,8 @@ void run(void) { | |||
| 32 | goto cleanup; | 32 | goto cleanup; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | for (t = 0, found = false; t < 48; t++) { | 35 | for (t = 0, found = false, coord2 = UINT64_MAX; t < 48; t++) { |
| 36 | if (!((UINT64_C(1) << t) & TGROUP)) | 36 | if (!((UINT64_C(1) << (uint64_t)t) & TGROUP)) |
| 37 | continue; | 37 | continue; |
| 38 | 38 | ||
| 39 | coord2 = coordinate_drfinnoe_coord(transform(cube, t), data); | 39 | coord2 = coordinate_drfinnoe_coord(transform(cube, t), data); |
diff --git a/test/140_appendsolution/appendsolution_tests.c b/test/140_appendsolution/appendsolution_tests.c index f9620ab..3f4fb15 100644 --- a/test/140_appendsolution/appendsolution_tests.c +++ b/test/140_appendsolution/appendsolution_tests.c | |||
| @@ -16,12 +16,12 @@ See below for the output format. | |||
| 16 | 16 | ||
| 17 | uint8_t readtrans(const char [NISSY_SIZE_TRANSFORMATION]); | 17 | uint8_t readtrans(const char [NISSY_SIZE_TRANSFORMATION]); |
| 18 | int64_t readmoves(const char *, size_t n, size_t m, | 18 | int64_t readmoves(const char *, size_t n, size_t m, |
| 19 | size_t *, size_t *, uint8_t [n], uint8_t [m]); | 19 | size_t *, size_t *, uint8_t *, uint8_t *); |
| 20 | void solution_moves_reset(solution_moves_t [static 1]); | 20 | void solution_moves_reset(solution_moves_t [NON_NULL]); |
| 21 | bool solution_list_init(solution_list_t [static 1], size_t n, char [n]); | 21 | bool solution_list_init(solution_list_t [NON_NULL], size_t n, char *); |
| 22 | int64_t appendsolution(const solution_moves_t [static 1], | 22 | int64_t appendsolution(const solution_moves_t [NON_NULL], |
| 23 | size_t, const uint64_t *, const solution_settings_t [static 1], | 23 | size_t, const uint64_t *, const solution_settings_t [NON_NULL], |
| 24 | solution_list_t [static 1]); | 24 | solution_list_t [NON_NULL]); |
| 25 | 25 | ||
| 26 | void run(void) { | 26 | void run(void) { |
| 27 | int i, j, nnt, ntrans; | 27 | int i, j, nnt, ntrans; |
| @@ -39,7 +39,7 @@ void run(void) { | |||
| 39 | .unniss = false, | 39 | .unniss = false, |
| 40 | .maxmoves = 20, | 40 | .maxmoves = 20, |
| 41 | .maxsolutions = 100, | 41 | .maxsolutions = 100, |
| 42 | .optimal = -1, | 42 | .optimal = 0, |
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | fgets(str, STRLENMAX, stdin); | 45 | fgets(str, STRLENMAX, stdin); |
| @@ -48,8 +48,8 @@ void run(void) { | |||
| 48 | printf("Test error reading moves\n"); | 48 | printf("Test error reading moves\n"); |
| 49 | return; | 49 | return; |
| 50 | } | 50 | } |
| 51 | moves.nmoves = nm; | 51 | moves.nmoves = (uint8_t)nm; |
| 52 | moves.npremoves = np; | 52 | moves.npremoves = (uint8_t)np; |
| 53 | fgets(str, STRLENMAX, stdin); | 53 | fgets(str, STRLENMAX, stdin); |
| 54 | settings.unniss = (bool)atoi(str); | 54 | settings.unniss = (bool)atoi(str); |
| 55 | 55 | ||
| @@ -64,7 +64,7 @@ void run(void) { | |||
| 64 | } | 64 | } |
| 65 | } | 65 | } |
| 66 | fgets(str, STRLENMAX, stdin); | 66 | fgets(str, STRLENMAX, stdin); |
| 67 | settings.orientation = atoi(str); | 67 | settings.orientation = (uint8_t)atoi(str); |
| 68 | 68 | ||
| 69 | appendsolution(&moves, nnt, tmask, &settings, &list); | 69 | appendsolution(&moves, nnt, tmask, &settings, &list); |
| 70 | 70 | ||
diff --git a/test/test.h b/test/test.h index 60e340f..b8c5922 100644 --- a/test/test.h +++ b/test/test.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
| 8 | #include <string.h> | 8 | #include <string.h> |
| 9 | 9 | ||
| 10 | #include "../src/utils/compilers.h" | ||
| 10 | #include "../src/utils/wrapthread.h" | 11 | #include "../src/utils/wrapthread.h" |
| 11 | #include "../src/nissy.h" | 12 | #include "../src/nissy.h" |
| 12 | #include "../src/arch/arch.h" | 13 | #include "../src/arch/arch.h" |
| @@ -27,7 +28,7 @@ bool isconsistent(oriented_cube_t); | |||
| 27 | bool issolvable(oriented_cube_t); | 28 | bool issolvable(oriented_cube_t); |
| 28 | bool issolved(oriented_cube_t); | 29 | bool issolved(oriented_cube_t); |
| 29 | oriented_cube_t readcube(char *); | 30 | oriented_cube_t readcube(char *); |
| 30 | int64_t writecube(oriented_cube_t, size_t n, char [n]); | 31 | int64_t writecube(oriented_cube_t, size_t n, char *); |
| 31 | 32 | ||
| 32 | /* Test function to be implemented by all tests */ | 33 | /* Test function to be implemented by all tests */ |
| 33 | void run(void); | 34 | void run(void); |
