aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/tables.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/tables.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/tables.h')
-rw-r--r--src/solvers/tables.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/solvers/tables.h b/src/solvers/tables.h
index 53091f9..1e76fc1 100644
--- a/src/solvers/tables.h
+++ b/src/solvers/tables.h
@@ -1,11 +1,13 @@
1STATIC uint64_t read_unaligned_u64(const unsigned char [static sizeof(uint64_t)]); 1STATIC uint64_t read_unaligned_u64(
2STATIC void write_unaligned_u64(unsigned char [static sizeof(uint64_t)], uint64_t); 2 const unsigned char [static sizeof(uint64_t)]);
3STATIC void write_unaligned_u64(
4 unsigned char [static sizeof(uint64_t)], uint64_t);
3STATIC int64_t readtableinfo( 5STATIC int64_t readtableinfo(
4 size_t n, const unsigned char [n], tableinfo_t [static 1]); 6 size_t, const unsigned char *, tableinfo_t [static 1]);
5STATIC int64_t readtableinfo_n( 7STATIC int64_t readtableinfo_n(
6 size_t n, const unsigned char [n], uint8_t, tableinfo_t [static 1]); 8 size_t, const unsigned char *, uint8_t, tableinfo_t [static 1]);
7STATIC int64_t writetableinfo( 9STATIC int64_t writetableinfo(
8 const tableinfo_t [static 1], size_t n, unsigned char [n]); 10 const tableinfo_t [static 1], size_t, unsigned char *);
9 11
10STATIC uint64_t 12STATIC uint64_t
11read_unaligned_u64(const unsigned char buf[static sizeof(uint64_t)]) 13read_unaligned_u64(const unsigned char buf[static sizeof(uint64_t)])
@@ -26,7 +28,7 @@ write_unaligned_u64(unsigned char buf[static sizeof(uint64_t)], uint64_t x)
26STATIC int64_t 28STATIC int64_t
27readtableinfo( 29readtableinfo(
28 size_t buf_size, 30 size_t buf_size,
29 const unsigned char buf[buf_size], 31 const unsigned char *buf,
30 tableinfo_t info[static 1] 32 tableinfo_t info[static 1]
31) 33)
32{ 34{
@@ -70,7 +72,7 @@ readtableinfo(
70STATIC int64_t 72STATIC int64_t
71readtableinfo_n( 73readtableinfo_n(
72 size_t buf_size, 74 size_t buf_size,
73 const unsigned char buf[buf_size], 75 const unsigned char *buf,
74 uint8_t n, 76 uint8_t n,
75 tableinfo_t info[static 1] 77 tableinfo_t info[static 1]
76) 78)
@@ -88,7 +90,7 @@ STATIC int64_t
88writetableinfo( 90writetableinfo(
89 const tableinfo_t info[static 1], 91 const tableinfo_t info[static 1],
90 size_t data_size, 92 size_t data_size,
91 unsigned char buf[data_size] 93 unsigned char *buf
92) 94)
93{ 95{
94 size_t i; 96 size_t i;

Generated with cgit - Back to sebastiano.tronto.net