diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-04-04 12:02:56 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-04-04 12:02:56 +0200 |
| commit | e6be287bbfa6beda038ec8b085300c5dc9c2ecd8 (patch) | |
| tree | 55d0acb9efde811985157068f3656514b90344cf /src/solvers/h48/solve.h | |
| parent | 2ac46cb4d4133e5d5de90bacfc9b6e979d1d6046 (diff) | |
| download | nissy-core-e6be287bbfa6beda038ec8b085300c5dc9c2ecd8.tar.gz nissy-core-e6be287bbfa6beda038ec8b085300c5dc9c2ecd8.zip | |
Use macro for [static N]
Diffstat (limited to 'src/solvers/h48/solve.h')
| -rw-r--r-- | src/solvers/h48/solve.h | 60 |
1 files changed, 30 insertions, 30 deletions
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 { | |||
| 64 | STATIC long long solve_h48_dispatch(oriented_cube_t, const char *, unsigned, | 64 | STATIC long long solve_h48_dispatch(oriented_cube_t, const char *, unsigned, |
| 65 | unsigned, unsigned, unsigned, unsigned, unsigned, unsigned long long, | 65 | unsigned, unsigned, unsigned, unsigned, unsigned, unsigned long long, |
| 66 | const unsigned char *, unsigned, char *, | 66 | const unsigned char *, unsigned, char *, |
| 67 | long long [static NISSY_SIZE_SOLVE_STATS], int (*)(void *), void *); | 67 | long long [SIZE(NISSY_SIZE_SOLVE_STATS)], int (*)(void *), void *); |
| 68 | STATIC_INLINE void h48_prune_pipeline(dfsarg_solve_h48_t [static 1], | 68 | STATIC_INLINE void h48_prune_pipeline(dfsarg_solve_h48_t [NON_NULL], |
| 69 | h48_prune_t [static NMOVES], uint8_t, bool); | 69 | h48_prune_t [SIZE(NMOVES)], uint8_t, bool); |
| 70 | STATIC_INLINE uint8_t h48_prune_lookup( | 70 | STATIC_INLINE uint8_t h48_prune_lookup( |
| 71 | uint64_t, cube_t, dfsarg_solve_h48_t [static 1]); | 71 | uint64_t, cube_t, dfsarg_solve_h48_t [NON_NULL]); |
| 72 | STATIC_INLINE uint8_t h48_prune_lookup_nocoord( | 72 | STATIC_INLINE uint8_t h48_prune_lookup_nocoord( |
| 73 | cube_t, dfsarg_solve_h48_t [static 1]); | 73 | cube_t, dfsarg_solve_h48_t [NON_NULL]); |
| 74 | STATIC_INLINE void h48_prune_restore_normal(const h48_prune_t [static 1], | 74 | STATIC_INLINE void h48_prune_restore_normal(const h48_prune_t [NON_NULL], |
| 75 | dfsarg_solve_h48_t [static 1], uint8_t); | 75 | dfsarg_solve_h48_t [NON_NULL], uint8_t); |
| 76 | STATIC_INLINE void h48_prune_restore_inverse(const h48_prune_t [static 1], | 76 | STATIC_INLINE void h48_prune_restore_inverse(const h48_prune_t [NON_NULL], |
| 77 | dfsarg_solve_h48_t [static 1], uint8_t); | 77 | dfsarg_solve_h48_t [NON_NULL], uint8_t); |
| 78 | STATIC int64_t solve_h48_maketasks( | 78 | STATIC int64_t solve_h48_maketasks( |
| 79 | dfsarg_solve_h48_t [static 1], dfsarg_solve_h48_maketasks_t [static 1], | 79 | dfsarg_solve_h48_t [NON_NULL], dfsarg_solve_h48_maketasks_t [NON_NULL], |
| 80 | solve_h48_task_t [static H48_STARTING_CUBES], int [static 1]); | 80 | solve_h48_task_t [SIZE(H48_STARTING_CUBES)], int [NON_NULL]); |
| 81 | STATIC wrapthread_return_t solve_h48_runthread(void *); | 81 | STATIC wrapthread_return_t solve_h48_runthread(void *); |
| 82 | STATIC int64_t solve_h48_dfs(dfsarg_solve_h48_t [static 1]); | 82 | STATIC int64_t solve_h48_dfs(dfsarg_solve_h48_t [NON_NULL]); |
| 83 | STATIC void solve_h48_log_solutions(solution_list_t [static 1], size_t); | 83 | STATIC void solve_h48_log_solutions(solution_list_t [NON_NULL], size_t); |
| 84 | STATIC int solve_h48_compare_tasks(const void *, const void *); | 84 | STATIC int solve_h48_compare_tasks(const void *, const void *); |
| 85 | STATIC int64_t solve_h48(oriented_cube_t, uint8_t, uint8_t, uint64_t, uint8_t, | 85 | STATIC int64_t solve_h48(oriented_cube_t, uint8_t, uint8_t, uint64_t, uint8_t, |
| 86 | uint8_t, uint64_t, const unsigned char *, size_t, char *, | 86 | uint8_t, uint64_t, const unsigned char *, size_t, char *, |
| 87 | long long [static NISSY_SIZE_SOLVE_STATS], int (*)(void *), void *); | 87 | long long [SIZE(NISSY_SIZE_SOLVE_STATS)], int (*)(void *), void *); |
| 88 | 88 | ||
| 89 | STATIC long long solve_h48_dispatch( | 89 | STATIC long long solve_h48_dispatch( |
| 90 | oriented_cube_t oc, | 90 | oriented_cube_t oc, |
| @@ -99,7 +99,7 @@ STATIC long long solve_h48_dispatch( | |||
| 99 | const unsigned char *data, | 99 | const unsigned char *data, |
| 100 | unsigned sols_size, | 100 | unsigned sols_size, |
| 101 | char *sols, | 101 | char *sols, |
| 102 | long long stats[static NISSY_SIZE_SOLVE_STATS], | 102 | long long stats[SIZE(NISSY_SIZE_SOLVE_STATS)], |
| 103 | int (*poll_status)(void *), | 103 | int (*poll_status)(void *), |
| 104 | void *poll_status_data | 104 | void *poll_status_data |
| 105 | ) | 105 | ) |
| @@ -120,7 +120,7 @@ STATIC_INLINE uint8_t | |||
| 120 | h48_prune_lookup( | 120 | h48_prune_lookup( |
| 121 | uint64_t coord, | 121 | uint64_t coord, |
| 122 | cube_t cube, | 122 | cube_t cube, |
| 123 | dfsarg_solve_h48_t arg[static 1] | 123 | dfsarg_solve_h48_t arg[NON_NULL] |
| 124 | ) | 124 | ) |
| 125 | { | 125 | { |
| 126 | uint8_t p, pmin, pe; | 126 | uint8_t p, pmin, pe; |
| @@ -139,7 +139,7 @@ h48_prune_lookup( | |||
| 139 | STATIC_INLINE uint8_t | 139 | STATIC_INLINE uint8_t |
| 140 | h48_prune_lookup_nocoord( | 140 | h48_prune_lookup_nocoord( |
| 141 | cube_t cube, | 141 | cube_t cube, |
| 142 | dfsarg_solve_h48_t arg[static 1] | 142 | dfsarg_solve_h48_t arg[NON_NULL] |
| 143 | ) | 143 | ) |
| 144 | { | 144 | { |
| 145 | uint32_t cdata; | 145 | uint32_t cdata; |
| @@ -152,8 +152,8 @@ h48_prune_lookup_nocoord( | |||
| 152 | 152 | ||
| 153 | STATIC_INLINE void | 153 | STATIC_INLINE void |
| 154 | h48_prune_pipeline( | 154 | h48_prune_pipeline( |
| 155 | dfsarg_solve_h48_t arg[static 1], | 155 | dfsarg_solve_h48_t arg[NON_NULL], |
| 156 | h48_prune_t prune[static NMOVES], | 156 | h48_prune_t prune[SIZE(NMOVES)], |
| 157 | uint8_t target, | 157 | uint8_t target, |
| 158 | bool normal | 158 | bool normal |
| 159 | ) | 159 | ) |
| @@ -252,8 +252,8 @@ h48_prune_pipeline( | |||
| 252 | 252 | ||
| 253 | STATIC_INLINE void | 253 | STATIC_INLINE void |
| 254 | h48_prune_restore_normal( | 254 | h48_prune_restore_normal( |
| 255 | const h48_prune_t prune[static 1], | 255 | const h48_prune_t prune[NON_NULL], |
| 256 | dfsarg_solve_h48_t arg[static 1], | 256 | dfsarg_solve_h48_t arg[NON_NULL], |
| 257 | uint8_t target | 257 | uint8_t target |
| 258 | ) | 258 | ) |
| 259 | { | 259 | { |
| @@ -276,8 +276,8 @@ h48_prune_restore_normal( | |||
| 276 | 276 | ||
| 277 | STATIC_INLINE void | 277 | STATIC_INLINE void |
| 278 | h48_prune_restore_inverse( | 278 | h48_prune_restore_inverse( |
| 279 | const h48_prune_t prune[static 1], | 279 | const h48_prune_t prune[NON_NULL], |
| 280 | dfsarg_solve_h48_t arg[static 1], | 280 | dfsarg_solve_h48_t arg[NON_NULL], |
| 281 | uint8_t target | 281 | uint8_t target |
| 282 | ) | 282 | ) |
| 283 | { | 283 | { |
| @@ -299,7 +299,7 @@ h48_prune_restore_inverse( | |||
| 299 | } | 299 | } |
| 300 | 300 | ||
| 301 | STATIC int64_t | 301 | STATIC int64_t |
| 302 | solve_h48_dfs(dfsarg_solve_h48_t arg[static 1]) | 302 | solve_h48_dfs(dfsarg_solve_h48_t arg[NON_NULL]) |
| 303 | { | 303 | { |
| 304 | int64_t ret, n; | 304 | int64_t ret, n; |
| 305 | uint8_t m, nm, nn, ni, target; | 305 | uint8_t m, nm, nn, ni, target; |
| @@ -450,10 +450,10 @@ solve_h48_runthread_end: | |||
| 450 | 450 | ||
| 451 | STATIC int64_t | 451 | STATIC int64_t |
| 452 | solve_h48_maketasks( | 452 | solve_h48_maketasks( |
| 453 | dfsarg_solve_h48_t solve_arg[static 1], | 453 | dfsarg_solve_h48_t solve_arg[NON_NULL], |
| 454 | dfsarg_solve_h48_maketasks_t mtarg[static 1], | 454 | dfsarg_solve_h48_maketasks_t mtarg[NON_NULL], |
| 455 | solve_h48_task_t tasks[static H48_STARTING_CUBES], | 455 | solve_h48_task_t tasks[SIZE(H48_STARTING_CUBES)], |
| 456 | int ntasks[static 1] | 456 | int ntasks[NON_NULL] |
| 457 | ) | 457 | ) |
| 458 | { | 458 | { |
| 459 | int r; | 459 | int r; |
| @@ -524,7 +524,7 @@ solve_h48_maketasks( | |||
| 524 | } | 524 | } |
| 525 | 525 | ||
| 526 | STATIC void | 526 | STATIC void |
| 527 | solve_h48_log_solutions(solution_list_t s[static 1], size_t e) | 527 | solve_h48_log_solutions(solution_list_t s[NON_NULL], size_t e) |
| 528 | { | 528 | { |
| 529 | size_t i; | 529 | size_t i; |
| 530 | char b; | 530 | char b; |
| @@ -561,7 +561,7 @@ solve_h48( | |||
| 561 | const unsigned char *data, | 561 | const unsigned char *data, |
| 562 | size_t solutions_size, | 562 | size_t solutions_size, |
| 563 | char *solutions, | 563 | char *solutions, |
| 564 | long long stats[static NISSY_SIZE_SOLVE_STATS], | 564 | long long stats[SIZE(NISSY_SIZE_SOLVE_STATS)], |
| 565 | int (*poll_status)(void *), | 565 | int (*poll_status)(void *), |
| 566 | void *poll_status_data | 566 | void *poll_status_data |
| 567 | ) | 567 | ) |
