aboutsummaryrefslogtreecommitdiff
path: root/test/122_gendata_h48short
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/122_gendata_h48short
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/122_gendata_h48short')
-rw-r--r--test/122_gendata_h48short/gendata_h48short_tests.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/122_gendata_h48short/gendata_h48short_tests.c b/test/122_gendata_h48short/gendata_h48short_tests.c
index 0de9408..0996f8c 100644
--- a/test/122_gendata_h48short/gendata_h48short_tests.c
+++ b/test/122_gendata_h48short/gendata_h48short_tests.c
@@ -2,11 +2,11 @@
2 2
3#define MAXPOS 200 3#define MAXPOS 200
4 4
5void h48map_create(h48map_t [static 1], uint64_t, uint64_t); 5void h48map_create(h48map_t [NON_NULL], uint64_t, uint64_t);
6void h48map_destroy(h48map_t [static 1]); 6void h48map_destroy(h48map_t [NON_NULL]);
7kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]); 7kvpair_t h48map_nextkvpair(h48map_t [NON_NULL], uint64_t [NON_NULL]);
8size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); 8size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *);
9uint64_t gendata_h48short(gendata_h48short_arg_t [static 1]); 9uint64_t gendata_h48short(gendata_h48short_arg_t [NON_NULL]);
10 10
11char str[STRLENMAX]; 11char str[STRLENMAX];
12 12
@@ -34,7 +34,7 @@ void run(void) {
34 34
35 capacity = readl(); 35 capacity = readl();
36 randomizer = readl(); 36 randomizer = readl();
37 arg.maxdepth = readl(); 37 arg.maxdepth = (uint8_t)readl();
38 arg.crep = crep; 38 arg.crep = crep;
39 arg.selfsim = selfsim; 39 arg.selfsim = selfsim;
40 arg.map = &map; 40 arg.map = &map;

Generated with cgit - Back to sebastiano.tronto.net