From e6be287bbfa6beda038ec8b085300c5dc9c2ecd8 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 4 Apr 2026 12:02:56 +0200 Subject: Use macro for [static N] --- src/arch/avx2.h | 10 +++++----- src/arch/common.h | 14 +++++++------- src/arch/neon.h | 10 +++++----- src/arch/portable.h | 10 +++++----- 4 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/arch') diff --git a/src/arch/avx2.h b/src/arch/avx2.h index b80b0fb..7d8deef 100644 --- a/src/arch/avx2.h +++ b/src/arch/avx2.h @@ -35,7 +35,7 @@ popcount_u32(uint32_t x) } STATIC void -pieces(cube_t cube[static 1], uint8_t c[static 8], uint8_t e[static 12]) +pieces(cube_t cube[NON_NULL], uint8_t c[SIZE(8)], uint8_t e[SIZE(12)]) { uint8_t aux[32]; @@ -161,7 +161,7 @@ coord_co(cube_t c) } STATIC_INLINE void -copy_co(cube_t cube[static 1], cube_t co) +copy_co(cube_t cube[NON_NULL], cube_t co) { cube_t coclean; @@ -268,19 +268,19 @@ invcoord_esep(uint64_t esep) } STATIC_INLINE void -copy_corners(cube_t dest[static 1], cube_t src) +copy_corners(cube_t dest[NON_NULL], cube_t src) { *dest = _mm256_blend_epi32(*dest, src, 0x0F); } STATIC_INLINE void -copy_edges(cube_t dest[static 1], cube_t src) +copy_edges(cube_t dest[NON_NULL], cube_t src) { *dest = _mm256_blend_epi32(*dest, src, 0xF0); } STATIC_INLINE void -set_eo(cube_t cube[static 1], uint64_t eo) +set_eo(cube_t cube[NON_NULL], uint64_t eo) { uint64_t eo12, eotop, eobot; __m256i veo; diff --git a/src/arch/common.h b/src/arch/common.h index 4412562..2a83fbf 100644 --- a/src/arch/common.h +++ b/src/arch/common.h @@ -14,7 +14,7 @@ STATIC_INLINE int popcount_u32(uint32_t); -STATIC void pieces(cube_t [static 1], uint8_t [static 8], uint8_t [static 12]); +STATIC void pieces(cube_t [NON_NULL], uint8_t [SIZE(8)], uint8_t [SIZE(12)]); STATIC_INLINE bool equal(cube_t, cube_t); STATIC_INLINE cube_t invertco(cube_t); STATIC_INLINE cube_t compose_edges(cube_t, cube_t); @@ -34,12 +34,12 @@ STATIC_INLINE cube_t invcoord_epudsep(uint64_t); STATIC_INLINE bool is_eo_even(cube_t); -STATIC_INLINE void copy_corners(cube_t [static 1], cube_t); -STATIC_INLINE void copy_co(cube_t [static 1], cube_t); -STATIC_INLINE void copy_edges(cube_t [static 1], cube_t); -STATIC_INLINE void set_eo(cube_t [static 1], uint64_t); +STATIC_INLINE void copy_corners(cube_t [NON_NULL], cube_t); +STATIC_INLINE void copy_co(cube_t [NON_NULL], cube_t); +STATIC_INLINE void copy_edges(cube_t [NON_NULL], cube_t); +STATIC_INLINE void set_eo(cube_t [NON_NULL], uint64_t); -STATIC_INLINE void invcoord_esep_array(uint64_t, uint64_t, uint8_t[static 12]); +STATIC_INLINE void invcoord_esep_array(uint64_t, uint64_t, uint8_t[SIZE(12)]); STATIC_INLINE cube_t invcoord_eoesep(uint64_t); STATIC_INLINE uint64_t coord_epudsep_array(const uint8_t [8]); STATIC_INLINE void invcoord_epudsep_array(uint64_t, uint8_t [8]); @@ -52,7 +52,7 @@ STATIC_INLINE uint64_t coord_epe(cube_t); STATIC_INLINE cube_t invcoord_epe(uint64_t); STATIC_INLINE void -invcoord_esep_array(uint64_t set1, uint64_t set2, uint8_t mem[static 12]) +invcoord_esep_array(uint64_t set1, uint64_t set2, uint8_t mem[SIZE(12)]) { uint64_t bit1, bit2, i, j, jj, k, l, s, v, w, is1; uint8_t slice[3] = {0}; diff --git a/src/arch/neon.h b/src/arch/neon.h index f997813..1157938 100644 --- a/src/arch/neon.h +++ b/src/arch/neon.h @@ -48,7 +48,7 @@ popcount_u32(uint32_t x) } STATIC void -pieces(cube_t cube[static 1], uint8_t c[static 8], uint8_t e[static 12]) +pieces(cube_t cube[NON_NULL], uint8_t c[SIZE(8)], uint8_t e[SIZE(12)]) { // First 8 bytes of the corner vector are copied from the c array vst1_u8(c, cube->corner); @@ -233,7 +233,7 @@ coord_co(cube_t c) } STATIC_INLINE void -copy_co(cube_t cube[static 1], cube_t co) +copy_co(cube_t cube[NON_NULL], cube_t co) { uint8x8_t coclean; @@ -329,19 +329,19 @@ coord_esep(cube_t c) } STATIC_INLINE void -copy_corners(cube_t dst[static 1], cube_t src) +copy_corners(cube_t dst[NON_NULL], cube_t src) { dst->corner = src.corner; } STATIC_INLINE void -copy_edges(cube_t dst[static 1], cube_t src) +copy_edges(cube_t dst[NON_NULL], cube_t src) { dst->edge = src.edge; } STATIC_INLINE void -set_eo(cube_t cube[static 1], uint64_t eo) +set_eo(cube_t cube[NON_NULL], uint64_t eo) { // Temp array to store the NEON vector uint8_t mem[16]; diff --git a/src/arch/portable.h b/src/arch/portable.h index 4b66fb6..311d427 100644 --- a/src/arch/portable.h +++ b/src/arch/portable.h @@ -35,7 +35,7 @@ popcount_u32(uint32_t x) } STATIC void -pieces(cube_t cube[static 1], uint8_t c[static 8], uint8_t e[static 12]) +pieces(cube_t cube[NON_NULL], uint8_t c[SIZE(8)], uint8_t e[SIZE(12)]) { memcpy(c, cube->corner, 8); memcpy(e, cube->edge, 12); @@ -155,7 +155,7 @@ inverse(cube_t cube) } STATIC_INLINE void -copy_co(cube_t cube[static 1], cube_t co) +copy_co(cube_t cube[NON_NULL], cube_t co) { uint8_t c; size_t i; @@ -280,19 +280,19 @@ invcoord_esep(uint64_t esep) } STATIC_INLINE void -copy_corners(cube_t dest[static 1], cube_t src) +copy_corners(cube_t dest[NON_NULL], cube_t src) { memcpy(&dest->corner, src.corner, sizeof(src.corner)); } STATIC_INLINE void -copy_edges(cube_t dest[static 1], cube_t src) +copy_edges(cube_t dest[NON_NULL], cube_t src) { memcpy(&dest->edge, src.edge, sizeof(src.edge)); } STATIC_INLINE void -set_eo(cube_t cube[static 1], uint64_t eo) +set_eo(cube_t cube[NON_NULL], uint64_t eo) { uint8_t i, sum, flip; -- cgit v1.3