Skip to content

Commit

Permalink
stubs-misc.c: use uintnat instead of long
Browse files Browse the repository at this point in the history
It makes a difference on IL32LLP64 platforms like Win64.
  • Loading branch information
xavierleroy committed Oct 27, 2024
1 parent ffe5c0b commit 078b362
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/stubs-misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <string.h>
#include <caml/mlvalues.h>

#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,
Expand All @@ -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) {
Expand Down

0 comments on commit 078b362

Please sign in to comment.