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] --- src/solvers/h48/coordinate.h | 8 ++--- src/solvers/h48/distribution_h48.h | 6 ++-- src/solvers/h48/gendata_cocsep.h | 16 +++++----- src/solvers/h48/gendata_eoesep.h | 54 +++++++++++++++++----------------- src/solvers/h48/gendata_h48.h | 32 ++++++++++---------- src/solvers/h48/map.h | 28 +++++++++--------- src/solvers/h48/solve.h | 60 +++++++++++++++++++------------------- src/solvers/h48/utils.h | 8 ++--- 8 files changed, 106 insertions(+), 106 deletions(-) (limited to 'src/solvers/h48') diff --git a/src/solvers/h48/coordinate.h b/src/solvers/h48/coordinate.h index a7f0087..695efc3 100644 --- a/src/solvers/h48/coordinate.h +++ b/src/solvers/h48/coordinate.h @@ -1,13 +1,13 @@ STATIC_INLINE uint64_t coord_h48( - cube_t, const uint32_t [static COCSEP_TABLESIZE], uint8_t); + cube_t, const uint32_t [SIZE(COCSEP_TABLESIZE)], uint8_t); STATIC_INLINE uint64_t coord_h48_edges(cube_t, uint64_t, uint8_t, uint8_t); STATIC_INLINE cube_t invcoord_h48( - uint64_t, const cube_t [static COCSEP_CLASSES], uint8_t); + uint64_t, const cube_t [SIZE(COCSEP_CLASSES)], uint8_t); STATIC_INLINE uint64_t coord_h48( cube_t c, - const uint32_t cocsepdata[static COCSEP_TABLESIZE], + const uint32_t cocsepdata[SIZE(COCSEP_TABLESIZE)], uint8_t h ) { @@ -47,7 +47,7 @@ returned cube is a transformed cube of one that gives the correct value. STATIC_INLINE cube_t invcoord_h48( uint64_t i, - const cube_t crep[static COCSEP_CLASSES], + const cube_t crep[SIZE(COCSEP_CLASSES)], uint8_t h ) { diff --git a/src/solvers/h48/distribution_h48.h b/src/solvers/h48/distribution_h48.h index 80c946e..2cb50aa 100644 --- a/src/solvers/h48/distribution_h48.h +++ b/src/solvers/h48/distribution_h48.h @@ -6,7 +6,7 @@ to have some duplication than to make these functions needlessly generic. STATIC wrapthread_return_t getdistribution_h48_runthread(void *); STATIC void getdistribution_h48(const unsigned char *, - uint64_t [static INFO_DISTRIBUTION_LEN], const tableinfo_t [static 1]); + uint64_t [SIZE(INFO_DISTRIBUTION_LEN)], const tableinfo_t [NON_NULL]); STATIC wrapthread_return_t getdistribution_h48_runthread(void *arg) @@ -39,8 +39,8 @@ getdistribution_h48_runthread(void *arg) STATIC void getdistribution_h48( const unsigned char *table, - uint64_t distr[static INFO_DISTRIBUTION_LEN], - const tableinfo_t info[static 1] + uint64_t distr[SIZE(INFO_DISTRIBUTION_LEN)], + const tableinfo_t info[NON_NULL] ) { getdistribution_data_t targ[THREADS]; wrapthread_define_var_thread_t(thread[THREADS]); diff --git a/src/solvers/h48/gendata_cocsep.h b/src/solvers/h48/gendata_cocsep.h index db7ac95..17568ea 100644 --- a/src/solvers/h48/gendata_cocsep.h +++ b/src/solvers/h48/gendata_cocsep.h @@ -1,13 +1,13 @@ STATIC size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); -STATIC uint32_t gendata_cocsep_dfs(cocsep_dfs_arg_t [static 1]); +STATIC uint32_t gendata_cocsep_dfs(cocsep_dfs_arg_t [NON_NULL]); STATIC_INLINE bool gendata_cocsep_get_visited( - const uint8_t [static COCSEP_VISITEDSIZE], uint64_t); + const uint8_t [SIZE(COCSEP_VISITEDSIZE)], uint64_t); STATIC_INLINE void gendata_cocsep_set_visited( - uint8_t [static COCSEP_VISITEDSIZE], uint64_t); + uint8_t [SIZE(COCSEP_VISITEDSIZE)], uint64_t); STATIC_INLINE int8_t get_h48_cdata( - cube_t, const uint32_t [static COCSEP_TABLESIZE], uint32_t *); + cube_t, const uint32_t [SIZE(COCSEP_TABLESIZE)], uint32_t *); STATIC size_t gendata_cocsep( @@ -79,7 +79,7 @@ gendata_cocsep_return_size: } STATIC uint32_t -gendata_cocsep_dfs(cocsep_dfs_arg_t arg[static 1]) +gendata_cocsep_dfs(cocsep_dfs_arg_t arg[NON_NULL]) { uint8_t m; uint32_t cc, class, ttrep, depth, olddepth, tinv; @@ -135,7 +135,7 @@ gendata_cocsep_dfs(cocsep_dfs_arg_t arg[static 1]) STATIC_INLINE bool gendata_cocsep_get_visited( - const uint8_t a[static COCSEP_VISITEDSIZE], + const uint8_t a[SIZE(COCSEP_VISITEDSIZE)], uint64_t i ) { @@ -144,7 +144,7 @@ gendata_cocsep_get_visited( STATIC_INLINE void gendata_cocsep_set_visited( - uint8_t a[static COCSEP_VISITEDSIZE], + uint8_t a[SIZE(COCSEP_VISITEDSIZE)], uint64_t i ) { @@ -154,7 +154,7 @@ gendata_cocsep_set_visited( STATIC_INLINE int8_t get_h48_cdata( cube_t cube, - const uint32_t cocsepdata[static COCSEP_TABLESIZE], + const uint32_t cocsepdata[SIZE(COCSEP_TABLESIZE)], uint32_t *cdata ) { diff --git a/src/solvers/h48/gendata_eoesep.h b/src/solvers/h48/gendata_eoesep.h index e9a2794..271e877 100644 --- a/src/solvers/h48/gendata_eoesep.h +++ b/src/solvers/h48/gendata_eoesep.h @@ -1,25 +1,25 @@ -STATIC uint64_t coord_eoesep_sym(cube_t, const uint32_t [static ESEP_MAX]); +STATIC uint64_t coord_eoesep_sym(cube_t, const uint32_t [SIZE(ESEP_MAX)]); STATIC size_t gendata_esep_classes( - uint32_t [static ESEP_MAX], uint16_t [static ESEP_CLASSES]); + uint32_t [SIZE(ESEP_MAX)], uint16_t [SIZE(ESEP_CLASSES)]); STATIC size_t gendata_eoesep(unsigned char *, uint8_t); -STATIC uint32_t gendata_eoesep_bfs(uint8_t, uint8_t [static EOESEP_BUF], - uint32_t [static ESEP_MAX], uint16_t [static ESEP_CLASSES]); -STATIC uint32_t gendata_eoesep_fromnew(uint8_t, uint8_t [static EOESEP_BUF], - uint32_t [static ESEP_MAX], uint16_t [static ESEP_CLASSES]); -STATIC uint32_t gendata_eoesep_fromdone(uint8_t, uint8_t [static EOESEP_BUF], - uint32_t [static ESEP_MAX], uint16_t [static ESEP_CLASSES]); +STATIC uint32_t gendata_eoesep_bfs(uint8_t, uint8_t [SIZE(EOESEP_BUF)], + uint32_t [SIZE(ESEP_MAX)], uint16_t [SIZE(ESEP_CLASSES)]); +STATIC uint32_t gendata_eoesep_fromnew(uint8_t, uint8_t [SIZE(EOESEP_BUF)], + uint32_t [SIZE(ESEP_MAX)], uint16_t [SIZE(ESEP_CLASSES)]); +STATIC uint32_t gendata_eoesep_fromdone(uint8_t, uint8_t [SIZE(EOESEP_BUF)], + uint32_t [SIZE(ESEP_MAX)], uint16_t [SIZE(ESEP_CLASSES)]); STATIC uint32_t gendata_eoesep_marksim(uint64_t, uint8_t, - uint8_t [static EOESEP_BUF], uint32_t [static ESEP_MAX]); + uint8_t [SIZE(EOESEP_BUF)], uint32_t [SIZE(ESEP_MAX)]); STATIC bool gendata_eoesep_next(cube_t, uint8_t, - uint8_t [static EOESEP_BUF], uint32_t [static ESEP_MAX]); + uint8_t [SIZE(EOESEP_BUF)], uint32_t [SIZE(ESEP_MAX)]); STATIC uint8_t get_eoesep_pval( - const uint8_t [static DIV_ROUND_UP(EOESEP_TABLESIZE, 2)], uint64_t); + const uint8_t [SIZE(DIV_ROUND_UP(EOESEP_TABLESIZE, 2))], uint64_t); STATIC uint8_t get_eoesep_pval_cube(const unsigned char *, cube_t); STATIC void set_eoesep_pval( - uint8_t [static DIV_ROUND_UP(EOESEP_TABLESIZE, 2)], uint64_t, uint8_t); + uint8_t [SIZE(DIV_ROUND_UP(EOESEP_TABLESIZE, 2))], uint64_t, uint8_t); STATIC uint64_t -coord_eoesep_sym(cube_t c, const uint32_t esep_classes[static ESEP_MAX]) +coord_eoesep_sym(cube_t c, const uint32_t esep_classes[SIZE(ESEP_MAX)]) { uint8_t ttrep; uint32_t edata, class; @@ -36,8 +36,8 @@ coord_eoesep_sym(cube_t c, const uint32_t esep_classes[static ESEP_MAX]) STATIC size_t gendata_esep_classes( - uint32_t esep_classes[static ESEP_MAX], - uint16_t rep[static ESEP_CLASSES] + uint32_t esep_classes[SIZE(ESEP_MAX)], + uint16_t rep[SIZE(ESEP_CLASSES)] ) { bool visited[ESEP_MAX]; @@ -121,8 +121,8 @@ STATIC uint32_t gendata_eoesep_bfs( uint8_t d, uint8_t buf8[EOESEP_BUF], - uint32_t esep_classes[static ESEP_MAX], - uint16_t rep[static ESEP_CLASSES] + uint32_t esep_classes[SIZE(ESEP_MAX)], + uint16_t rep[SIZE(ESEP_CLASSES)] ) { if (d < 9) @@ -135,8 +135,8 @@ STATIC uint32_t gendata_eoesep_fromdone( uint8_t d, uint8_t buf8[EOESEP_BUF], - uint32_t esep_classes[static ESEP_MAX], - uint16_t rep[static ESEP_CLASSES] + uint32_t esep_classes[SIZE(ESEP_MAX)], + uint16_t rep[SIZE(ESEP_CLASSES)] ) { uint8_t pval; @@ -164,8 +164,8 @@ STATIC uint32_t gendata_eoesep_fromnew( uint8_t d, uint8_t buf8[EOESEP_BUF], - uint32_t esep_classes[static ESEP_MAX], - uint16_t rep[static ESEP_CLASSES] + uint32_t esep_classes[SIZE(ESEP_MAX)], + uint16_t rep[SIZE(ESEP_CLASSES)] ) { uint8_t pval; @@ -196,8 +196,8 @@ STATIC uint32_t gendata_eoesep_marksim( uint64_t i, uint8_t d, - uint8_t buf8[static EOESEP_BUF], - uint32_t esep_classes[static ESEP_MAX] + uint8_t buf8[SIZE(EOESEP_BUF)], + uint32_t esep_classes[SIZE(ESEP_MAX)] ) { uint8_t t, m, pval; @@ -227,8 +227,8 @@ STATIC bool gendata_eoesep_next( cube_t c, uint8_t d, - uint8_t buf8[static EOESEP_BUF], - uint32_t esep_classes[static ESEP_MAX] + uint8_t buf8[SIZE(EOESEP_BUF)], + uint32_t esep_classes[SIZE(ESEP_MAX)] ) { uint8_t m, t, pval; @@ -251,7 +251,7 @@ gendata_eoesep_next( STATIC uint8_t get_eoesep_pval( - const uint8_t table[static DIV_ROUND_UP(EOESEP_TABLESIZE, 2)], + const uint8_t table[SIZE(DIV_ROUND_UP(EOESEP_TABLESIZE, 2))], uint64_t i ) { @@ -270,7 +270,7 @@ get_eoesep_pval_cube(const unsigned char *data, cube_t c) STATIC void set_eoesep_pval( - uint8_t table[static DIV_ROUND_UP(EOESEP_TABLESIZE, 2)], + uint8_t table[SIZE(DIV_ROUND_UP(EOESEP_TABLESIZE, 2))], uint64_t i, uint8_t val ) diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index b37bcfb..283c472 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h @@ -1,15 +1,15 @@ STATIC long long gendata_h48_dispatch( const char *, unsigned long long, unsigned char *); -STATIC uint64_t gendata_h48short(gendata_h48short_arg_t [static 1]); -STATIC int64_t gendata_h48(gendata_h48_arg_t [static 1]); -STATIC void gendata_h48_maintable(gendata_h48_arg_t [static 1]); +STATIC uint64_t gendata_h48short(gendata_h48short_arg_t [NON_NULL]); +STATIC int64_t gendata_h48(gendata_h48_arg_t [NON_NULL]); +STATIC void gendata_h48_maintable(gendata_h48_arg_t [NON_NULL]); STATIC wrapthread_return_t gendata_h48_runthread(void *); -STATIC_INLINE void gendata_h48_mark(gendata_h48_mark_t [static 1]); +STATIC_INLINE void gendata_h48_mark(gendata_h48_mark_t [NON_NULL]); STATIC_INLINE bool gendata_h48_dfs_stop( - cube_t, int8_t, h48_dfs_arg_t [static 1]); -STATIC void gendata_h48_dfs(h48_dfs_arg_t [static 1]); -STATIC tableinfo_t makeinfo_h48(gendata_h48_arg_t [static 1]); + cube_t, int8_t, h48_dfs_arg_t [NON_NULL]); +STATIC void gendata_h48_dfs(h48_dfs_arg_t [NON_NULL]); +STATIC tableinfo_t makeinfo_h48(gendata_h48_arg_t [NON_NULL]); STATIC const uint32_t *get_cocsepdata_constptr(const unsigned char *); STATIC const unsigned char *get_h48data_constptr(const unsigned char *); @@ -19,7 +19,7 @@ STATIC_INLINE void set_h48_pval(unsigned char *, uint64_t, uint8_t); STATIC_INLINE uint8_t get_h48_pvalmin(const unsigned char *, uint64_t); STATIC_INLINE void set_h48_pvalmin(unsigned char *, uint64_t, uint8_t); STATIC_INLINE uint8_t get_h48_pval_and_min( - const unsigned char *, uint64_t, uint8_t [static 1]); + const unsigned char *, uint64_t, uint8_t [NON_NULL]); STATIC long long gendata_h48_dispatch( @@ -43,7 +43,7 @@ gendata_h48_dispatch( } STATIC uint64_t -gendata_h48short(gendata_h48short_arg_t arg[static 1]) +gendata_h48short(gendata_h48short_arg_t arg[NON_NULL]) { uint8_t i, m; uint64_t coord; @@ -77,7 +77,7 @@ gendata_h48short(gendata_h48short_arg_t arg[static 1]) } STATIC int64_t -gendata_h48(gendata_h48_arg_t arg[static 1]) +gendata_h48(gendata_h48_arg_t arg[NON_NULL]) { uint64_t size, cocsepsize, h48size, eoesepsize; long long r; @@ -149,7 +149,7 @@ gendata_h48(gendata_h48_arg_t arg[static 1]) } STATIC void -gendata_h48_maintable(gendata_h48_arg_t arg[static 1]) +gendata_h48_maintable(gendata_h48_arg_t arg[NON_NULL]) { /* * A good base value for the h48 tables have few positions with value @@ -332,7 +332,7 @@ gendata_h48_runthread(void *arg) } STATIC void -gendata_h48_dfs(h48_dfs_arg_t arg[static 1]) +gendata_h48_dfs(h48_dfs_arg_t arg[NON_NULL]) { int8_t d; uint8_t m[4]; @@ -411,7 +411,7 @@ gendata_h48_dfs(h48_dfs_arg_t arg[static 1]) } STATIC_INLINE void -gendata_h48_mark(gendata_h48_mark_t arg[static 1]) +gendata_h48_mark(gendata_h48_mark_t arg[NON_NULL]) { uint8_t oldval, newval, v; uint64_t coord, coordext, coordmin; @@ -435,7 +435,7 @@ gendata_h48_mark(gendata_h48_mark_t arg[static 1]) } STATIC_INLINE bool -gendata_h48_dfs_stop(cube_t cube, int8_t d, h48_dfs_arg_t arg[static 1]) +gendata_h48_dfs_stop(cube_t cube, int8_t d, h48_dfs_arg_t arg[NON_NULL]) { uint64_t val; uint64_t coord, coordext; @@ -463,7 +463,7 @@ gendata_h48_dfs_stop(cube_t cube, int8_t d, h48_dfs_arg_t arg[static 1]) } STATIC tableinfo_t -makeinfo_h48(gendata_h48_arg_t arg[static 1]) +makeinfo_h48(gendata_h48_arg_t arg[NON_NULL]) { tableinfo_t info; @@ -533,7 +533,7 @@ STATIC_INLINE uint8_t get_h48_pval_and_min( const unsigned char *table, uint64_t coord_noext, - uint8_t pval_min[static 1] + uint8_t pval_min[NON_NULL] ) { uint64_t iext, imin; diff --git a/src/solvers/h48/map.h b/src/solvers/h48/map.h index b603ee3..c9cfb06 100644 --- a/src/solvers/h48/map.h +++ b/src/solvers/h48/map.h @@ -1,13 +1,13 @@ -STATIC void h48map_create(h48map_t [static 1], uint64_t, uint64_t); -STATIC void h48map_clear(h48map_t [static 1]); -STATIC void h48map_destroy(h48map_t [static 1]); -STATIC uint64_t h48map_lookup(h48map_t [static 1], uint64_t); -STATIC void h48map_insertmin(h48map_t [static 1], uint64_t, uint64_t); -STATIC uint64_t h48map_value(h48map_t [static 1], uint64_t); -STATIC kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]); +STATIC void h48map_create(h48map_t [NON_NULL], uint64_t, uint64_t); +STATIC void h48map_clear(h48map_t [NON_NULL]); +STATIC void h48map_destroy(h48map_t [NON_NULL]); +STATIC uint64_t h48map_lookup(h48map_t [NON_NULL], uint64_t); +STATIC void h48map_insertmin(h48map_t [NON_NULL], uint64_t, uint64_t); +STATIC uint64_t h48map_value(h48map_t [NON_NULL], uint64_t); +STATIC kvpair_t h48map_nextkvpair(h48map_t [NON_NULL], uint64_t [NON_NULL]); STATIC void -h48map_create(h48map_t map[static 1], uint64_t capacity, uint64_t randomizer) +h48map_create(h48map_t map[NON_NULL], uint64_t capacity, uint64_t randomizer) { map->capacity = capacity; map->randomizer = randomizer; @@ -17,20 +17,20 @@ h48map_create(h48map_t map[static 1], uint64_t capacity, uint64_t randomizer) } STATIC void -h48map_clear(h48map_t map[static 1]) +h48map_clear(h48map_t map[NON_NULL]) { memset(map->table, 0xFF, map->capacity * sizeof(uint64_t)); map->n = 0; } STATIC void -h48map_destroy(h48map_t map[static 1]) +h48map_destroy(h48map_t map[NON_NULL]) { free(map->table); } STATIC_INLINE uint64_t -h48map_lookup(h48map_t map[static 1], uint64_t x) +h48map_lookup(h48map_t map[NON_NULL], uint64_t x) { uint64_t hash, i; @@ -44,7 +44,7 @@ h48map_lookup(h48map_t map[static 1], uint64_t x) } STATIC_INLINE void -h48map_insertmin(h48map_t map[static 1], uint64_t key, uint64_t val) +h48map_insertmin(h48map_t map[NON_NULL], uint64_t key, uint64_t val) { uint64_t i, oldval, min; @@ -57,13 +57,13 @@ h48map_insertmin(h48map_t map[static 1], uint64_t key, uint64_t val) } STATIC_INLINE uint64_t -h48map_value(h48map_t map[static 1], uint64_t key) +h48map_value(h48map_t map[NON_NULL], uint64_t key) { return map->table[h48map_lookup(map, key)] >> MAP_KEYSHIFT; } STATIC kvpair_t -h48map_nextkvpair(h48map_t map[static 1], uint64_t p[static 1]) +h48map_nextkvpair(h48map_t map[NON_NULL], uint64_t p[NON_NULL]) { kvpair_t kv; uint64_t pair; diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index 4fd0aea..295ef88 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h @@ -64,27 +64,27 @@ typedef struct { STATIC long long solve_h48_dispatch(oriented_cube_t, const char *, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned long long, const unsigned char *, unsigned, char *, - long long [static NISSY_SIZE_SOLVE_STATS], int (*)(void *), void *); -STATIC_INLINE void h48_prune_pipeline(dfsarg_solve_h48_t [static 1], - h48_prune_t [static NMOVES], uint8_t, bool); + long long [SIZE(NISSY_SIZE_SOLVE_STATS)], int (*)(void *), void *); +STATIC_INLINE void h48_prune_pipeline(dfsarg_solve_h48_t [NON_NULL], + h48_prune_t [SIZE(NMOVES)], uint8_t, bool); STATIC_INLINE uint8_t h48_prune_lookup( - uint64_t, cube_t, dfsarg_solve_h48_t [static 1]); + uint64_t, cube_t, dfsarg_solve_h48_t [NON_NULL]); STATIC_INLINE uint8_t h48_prune_lookup_nocoord( - cube_t, dfsarg_solve_h48_t [static 1]); -STATIC_INLINE void h48_prune_restore_normal(const h48_prune_t [static 1], - dfsarg_solve_h48_t [static 1], uint8_t); -STATIC_INLINE void h48_prune_restore_inverse(const h48_prune_t [static 1], - dfsarg_solve_h48_t [static 1], uint8_t); + cube_t, dfsarg_solve_h48_t [NON_NULL]); +STATIC_INLINE void h48_prune_restore_normal(const h48_prune_t [NON_NULL], + dfsarg_solve_h48_t [NON_NULL], uint8_t); +STATIC_INLINE void h48_prune_restore_inverse(const h48_prune_t [NON_NULL], + dfsarg_solve_h48_t [NON_NULL], uint8_t); STATIC int64_t solve_h48_maketasks( - dfsarg_solve_h48_t [static 1], dfsarg_solve_h48_maketasks_t [static 1], - solve_h48_task_t [static H48_STARTING_CUBES], int [static 1]); + dfsarg_solve_h48_t [NON_NULL], dfsarg_solve_h48_maketasks_t [NON_NULL], + solve_h48_task_t [SIZE(H48_STARTING_CUBES)], int [NON_NULL]); STATIC wrapthread_return_t solve_h48_runthread(void *); -STATIC int64_t solve_h48_dfs(dfsarg_solve_h48_t [static 1]); -STATIC void solve_h48_log_solutions(solution_list_t [static 1], size_t); +STATIC int64_t solve_h48_dfs(dfsarg_solve_h48_t [NON_NULL]); +STATIC void solve_h48_log_solutions(solution_list_t [NON_NULL], size_t); STATIC int solve_h48_compare_tasks(const void *, const void *); STATIC int64_t solve_h48(oriented_cube_t, uint8_t, uint8_t, uint64_t, uint8_t, uint8_t, uint64_t, const unsigned char *, size_t, char *, - long long [static NISSY_SIZE_SOLVE_STATS], int (*)(void *), void *); + long long [SIZE(NISSY_SIZE_SOLVE_STATS)], int (*)(void *), void *); STATIC long long solve_h48_dispatch( oriented_cube_t oc, @@ -99,7 +99,7 @@ STATIC long long solve_h48_dispatch( const unsigned char *data, unsigned sols_size, char *sols, - long long stats[static NISSY_SIZE_SOLVE_STATS], + long long stats[SIZE(NISSY_SIZE_SOLVE_STATS)], int (*poll_status)(void *), void *poll_status_data ) @@ -120,7 +120,7 @@ STATIC_INLINE uint8_t h48_prune_lookup( uint64_t coord, cube_t cube, - dfsarg_solve_h48_t arg[static 1] + dfsarg_solve_h48_t arg[NON_NULL] ) { uint8_t p, pmin, pe; @@ -139,7 +139,7 @@ h48_prune_lookup( STATIC_INLINE uint8_t h48_prune_lookup_nocoord( cube_t cube, - dfsarg_solve_h48_t arg[static 1] + dfsarg_solve_h48_t arg[NON_NULL] ) { uint32_t cdata; @@ -152,8 +152,8 @@ h48_prune_lookup_nocoord( STATIC_INLINE void h48_prune_pipeline( - dfsarg_solve_h48_t arg[static 1], - h48_prune_t prune[static NMOVES], + dfsarg_solve_h48_t arg[NON_NULL], + h48_prune_t prune[SIZE(NMOVES)], uint8_t target, bool normal ) @@ -252,8 +252,8 @@ h48_prune_pipeline( STATIC_INLINE void h48_prune_restore_normal( - const h48_prune_t prune[static 1], - dfsarg_solve_h48_t arg[static 1], + const h48_prune_t prune[NON_NULL], + dfsarg_solve_h48_t arg[NON_NULL], uint8_t target ) { @@ -276,8 +276,8 @@ h48_prune_restore_normal( STATIC_INLINE void h48_prune_restore_inverse( - const h48_prune_t prune[static 1], - dfsarg_solve_h48_t arg[static 1], + const h48_prune_t prune[NON_NULL], + dfsarg_solve_h48_t arg[NON_NULL], uint8_t target ) { @@ -299,7 +299,7 @@ h48_prune_restore_inverse( } STATIC int64_t -solve_h48_dfs(dfsarg_solve_h48_t arg[static 1]) +solve_h48_dfs(dfsarg_solve_h48_t arg[NON_NULL]) { int64_t ret, n; uint8_t m, nm, nn, ni, target; @@ -450,10 +450,10 @@ solve_h48_runthread_end: STATIC int64_t solve_h48_maketasks( - dfsarg_solve_h48_t solve_arg[static 1], - dfsarg_solve_h48_maketasks_t mtarg[static 1], - solve_h48_task_t tasks[static H48_STARTING_CUBES], - int ntasks[static 1] + dfsarg_solve_h48_t solve_arg[NON_NULL], + dfsarg_solve_h48_maketasks_t mtarg[NON_NULL], + solve_h48_task_t tasks[SIZE(H48_STARTING_CUBES)], + int ntasks[NON_NULL] ) { int r; @@ -524,7 +524,7 @@ solve_h48_maketasks( } STATIC void -solve_h48_log_solutions(solution_list_t s[static 1], size_t e) +solve_h48_log_solutions(solution_list_t s[NON_NULL], size_t e) { size_t i; char b; @@ -561,7 +561,7 @@ solve_h48( const unsigned char *data, size_t solutions_size, char *solutions, - long long stats[static NISSY_SIZE_SOLVE_STATS], + long long stats[SIZE(NISSY_SIZE_SOLVE_STATS)], int (*poll_status)(void *), void *poll_status_data ) diff --git a/src/solvers/h48/utils.h b/src/solvers/h48/utils.h index 27fb2e5..d181eab 100644 --- a/src/solvers/h48/utils.h +++ b/src/solvers/h48/utils.h @@ -4,11 +4,11 @@ #define H48_HMAX UINT8_C(7) #endif -long long parse_h48h(const char *, uint8_t [static 1]); -STATIC long long dataid_h48(const char *, char [static NISSY_SIZE_DATAID]); +long long parse_h48h(const char *, uint8_t [NON_NULL]); +STATIC long long dataid_h48(const char *, char [SIZE(NISSY_SIZE_DATAID)]); long long -parse_h48h(const char *buf, uint8_t h[static 1]) +parse_h48h(const char *buf, uint8_t h[NON_NULL]) { char format_error_msg[100]; sprintf(format_error_msg, "[H48] Error parsing H48 solver: must be in " @@ -51,7 +51,7 @@ parse_h48h_error: } STATIC long long -dataid_h48(const char *str, char buf[static NISSY_SIZE_DATAID]) +dataid_h48(const char *str, char buf[SIZE(NISSY_SIZE_DATAID)]) { uint8_t h; long long err; -- cgit v1.3