From 078b3624f89c44e840914337816e922d56f034a9 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sun, 27 Oct 2024 14:57:50 +0100 Subject: [PATCH] stubs-misc.c: use `uintnat` instead of `long` It makes a difference on IL32LLP64 platforms like Win64. --- src/stubs-misc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/stubs-misc.c b/src/stubs-misc.c index 0da93ce..0ccbf45 100644 --- a/src/stubs-misc.c +++ b/src/stubs-misc.c @@ -14,7 +14,7 @@ #include #include -#define ALIGNMENT_OF(x) ((long)(x) & (sizeof(long) - 1)) +#define ALIGNMENT_OF(x) ((uintnat)(x) & (sizeof(uintnat) - 1)) CAMLprim value caml_xor_string(value src, value src_ofs, value dst, value dst_ofs, @@ -31,11 +31,11 @@ CAMLprim value caml_xor_string(value src, value src_ofs, d += 1; l -= 1; } - while (l >= sizeof(long)) { - *((long *) d) ^= *((long *) s); - s += sizeof(long); - d += sizeof(long); - l -= sizeof(long); + while (l >= sizeof(uintnat)) { + *((uintnat *) d) ^= *((uintnat *) s); + s += sizeof(uintnat); + d += sizeof(uintnat); + l -= sizeof(uintnat); } } while (l > 0) {