diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-04-06 15:55:33 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-04-06 15:55:33 +0200 |
| commit | fc41f7917531693680b5baf71ffe38c47333fe84 (patch) | |
| tree | a6e62232e05e7779034c5f9d1bf743b6f1c198e3 /src/solvers/h48/coordinate.h | |
| parent | fe534f1497da6447153064d7bba00243000f803b (diff) | |
| download | nissy-core-fc41f7917531693680b5baf71ffe38c47333fe84.tar.gz nissy-core-fc41f7917531693680b5baf71ffe38c47333fe84.zip | |
Make the project build with Microsoft's broken C compiler.
MSVC is not fully C11-compliant, even when compiling with /std:c11.
Some changes were needed to make the codebase compatible. Notably, the
notation a[static N] and a[n] for function parameters of array type is
not supported, so that had to be hidden behind a macro. Atomic types
are also an experimental feature, apparently, but at least they work
with the correct compiler flag.
One thing that MSVC does well, however, is warning on integer conversions
on /W4 level. I am not sure if Clang and GCC have something similar,
so I took this chance to fix some of these.
Diffstat (limited to 'src/solvers/h48/coordinate.h')
| -rw-r--r-- | src/solvers/h48/coordinate.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/solvers/h48/coordinate.h b/src/solvers/h48/coordinate.h index a7f0087..695efc3 100644 --- a/src/solvers/h48/coordinate.h +++ b/src/solvers/h48/coordinate.h | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | STATIC_INLINE uint64_t coord_h48( | 1 | STATIC_INLINE uint64_t coord_h48( |
| 2 | cube_t, const uint32_t [static COCSEP_TABLESIZE], uint8_t); | 2 | cube_t, const uint32_t [SIZE(COCSEP_TABLESIZE)], uint8_t); |
| 3 | STATIC_INLINE uint64_t coord_h48_edges(cube_t, uint64_t, uint8_t, uint8_t); | 3 | STATIC_INLINE uint64_t coord_h48_edges(cube_t, uint64_t, uint8_t, uint8_t); |
| 4 | STATIC_INLINE cube_t invcoord_h48( | 4 | STATIC_INLINE cube_t invcoord_h48( |
| 5 | uint64_t, const cube_t [static COCSEP_CLASSES], uint8_t); | 5 | uint64_t, const cube_t [SIZE(COCSEP_CLASSES)], uint8_t); |
| 6 | 6 | ||
| 7 | STATIC_INLINE uint64_t | 7 | STATIC_INLINE uint64_t |
| 8 | coord_h48( | 8 | coord_h48( |
| 9 | cube_t c, | 9 | cube_t c, |
| 10 | const uint32_t cocsepdata[static COCSEP_TABLESIZE], | 10 | const uint32_t cocsepdata[SIZE(COCSEP_TABLESIZE)], |
| 11 | uint8_t h | 11 | uint8_t h |
| 12 | ) | 12 | ) |
| 13 | { | 13 | { |
| @@ -47,7 +47,7 @@ returned cube is a transformed cube of one that gives the correct value. | |||
| 47 | STATIC_INLINE cube_t | 47 | STATIC_INLINE cube_t |
| 48 | invcoord_h48( | 48 | invcoord_h48( |
| 49 | uint64_t i, | 49 | uint64_t i, |
| 50 | const cube_t crep[static COCSEP_CLASSES], | 50 | const cube_t crep[SIZE(COCSEP_CLASSES)], |
| 51 | uint8_t h | 51 | uint8_t h |
| 52 | ) | 52 | ) |
| 53 | { | 53 | { |
