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/solvers/h48/coordinate.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/solvers/h48/coordinate.h') diff --git a/src/solvers/h48/coordinate.h b/src/solvers/h48/coordinate.h index 6caac2a..eb08fd8 100644 --- a/src/solvers/h48/coordinate.h +++ b/src/solvers/h48/coordinate.h @@ -1,12 +1,15 @@ -/* Macros defined in a separate file for easier testing */ -#include "coordinate_macros.h" - -STATIC_INLINE int64_t coord_h48(cube_t, const uint32_t *, uint8_t); +STATIC_INLINE int64_t coord_h48( + cube_t, const uint32_t [static COCSEP_TABLESIZE], uint8_t); STATIC_INLINE int64_t coord_h48_edges(cube_t, int64_t, uint8_t, uint8_t); -STATIC_INLINE cube_t invcoord_h48(int64_t, const cube_t *, uint8_t); +STATIC_INLINE cube_t invcoord_h48( + int64_t, const cube_t [static COCSEP_CLASSES], uint8_t); STATIC_INLINE int64_t -coord_h48(cube_t c, const uint32_t *cocsepdata, uint8_t h) +coord_h48( + cube_t c, + const uint32_t cocsepdata[static COCSEP_TABLESIZE], + uint8_t h +) { int64_t cocsep, coclass; uint32_t data; @@ -42,7 +45,11 @@ the given value, because it works up to symmetry. This means that the returned cube is a transformed cube of one that gives the correct value. */ STATIC_INLINE cube_t -invcoord_h48(int64_t i, const cube_t *crep, uint8_t h) +invcoord_h48( + int64_t i, + const cube_t crep[static COCSEP_CLASSES], + uint8_t h +) { cube_t ret; int64_t hh, coclass, ee, esep, eo; -- cgit v1.3