aboutsummaryrefslogtreecommitdiff
path: root/src/arch/portable.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-03-25 18:35:47 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2025-03-25 18:35:47 +0100
commit56048d13b73ec6e6a9c59d62e82f41e69a3994bd (patch)
tree49fc5d50e739a399897425756c08a73ba5924ddb /src/arch/portable.h
parent0f4931c8de298b0f97aba1757c9538f48adb30c6 (diff)
downloadnissy-core-56048d13b73ec6e6a9c59d62e82f41e69a3994bd.tar.gz
nissy-core-56048d13b73ec6e6a9c59d62e82f41e69a3994bd.zip
More safety with pointers using VLA function parameters
Diffstat (limited to 'src/arch/portable.h')
-rw-r--r--src/arch/portable.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/portable.h b/src/arch/portable.h
index b8c5211..4ac5fe7 100644
--- a/src/arch/portable.h
+++ b/src/arch/portable.h
@@ -22,7 +22,7 @@ popcount_u32(uint32_t x)
22} 22}
23 23
24STATIC void 24STATIC void
25pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12]) 25pieces(cube_t cube[static 1], uint8_t c[static 8], uint8_t e[static 12])
26{ 26{
27 memcpy(c, cube->corner, 8); 27 memcpy(c, cube->corner, 8);
28 memcpy(e, cube->edge, 12); 28 memcpy(e, cube->edge, 12);
@@ -227,19 +227,19 @@ coord_esep(cube_t c)
227} 227}
228 228
229STATIC_INLINE void 229STATIC_INLINE void
230copy_corners(cube_t *dest, cube_t src) 230copy_corners(cube_t dest[static 1], cube_t src)
231{ 231{
232 memcpy(&dest->corner, src.corner, sizeof(src.corner)); 232 memcpy(&dest->corner, src.corner, sizeof(src.corner));
233} 233}
234 234
235STATIC_INLINE void 235STATIC_INLINE void
236copy_edges(cube_t *dest, cube_t src) 236copy_edges(cube_t dest[static 1], cube_t src)
237{ 237{
238 memcpy(&dest->edge, src.edge, sizeof(src.edge)); 238 memcpy(&dest->edge, src.edge, sizeof(src.edge));
239} 239}
240 240
241STATIC_INLINE void 241STATIC_INLINE void
242set_eo(cube_t *cube, int64_t eo) 242set_eo(cube_t cube[static 1], int64_t eo)
243{ 243{
244 uint8_t i, sum, flip; 244 uint8_t i, sum, flip;
245 245

Generated with cgit - Back to sebastiano.tronto.net