From e6be287bbfa6beda038ec8b085300c5dc9c2ecd8 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 4 Apr 2026 12:02:56 +0200 Subject: Use macro for [static N] --- test/001_pieces/pieces_tests.c | 2 +- test/061_inverse_trans/inverse_trans_tests.c | 2 +- test/062_transform_move/transform_move_tests.c | 2 +- test/075_set_eo/set_eo_tests.c | 2 +- test/076_copy_co/copy_co_tests.c | 2 +- test/115_gendata_eoesep/gendata_eoesep_tests.c | 2 +- test/121_h48map/h48map_tests.c | 10 +++++----- test/122_gendata_h48short/gendata_h48short_tests.c | 8 ++++---- test/140_appendsolution/appendsolution_tests.c | 10 +++++----- test/test.h | 1 + 10 files changed, 21 insertions(+), 20 deletions(-) (limited to 'test') 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 @@ #include "../test.h" -void pieces(cube_t *, uint8_t [static 8], uint8_t [static 12]); +void pieces(cube_t *, uint8_t [SIZE(8)], uint8_t [SIZE(12)]); void run(void) { int i; 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 @@ #include "../test.h" -uint8_t readtrans(char [static NISSY_SIZE_TRANSFORMATION]); +uint8_t readtrans(char [SIZE(NISSY_SIZE_TRANSFORMATION)]); uint8_t inverse_trans(uint8_t); oriented_cube_t applymoves(oriented_cube_t, char *); 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..0810672 100644 --- a/test/062_transform_move/transform_move_tests.c +++ b/test/062_transform_move/transform_move_tests.c @@ -8,7 +8,7 @@ int64_t readmoves(const char *, size_t n, size_t m, size_t *, size_t *, uint8_t [n], uint8_t [m]); oriented_cube_t move_extended(oriented_cube_t, uint8_t); oriented_cube_t applymoves(oriented_cube_t, const char *); -uint8_t readtrans(const char[static NISSY_SIZE_TRANSFORMATION]); +uint8_t readtrans(const char[SIZE(NISSY_SIZE_TRANSFORMATION)]); void run(void) { 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 @@ uint64_t coord_eo(cube_t); void set_eo(cube_t *, uint64_t); -void pieces(cube_t *, uint8_t [static 8], uint8_t [static 12]); +void pieces(cube_t *, uint8_t [SIZE(8)], uint8_t [SIZE(12)]); void run(void) { 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 @@ #include "../test.h" void copy_co(cube_t *, cube_t); -void pieces(cube_t *, uint8_t [static 8], uint8_t [static 12]); +void pieces(cube_t *, uint8_t [SIZE(8)], uint8_t [SIZE(12)]); void run(void) { char str[STRLENMAX]; 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: unsigned char buf[FULLSIZE]; -size_t gendata_eoesep(unsigned char [static FULLSIZE], uint8_t); +size_t gendata_eoesep(unsigned char [SIZE(FULLSIZE)], uint8_t); int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); 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 @@ #define MAXPOS 1000 -void h48map_create(h48map_t [static 1], uint64_t, uint64_t); -void h48map_destroy(h48map_t [static 1]); -void h48map_insertmin(h48map_t [static 1], uint64_t, uint64_t); -uint64_t h48map_value(h48map_t [static 1], uint64_t); -kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]); +void h48map_create(h48map_t [NON_NULL], uint64_t, uint64_t); +void h48map_destroy(h48map_t [NON_NULL]); +void h48map_insertmin(h48map_t [NON_NULL], uint64_t, uint64_t); +uint64_t h48map_value(h48map_t [NON_NULL], uint64_t); +kvpair_t h48map_nextkvpair(h48map_t [NON_NULL], uint64_t [NON_NULL]); char str[STRLENMAX]; diff --git a/test/122_gendata_h48short/gendata_h48short_tests.c b/test/122_gendata_h48short/gendata_h48short_tests.c index 0de9408..efd378b 100644 --- a/test/122_gendata_h48short/gendata_h48short_tests.c +++ b/test/122_gendata_h48short/gendata_h48short_tests.c @@ -2,11 +2,11 @@ #define MAXPOS 200 -void h48map_create(h48map_t [static 1], uint64_t, uint64_t); -void h48map_destroy(h48map_t [static 1]); -kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]); +void h48map_create(h48map_t [NON_NULL], uint64_t, uint64_t); +void h48map_destroy(h48map_t [NON_NULL]); +kvpair_t h48map_nextkvpair(h48map_t [NON_NULL], uint64_t [NON_NULL]); size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); -uint64_t gendata_h48short(gendata_h48short_arg_t [static 1]); +uint64_t gendata_h48short(gendata_h48short_arg_t [NON_NULL]); char str[STRLENMAX]; diff --git a/test/140_appendsolution/appendsolution_tests.c b/test/140_appendsolution/appendsolution_tests.c index f9620ab..483c208 100644 --- a/test/140_appendsolution/appendsolution_tests.c +++ b/test/140_appendsolution/appendsolution_tests.c @@ -17,11 +17,11 @@ See below for the output format. uint8_t readtrans(const char [NISSY_SIZE_TRANSFORMATION]); int64_t readmoves(const char *, size_t n, size_t m, size_t *, size_t *, uint8_t [n], uint8_t [m]); -void solution_moves_reset(solution_moves_t [static 1]); -bool solution_list_init(solution_list_t [static 1], size_t n, char [n]); -int64_t appendsolution(const solution_moves_t [static 1], - size_t, const uint64_t *, const solution_settings_t [static 1], - solution_list_t [static 1]); +void solution_moves_reset(solution_moves_t [NON_NULL]); +bool solution_list_init(solution_list_t [NON_NULL], size_t n, char [n]); +int64_t appendsolution(const solution_moves_t [NON_NULL], + size_t, const uint64_t *, const solution_settings_t [NON_NULL], + solution_list_t [NON_NULL]); void run(void) { int i, j, nnt, ntrans; diff --git a/test/test.h b/test/test.h index 60e340f..3408130 100644 --- a/test/test.h +++ b/test/test.h @@ -7,6 +7,7 @@ #include #include +#include "../src/utils/compilers.h" #include "../src/utils/wrapthread.h" #include "../src/nissy.h" #include "../src/arch/arch.h" -- cgit v1.3