From 5cbc30aff1e4401d5e2312bde21dc509325c1c31 Mon Sep 17 00:00:00 2001 From: Mark Potse Date: Sat, 31 Jan 2026 22:04:09 +0100 Subject: [PATCH 1/2] corrected MMG5_swapbin_int() for the case MMG5_int has a different size than 8 bytes --- src/common/inout.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/inout.c b/src/common/inout.c index bef21a11f..dc7b2d468 100644 --- a/src/common/inout.c +++ b/src/common/inout.c @@ -63,11 +63,11 @@ MMG5_int MMG5_swapbin_int(MMG5_int sbin) MMG5_int out; char *p_in = (char *) &sbin; char *p_out = (char *) &out; - int8_t i; + int i, Nbytes=sizeof(MMG5_int); - for(i=0;i<8;i++) + for(i=0;i Date: Sat, 31 Jan 2026 22:11:13 +0100 Subject: [PATCH 2/2] comment on this (currently unused) function --- src/common/inout.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/inout.c b/src/common/inout.c index dc7b2d468..381f53965 100644 --- a/src/common/inout.c +++ b/src/common/inout.c @@ -57,6 +57,13 @@ int MMG5_swapbin(int sbin) /** * swap bytes if needed (conversion from big/little endian toward little/big * endian) + * + * NOTE this function is probably not useful for i/o because integer sizes + * in files are fixed and the size of MMG5_int is configurable; it is meant + * only for internal usage. This is perhaps some litter remaining from the + * interoduction of a configurable integer size. If it is ever needed, it + * should probably be MMG5_swapbin_int64(int64_t sbin). + * */ MMG5_int MMG5_swapbin_int(MMG5_int sbin) {