From 56048d13b73ec6e6a9c59d62e82f41e69a3994bd Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 25 Mar 2025 18:35:47 +0100 Subject: More safety with pointers using VLA function parameters --- src/arch/portable.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/arch/portable.h') 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) } STATIC void -pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12]) +pieces(cube_t cube[static 1], uint8_t c[static 8], uint8_t e[static 12]) { memcpy(c, cube->corner, 8); memcpy(e, cube->edge, 12); @@ -227,19 +227,19 @@ coord_esep(cube_t c) } STATIC_INLINE void -copy_corners(cube_t *dest, cube_t src) +copy_corners(cube_t dest[static 1], cube_t src) { memcpy(&dest->corner, src.corner, sizeof(src.corner)); } STATIC_INLINE void -copy_edges(cube_t *dest, cube_t src) +copy_edges(cube_t dest[static 1], cube_t src) { memcpy(&dest->edge, src.edge, sizeof(src.edge)); } STATIC_INLINE void -set_eo(cube_t *cube, int64_t eo) +set_eo(cube_t cube[static 1], int64_t eo) { uint8_t i, sum, flip; -- cgit v1.3