aboutsummaryrefslogtreecommitdiff
path: root/test/131_coorddata_dr
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-04-06 15:55:33 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2026-04-06 15:55:33 +0200
commitfc41f7917531693680b5baf71ffe38c47333fe84 (patch)
treea6e62232e05e7779034c5f9d1bf743b6f1c198e3 /test/131_coorddata_dr
parentfe534f1497da6447153064d7bba00243000f803b (diff)
downloadnissy-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 'test/131_coorddata_dr')
-rw-r--r--test/131_coorddata_dr/coorddata_dr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/131_coorddata_dr/coorddata_dr.c b/test/131_coorddata_dr/coorddata_dr.c
index d8ac94a..d262fe3 100644
--- a/test/131_coorddata_dr/coorddata_dr.c
+++ b/test/131_coorddata_dr/coorddata_dr.c
@@ -11,7 +11,7 @@ size_t coordinate_dr_gendata(unsigned char *);
11 11
12void run(void) { 12void run(void) {
13 bool found; 13 bool found;
14 uint64_t t; 14 uint8_t t;
15 char str[STRLENMAX]; 15 char str[STRLENMAX];
16 unsigned char *data; 16 unsigned char *data;
17 size_t size; 17 size_t size;
@@ -33,8 +33,8 @@ void run(void) {
33 goto cleanup; 33 goto cleanup;
34 } 34 }
35 35
36 for (t = 0, found = false; t < 48; t++) { 36 for (t = 0, found = false, coord2 = UINT64_MAX; t < 48; t++) {
37 if (!((UINT64_C(1) << t) & TGROUP)) 37 if (!((UINT64_C(1) << (uint8_t)t) & TGROUP))
38 continue; 38 continue;
39 39
40 coord2 = coordinate_dr_coord(transform(cube, t), data); 40 coord2 = coordinate_dr_coord(transform(cube, t), data);

Generated with cgit - Back to sebastiano.tronto.net