aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/solutions.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-05-27 09:03:51 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-05-27 09:03:51 +0200
commit7c934801f88c640970ad41b5ddd39f4e39609f28 (patch)
tree76a065db76fbcbdec818b8b6cc8b108ac1c9eb49 /src/solvers/solutions.h
parent243a852d31483d10983c50978d1d4471efd0e553 (diff)
downloadnissy-core-7c934801f88c640970ad41b5ddd39f4e39609f28.tar.gz
nissy-core-7c934801f88c640970ad41b5ddd39f4e39609f28.zip
Removed VLA notation from function parameters.
I found out that this gives undefined behavior when then size is 0. Better not to have it at all, it is confusing for other developers anyway.
Diffstat (limited to 'src/solvers/solutions.h')
-rw-r--r--src/solvers/solutions.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/solvers/solutions.h b/src/solvers/solutions.h
index 182ae18..cdb1fdb 100644
--- a/src/solvers/solutions.h
+++ b/src/solvers/solutions.h
@@ -1,11 +1,10 @@
1STATIC void solution_moves_reset(solution_moves_t [static 1]); 1STATIC void solution_moves_reset(solution_moves_t [static 1]);
2STATIC void solution_moves_transform(solution_moves_t [static 1], uint8_t); 2STATIC void solution_moves_transform(solution_moves_t [static 1], uint8_t);
3STATIC void solution_moves_reorient(solution_moves_t [static 1], uint8_t); 3STATIC void solution_moves_reorient(solution_moves_t [static 1], uint8_t);
4STATIC bool solution_list_init( 4STATIC bool solution_list_init(solution_list_t [static 1], size_t, char *);
5 solution_list_t [static 1], size_t n, char [n]);
6STATIC bool solution_moves_equal( 5STATIC bool solution_moves_equal(
7 const solution_moves_t [static 1], const solution_moves_t [static 1]); 6 const solution_moves_t [static 1], const solution_moves_t [static 1]);
8STATIC bool solution_moves_is_duplicate(size_t n, const solution_moves_t[n+1]); 7STATIC bool solution_moves_is_duplicate(size_t, const solution_moves_t *);
9STATIC bool appendchar(solution_list_t [static 1], char); 8STATIC bool appendchar(solution_list_t [static 1], char);
10STATIC bool appendnormal( 9STATIC bool appendnormal(
11 const solution_moves_t [static 1], solution_list_t [static 1]); 10 const solution_moves_t [static 1], solution_list_t [static 1]);
@@ -50,7 +49,7 @@ solution_moves_reorient(solution_moves_t moves[static 1], uint8_t or)
50} 49}
51 50
52STATIC bool 51STATIC bool
53solution_list_init(solution_list_t sols[static 1], size_t n, char buf[n]) 52solution_list_init(solution_list_t sols[static 1], size_t n, char *buf)
54{ 53{
55 if (n == 0) 54 if (n == 0)
56 return false; 55 return false;
@@ -88,7 +87,7 @@ solution_moves_equal(
88} 87}
89 88
90STATIC bool 89STATIC bool
91solution_moves_is_duplicate(size_t n, const solution_moves_t s[n+1]) 90solution_moves_is_duplicate(size_t n, const solution_moves_t *s)
92{ 91{
93 size_t i; 92 size_t i;
94 93

Generated with cgit - Back to sebastiano.tronto.net