From 1f7e8e937d0e71e7eb3b5deab38b34d0a0159d88 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 17 Sep 2026 21:50:34 +0200 Subject: Added include guards --- src/solvers/coord/checkdata.h | 5 +++++ src/solvers/coord/common.h | 5 +++++ src/solvers/coord/coord.h | 5 +++++ src/solvers/coord/corners.h | 5 +++++ src/solvers/coord/cornersx.h | 5 +++++ src/solvers/coord/cpepe.h | 5 +++++ src/solvers/coord/dr.h | 5 +++++ src/solvers/coord/dreo.h | 5 +++++ src/solvers/coord/drfin.h | 5 +++++ src/solvers/coord/drfinnoe.h | 5 +++++ src/solvers/coord/drslice.h | 5 +++++ src/solvers/coord/eo.h | 5 +++++ src/solvers/coord/gendata.h | 5 +++++ src/solvers/coord/htr.h | 5 +++++ src/solvers/coord/list.h | 5 +++++ src/solvers/coord/multisolve.h | 5 +++++ src/solvers/coord/solve.h | 5 +++++ src/solvers/coord/types_macros.h | 5 +++++ src/solvers/coord/utils.h | 5 +++++ 19 files changed, 95 insertions(+) (limited to 'src/solvers/coord') diff --git a/src/solvers/coord/checkdata.h b/src/solvers/coord/checkdata.h index 51265a8..a5d5316 100644 --- a/src/solvers/coord/checkdata.h +++ b/src/solvers/coord/checkdata.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_CHECKDATA_H +#define SOLVERS_COORD_CHECKDATA_H + STATIC long long checkdata_coord_dispatch( const char *, unsigned long long, const unsigned char *); STATIC long long checkdata_coord( @@ -120,3 +123,5 @@ checkdata_multicoord( return NISSY_OK; } + +#endif /* SOLVERS_COORD_CHECKDATA_H */ diff --git a/src/solvers/coord/common.h b/src/solvers/coord/common.h index 3a62e85..8e6db20 100644 --- a/src/solvers/coord/common.h +++ b/src/solvers/coord/common.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_COMMON_H +#define SOLVERS_COORD_COMMON_H + STATIC uint64_t coord_coord_generic( const coord_t [NON_NULL], cube_t, const unsigned char *); STATIC cube_t coord_cube_generic( @@ -229,3 +232,5 @@ coordinate_merge_cpco(cube_t cp, cube_t co) return merged; } + +#endif /* SOLVERS_COORD_COMMON_H */ diff --git a/src/solvers/coord/coord.h b/src/solvers/coord/coord.h index 98f4d05..6c4cc1b 100644 --- a/src/solvers/coord/coord.h +++ b/src/solvers/coord/coord.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_COORD_H +#define SOLVERS_COORD_COORD_H + #include "types_macros.h" #include "common.h" #include "eo.h" @@ -16,3 +19,5 @@ #include "checkdata.h" #include "solve.h" #include "multisolve.h" + +#endif /* SOLVERS_COORD_COORD_H */ diff --git a/src/solvers/coord/corners.h b/src/solvers/coord/corners.h index cc0d9a5..6dd60b5 100644 --- a/src/solvers/coord/corners.h +++ b/src/solvers/coord/corners.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_CORNERS_H +#define SOLVERS_COORD_CORNERS_H + #define CLASSES_CP_48 984 STATIC uint64_t coordinate_corners_coord(const cube_t, const unsigned char *); @@ -70,3 +73,5 @@ coordinate_corners_gendata(unsigned char *data) { return coord_gendata_generic(&coordinate_corners, data); } + +#endif /* SOLVERS_COORD_CORNERS_H */ diff --git a/src/solvers/coord/cornersx.h b/src/solvers/coord/cornersx.h index 788db8d..f4b564f 100644 --- a/src/solvers/coord/cornersx.h +++ b/src/solvers/coord/cornersx.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_CORNERSX_H +#define SOLVERS_COORD_CORNERSX_H + STATIC bool is_cornersx_solved(uint64_t, const unsigned char *); STATIC coord_t coordinate_cornersx = { @@ -74,3 +77,5 @@ is_cornersx_solved(uint64_t coord, const unsigned char *data) return false; } + +#endif /* SOLVERS_COORD_CORNERSX_H */ diff --git a/src/solvers/coord/cpepe.h b/src/solvers/coord/cpepe.h index 7035400..1ad80dd 100644 --- a/src/solvers/coord/cpepe.h +++ b/src/solvers/coord/cpepe.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_CPEPE_H +#define SOLVERS_COORD_CPEPE_H + STATIC uint64_t coordinate_cpepe_coord(const cube_t, const unsigned char *); STATIC cube_t coordinate_cpepe_cube(uint64_t, const unsigned char *); STATIC bool coordinate_cpepe_isnasty(uint64_t, const unsigned char *); @@ -71,3 +74,5 @@ coordinate_cpepe_gendata(unsigned char *data) { return coord_gendata_generic(&coordinate_cpepe, data); } + +#endif /* SOLVERS_COORD_CPEPE_H */ diff --git a/src/solvers/coord/dr.h b/src/solvers/coord/dr.h index 8100910..c5c73c2 100644 --- a/src/solvers/coord/dr.h +++ b/src/solvers/coord/dr.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_DR_H +#define SOLVERS_COORD_DR_H + #define DREOESEP_CLASSES UINT64_C(64430) #define DREOESEP_MAX (POW_2_11 * COMB_12_4) @@ -117,3 +120,5 @@ is_eoco_solvable(cube_t cube) { return cocount % 3 == 0 && eocount % 2 == 0; } + +#endif /* SOLVERS_COORD_DR_H */ diff --git a/src/solvers/coord/dreo.h b/src/solvers/coord/dreo.h index c5cacac..a201ae6 100644 --- a/src/solvers/coord/dreo.h +++ b/src/solvers/coord/dreo.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_DREO_H +#define SOLVERS_COORD_DREO_H + #define DRESEP_CLASSES 81 STATIC uint64_t coord_dresep_nosym(cube_t); @@ -101,3 +104,5 @@ is_dreo_solvable(cube_t cube) { return cocount % 3 == 0; } + +#endif /* SOLVERS_COORD_DREO_H */ diff --git a/src/solvers/coord/drfin.h b/src/solvers/coord/drfin.h index 569419b..ec645a2 100644 --- a/src/solvers/coord/drfin.h +++ b/src/solvers/coord/drfin.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_DRFIN_H +#define SOLVERS_COORD_DRFIN_H + STATIC bool is_drfin_solvable(cube_t); STATIC multicoord_t multicoordinate_drfin = { @@ -15,3 +18,5 @@ is_drfin_solvable(cube_t cube) coord_co(cube) == 0 && issolvable((oriented_cube_t){.cube = cube, .orientation = 0}); } + +#endif /* SOLVERS_COORD_DRFIN_H */ diff --git a/src/solvers/coord/drfinnoe.h b/src/solvers/coord/drfinnoe.h index 63f4edf..5ffffc3 100644 --- a/src/solvers/coord/drfinnoe.h +++ b/src/solvers/coord/drfinnoe.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_DRFINNOE_H +#define SOLVERS_COORD_DRFINNOE_H + /* TODO @@ -96,3 +99,5 @@ is_drfinnoe_solvable(cube_t cube) { coord_eo(transform_edges(cube, TRANS_URr)) == 0 && coord_co(cube) == 0; } + +#endif /* SOLVERS_COORD_DRFINNOE_H */ diff --git a/src/solvers/coord/drslice.h b/src/solvers/coord/drslice.h index 42699f8..87bf87e 100644 --- a/src/solvers/coord/drslice.h +++ b/src/solvers/coord/drslice.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_DRSLICE_H +#define SOLVERS_COORD_DRSLICE_H + /* The DRSLICE coordinate is almost identical to DRFINNOE, but it allows for the centers of the E layer to be off by a rotation. For this reason we reuse @@ -95,3 +98,5 @@ is_drslice_solved(uint64_t i, const unsigned char *data) /* Pre-computed coordinates of U D' (= U' D up to trans) and U2 D2 */ return i == 0 || i == 109779816 || i == 68468527; } + +#endif /* SOLVERS_COORD_DRSLICE_H */ diff --git a/src/solvers/coord/eo.h b/src/solvers/coord/eo.h index 42196af..a5a0e85 100644 --- a/src/solvers/coord/eo.h +++ b/src/solvers/coord/eo.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_EO_H +#define SOLVERS_COORD_EO_H + STATIC uint64_t coordinate_eo_coord(cube_t, const unsigned char *); STATIC cube_t coordinate_eo_cube(uint64_t, const unsigned char *); STATIC bool coordinate_eo_isnasty(uint64_t, const unsigned char *); @@ -57,3 +60,5 @@ coordinate_eo_gendata(unsigned char *data) { return 0; } + +#endif /* SOLVERS_COORD_EO_H */ diff --git a/src/solvers/coord/gendata.h b/src/solvers/coord/gendata.h index edf6ce6..0acf9c0 100644 --- a/src/solvers/coord/gendata.h +++ b/src/solvers/coord/gendata.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_GENDATA_H +#define SOLVERS_COORD_GENDATA_H + STATIC size_t gendata_coord(const coord_t [NON_NULL], unsigned char *); STATIC size_t gendata_multicoord( const multicoord_t [NON_NULL], unsigned char *); @@ -353,3 +356,5 @@ set_coord_pval( table[COORD_INDEX(i)] = (table[COORD_INDEX(i)] & (~COORD_MASK(i))) | (val << COORD_SHIFT(i)); } + +#endif /* SOLVERS_COORD_GENDATA_H */ diff --git a/src/solvers/coord/htr.h b/src/solvers/coord/htr.h index 602625b..d6fc311 100644 --- a/src/solvers/coord/htr.h +++ b/src/solvers/coord/htr.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_HTR_H +#define SOLVERS_COORD_HTR_H + STATIC uint64_t coordinate_htr_coord(cube_t, const unsigned char *); STATIC cube_t coordinate_htr_cube(uint64_t, const unsigned char *); STATIC bool coordinate_htr_isnasty(uint64_t, const unsigned char *); @@ -123,3 +126,5 @@ is_cp_htr(uint64_t i, const unsigned char *data) return e == 0 && is_cp16_htr_table[c / 8] & (UINT8_C(1) << (c % 8)); } + +#endif /* SOLVERS_COORD_HTR_H */ diff --git a/src/solvers/coord/list.h b/src/solvers/coord/list.h index 6856c13..71f7920 100644 --- a/src/solvers/coord/list.h +++ b/src/solvers/coord/list.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_LIST_H +#define SOLVERS_COORD_LIST_H + coord_t *all_coordinates[] = { &coordinate_eo, &coordinate_dr, @@ -15,3 +18,5 @@ multicoord_t *all_multicoordinates[] = { &multicoordinate_drfin, NULL }; + +#endif /* SOLVERS_COORD_LIST_H */ diff --git a/src/solvers/coord/multisolve.h b/src/solvers/coord/multisolve.h index efd287d..4990a39 100644 --- a/src/solvers/coord/multisolve.h +++ b/src/solvers/coord/multisolve.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_MULTISOLVE_H +#define SOLVERS_COORD_MULTISOLVE_H + /* For now the only multicoordinate is DRFIN, and this solver reflects this. For example, NISS is not available. @@ -297,3 +300,5 @@ solve_multicoord_error_unsolvable: LOG("[%s solve] Error: cube not ready\n", mcoord->name); return NISSY_ERROR_UNSOLVABLE_CUBE; } + +#endif /* SOLVERS_COORD_MULTISOLVE_H */ diff --git a/src/solvers/coord/solve.h b/src/solvers/coord/solve.h index 6bb9af2..9a0c63c 100644 --- a/src/solvers/coord/solve.h +++ b/src/solvers/coord/solve.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_SOLVE_H +#define SOLVERS_COORD_SOLVE_H + typedef struct { cube_t cube; cube_t inverse; @@ -400,3 +403,5 @@ solve_coord_error_unsolvable: LOG("[%s solve] Error: cube not ready\n", coord->name); return NISSY_ERROR_UNSOLVABLE_CUBE; } + +#endif /* SOLVERS_COORD_SOLVE_H */ diff --git a/src/solvers/coord/types_macros.h b/src/solvers/coord/types_macros.h index 81db9d4..b042788 100644 --- a/src/solvers/coord/types_macros.h +++ b/src/solvers/coord/types_macros.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_TYPES_MACROS_H +#define SOLVERS_COORD_TYPES_MACROS_H + #define COORD_INDEX(i) ((i)/2) #define COORD_SHIFT(i) (UINT8_C(4) * (uint8_t)((i) % 2)) #define COORD_MASK(i) (UINT8_C(0xF) << COORD_SHIFT(i)) @@ -53,3 +56,5 @@ typedef struct { uint64_t moves_mask; bool (*is_solvable)(cube_t); } multicoord_t; + +#endif /* SOLVERS_COORD_TYPES_MACROS_H */ diff --git a/src/solvers/coord/utils.h b/src/solvers/coord/utils.h index 0062587..232d6f8 100644 --- a/src/solvers/coord/utils.h +++ b/src/solvers/coord/utils.h @@ -1,3 +1,6 @@ +#ifndef SOLVERS_COORD_UTILS_H +#define SOLVERS_COORD_UTILS_H + STATIC coord_t *parse_coord(size_t, const char *); STATIC multicoord_t *parse_multicoord(size_t, const char *); STATIC void parse_coord_and_trans( @@ -80,3 +83,5 @@ dataid_coord(const char *ca, char dataid[SIZE(NISSY_SIZE_DATAID)]) LOG("Error: cannot parse coordinate from '%s'\n", ca); return NISSY_ERROR_INVALID_SOLVER; } + +#endif /* SOLVERS_COORD_UTILS_H */ -- cgit v1.3